Unity 接入Admob SDK 打Apk 过程中遇到的问题

2024-04-26 07:12

本文主要是介绍Unity 接入Admob SDK 打Apk 过程中遇到的问题,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

最近项目接入google Admod ,接入的过程比较顺利按照官网给的教程一步一步来就行,但是打包过程遇到了一些问题,记录如下:

Unity 版本:2023.3.4  Admob 版本:Version 9.1.0

第一个问题:

* What went wrong:
Execution failed for task ':launcher:checkReleaseDuplicateClasses'.
> 1 exception was raised by workers:
  java.lang.RuntimeException: Duplicate class _COROUTINE.ArtificialStackFrames found in modules jetified-kotlinx-coroutines-core-jvm-1.7.1.jar (org.jetbrains.kotlinx.kotlinx-coroutines-core-jvm-1.7.1.jar) and jetified-kotlinx-coroutines-core-jvm-1.7.1.jar (org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.7.1)
  Duplicate class _COROUTINE.CoroutineDebuggingKt found in modules jetified-kotlinx-coroutines-core-jvm-1.7.1.jar (org.jetbrains.kotlinx.kotlinx-coroutines-core-jvm-1.7.1.jar) and jetified-kotlinx-coroutines-core-jvm-1.7.1.jar (org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.7.1)
  Duplicate class _COROUTINE._BOUNDARY found in modules jetified-kotlinx-coroutines-core-jvm-1.7.1.jar (org.jetbrains.kotlinx.kotlinx-coroutines-core-jvm-1.7.1.jar) and jetified-kotlinx-coroutines-core-jvm-1.7.1.jar (org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.7.1)
  Duplicate class _COROUTINE._CREATION found in modules jetified-kotlinx-coroutines-core-jvm-1.7.1.jar (org.jetbrains.kotlinx.kotlinx-coroutines-core-jvm-1.7.1.jar) and jetified-kotlinx-coroutines-core-jvm-1.7.1.jar (org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.7.1)
  Duplicate class android.support.customtabs.ICustomTabsCallback found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.customtabs.ICustomTabsCallback$Default found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.customtabs.ICustomTabsCallback$Stub found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.customtabs.ICustomTabsCallback$Stub$Proxy found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.customtabs.ICustomTabsService found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.customtabs.ICustomTabsService$Default found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.customtabs.ICustomTabsService$Stub found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.customtabs.ICustomTabsService$Stub$Proxy found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.customtabs.IPostMessageService found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.customtabs.IPostMessageService$Default found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.customtabs.IPostMessageService$Stub found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.customtabs.IPostMessageService$Stub$Proxy found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.customtabs.trusted.ITrustedWebActivityCallback found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.customtabs.trusted.ITrustedWebActivityCallback$Default found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.customtabs.trusted.ITrustedWebActivityCallback$Stub found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.customtabs.trusted.ITrustedWebActivityCallback$Stub$Proxy found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.customtabs.trusted.ITrustedWebActivityService found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.customtabs.trusted.ITrustedWebActivityService$Default found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.customtabs.trusted.ITrustedWebActivityService$Stub found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.customtabs.trusted.ITrustedWebActivityService$Stub$Proxy found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.v4.app.RemoteActionCompatParcelizer found in modules core-1.8.0-runtime.jar (androidx.core:core:1.8.0) and jetified-androidx.core.core-1.8.0-runtime.jar (:androidx.core.core-1.8.0:)
  Duplicate class android.support.v4.graphics.drawable.IconCompatParcelizer found in modules core-1.8.0-runtime.jar (androidx.core:core:1.8.0) and jetified-androidx.core.core-1.8.0-runtime.jar (:androidx.core.core-1.8.0:)
  Duplicate class android.support.v4.os.ResultReceiver found in modules core-1.8.0-runtime.jar (androidx.core:core:1.8.0) and jetified-androidx.core.core-1.8.0-runtime.jar (:androidx.core.core-1.8.0:)
  Duplicate class android.support.v4.os.ResultReceiver$1 found in modules core-1.8.0-runtime.jar (androidx.core:core:1.8.0) and jetified-androidx.core.core-1.8.0-runtime.jar (:androidx.core.core-1.8.0:)
  Duplicate class android.support.v4.os.ResultReceiver$MyResultReceiver found in modules core-1.8.0-runtime.jar (androidx.core:core:1.8.0) and jetified-androidx.core.core-1.8.0-runtime.jar (:androidx.core.core-1.8.0:)
  Duplicate class android.support.v4.os.ResultReceiver$MyRunnable found in modules core-1.8.0-runtime.jar (androidx.core:core:1.8.0) and jetified-androidx.core.core-1.8.0-runtime.jar (:androidx.core.core-1.8.0:)
  Duplicate class androidx.activity.Cancellable found in modules jetified-activity-1.0.0-runtime.jar (androidx.activity:activity:1.0.0) and jetified-androidx.activity.activity-1.0.0-runtime.jar (:androidx.activity.activity-1.0.0:)
  Duplicate class androidx.activity.ComponentActivity found in modules jetified-activity-1.0.0-runtime.jar (androidx.activity:activity:1.0.0) and jetified-androidx.activity.activity-1.0.0-runtime.jar (:androidx.activity.activity-1.0.0:)
  Duplicate class androidx.activity.ComponentActivity$1 found in modules jetified-activity-1.0.0-runtime.jar (androidx.activity:activity:1.0.0) and jetified-androidx.activity.activity-1.0.0-runtime.jar (:androidx.activity.activity-1.0.0:)
  Duplicate class androidx.activity.ComponentActivity$2 found in modules jetified-activity-1.0.0-runtime.jar (androidx.activity:activity:1.0.0) and jetified-androidx.activity.activity-1.0.0-runtime.jar (:androidx.activity.activity-1.0.0:)
  Duplicate class androidx.activity.ComponentActivity$3 found in modules jetified-activity-1.0.0-runtime.jar (androidx.activity:activity:1.0.0) and jetified-androidx.activity.activity-1.0.0-runtime.jar (:androidx.activity.activity-1.0.0:)
  Duplicate class androidx.activity.ComponentActivity$NonConfigurationInstances found in modules jetified-activity-1.0.0-runtime.jar (androidx.activity:activity:1.0.0) and jetified-androidx.activity.activity-1.0.0-runtime.jar (:androidx.activity.activity-1.0.0:)
  Duplicate class androidx.activity.ImmLeaksCleaner found in modules jetified-activity-1.0.0-runtime.jar (androidx.activity:activity:1.0.0) and jetified-androidx.activity.activity-1.0.0-runtime.jar (:androidx.activity.activity-1.0.0:)
  Duplicate class androidx.activity.OnBackPressedCallback found in modules jetified-activity-1.0.0-runtime.jar (androidx.activity:activity:1.0.0) and jetified-androidx.activity.activity-1.0.0-runtime.jar (:androidx.activity.activity-1.0.0:)
  Duplicate class androidx.activity.OnBackPressedDispatcher found in modules jetified-activity-1.0.0-runtime.jar (androidx.activity:activity:1.0.0) and jetified-androidx.activity.activity-1.0.0-runtime.jar (:androidx.activity.activity-1.0.0:)
  Duplicate class androidx.activity.OnBackPressedDispatcher$LifecycleOnBackPressedCancellable found in modules jetified-activity-1.0.0-runtime.jar (androidx.activity:activity:1.0.0) and jetified-androidx.activity.activity-1.0.0-runtime.jar (:androidx.activity.activity-1.0.0:)
  Duplicate class androidx.activity.OnBackPressedDispatcher$OnBackPressedCancellable found in modules jetified-activity-1.0.0-runtime.jar (androidx.activity:activity:1.0.0) and jetified-androidx.activity.activity-1.0.0-runtime.jar (:androidx.activity.activity-1.0.0:)
  Duplicate class androidx.activity.OnBackPressedDispatcherOwner found in modules jetified-activity-1.0.0-runtime.jar (androidx.activity:activity:1.0.0) and jetified-androidx.activity.activity-1.0.0-runtime.jar (:androidx.activity.activity-1.0.0:)
  Duplicate class androidx.annotation.OptIn found in modules jetified-androidx.annotation.annotation-experimental-1.1.0-runtime.jar (:androidx.annotation.annotation-experimental-1.1.0:) and jetified-annotation-experimental-1.1.0-runtime.jar (androidx.annotation:annotation-experimental:1.1.0)
  Duplicate class androidx.annotation.RequiresOptIn found in modules jetified-androidx.annotation.annotation-experimental-1.1.0-runtime.jar (:androidx.annotation.annotation-experimental-1.1.0:) and jetified-annotation-experimental-1.1.0-runtime.jar (androidx.annotation:annotation-experimental:1.1.0)
  Duplicate class androidx.annotation.RequiresOptIn$Level found in modules jetified-androidx.annotation.annotation-experimental-1.1.0-runtime.jar (:androidx.annotation.annotation-experimental-1.1.0:) and jetified-annotation-experimental-1.1.0-runtime.jar (androidx.annotation:annotation-experimental:1.1.0)
  Duplicate class androidx.annotation.experimental.Experimental found in modules jetified-androidx.annotation.annotation-experimental-1.1.0-runtime.jar (:androidx.annotation.annotation-experimental-1.1.0:) and jetified-annotation-experimental-1.1.0-runtime.jar (androidx.annotation:annotation-experimental:1.1.0)
  Duplicate class androidx.annotation.experimental.Experimental$Level found in modules jetified-androidx.annotation.annotation-experimental-1.1.0-runtime.jar (:androidx.annotation.annotation-experimental-1.1.0:) and jetified-annotation-experimental-1.1.0-runtime.jar (androidx.annotation:annotation-experimental:1.1.0)
  Duplicate class androidx.annotation.experimental.UseExperimental found in modules jetified-androidx.annotation.annotation-experimental-1.1.0-runtime.jar (:androidx.annotation.annotation-experimental-1.1.0:) and jetified-annotation-experimental-1.1.0-runtime.jar (androidx.annotation:annotation-experimental:1.1.0)
  Duplicate class androidx.appcompat.app.ActionBar found in modules appcompat-1.2.0-runtime.jar (androidx.appcompat:appcompat:1.2.0) and jetified-androidx.appcompat.appcompat-1.2.0-runtime.jar (:androidx.appcompat.appcompat-1.2.0:)
  Duplicate class androidx.appcompat.app.ActionBar$DisplayOptions found in modules appcompat-1.2.0-runtime.jar (androidx.appcompat:appcompat:1.2.0) and jetified-androidx.appcompat.appcompat-1.2.0-runtime.jar (:androidx.appcompat.appcompat-1.2.0:)
  Duplicate class androidx.appcompat.app.ActionBar$LayoutParams found in modules appcompat-1.2.0-runtime.jar (androidx.appcompat:appcompat:1.2.0) and jetified-androidx.appcompat.appcompat-1.2.0-runtime.jar (:androidx.appcompat.appcompat-1.2.0:)
  Duplicate class androidx.appcompat.app.ActionBar$NavigationMode found in modules appcompat-1.2.0-runtime.jar (androidx.appcompat:appcompat:1.2.0) and jetified-androidx.appcompat.appcompat-1.2.0-runtime.jar (:androidx.appcompat.appcompat-1.2.0:)
  Duplicate class androidx.appcompat.app.ActionBar$OnMenuVisibilityListener found in modules appcompat-1.2.0-runtime.jar (androidx.appcompat:appcompat:1.2.0) and jetified-androidx.appcompat.appcompat-1.2.0-runtime.jar (:androidx.appcompat.appcompat-1.2.0:)
  Duplicate class androidx.appcompat.app.ActionBar$OnNavigationListener found in modules appcompat-1.2.0-runtime.jar (androidx.appcompat:appcompat:1.2.0) and jetified-androidx.appcompat.appcompat-1.2.0-runtime.jar (:<message truncated>
看着很多,其实主要是多个jar包问题,问题出在导入admob的过程中把jar包依赖自动下载到了Plugins/Android 目录下了,正常情况下这个目录如果只有admob的话应该是这样

处理方法:把其他的jar包删除就可以了。

Execution failed for task ':launcher:processReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Android resource linking failed
     C:\Users\DELL\.gradle\caches\transforms-3\246f528239708f672a9905dd9b6fadde\transformed\jetified-googlemobileads-unity\res\layout\gnt_medium_template_view.xml:11: AAPT: error: attribute layout_constraintBottom_toBottomOf (aka com.*.*:layout_constraintBottom_toBottomOf) not found.
         
     C:\Users\DELL\.gradle\caches\transforms-3\246f528239708f672a9905dd9b6fadde\transformed\jetified-googlemobileads-unity\res\layout\gnt_medium_template_view.xml:11: AAPT: error: attribute layout_constraintEnd_toEndOf (aka com.*.*:layout_constraintEnd_toEndOf) not found.
         
     C:\Users\DELL\.gradle\caches\transforms-3\246f528239708f672a9905dd9b6fadde\transformed\jetified-googlemobileads-unity\res\layout\gnt_medium_template_view.xml:11: AAPT: error: attribute layout_constraintStart_toStartOf (aka com.*.*:layout_constraintStart_toStartOf) not found.
         
     C:\Users\DELL\.gradle\caches\transforms-3\246f528239708f672a9905dd9b6fadde\transformed\jetified-googlemobileads-unity\res\layout\gnt_medium_template_view.xml:11: AAPT: error: attribute layout_constraintTop_toTopOf (aka com.*.*:layout_constraintTop_toTopOf) not found.
         
     C:\Users\DELL\.gradle\caches\transforms-3\246f528239708f672a9905dd9b6fadde\transformed\jetified-googlemobileads-unity\res\layout\gnt_medium_template_view.xml:23: AAPT: error: attribute layout_constraintBottom_toTopOf (aka com.*.*:layout_constraintBottom_toTopOf) not found.
         
     C:\Users\DELL\.gradle\caches\transforms-3\246f528239708f672a9905dd9b6fadde\transformed\jetified-googlemobileads-unity\res\layout\gnt_medium_template_view.xml:23: AAPT: error: attribute layout_constraintEnd_toEndOf (aka com.*.*:layout_constraintEnd_toEndOf) not found.
         
     C:\Users\DELL\.gradle\caches\transforms-3\246f528239708f672a9905dd9b6fadde\transformed\jetified-googlemobileads-unity\res\layout\gnt_medium_template_view.xml:23: AAPT: error: attribute layout_constraintStart_toStartOf (aka com.*.*:layout_constraintStart_toStartOf) not found.
         
     C:\Users\DELL\.gradle\caches\transforms-3\246f528239708f672a9905dd9b6fadde\transformed\jetified-googlemobileads-unity\res\layout\gnt_medium_template_view.xml:23: AAPT: error: attribute layout_constraintTop_toTopOf (aka com.*.*:layout_constraintTop_toTopOf) not found.
         
     C:\Users\DELL\.gradle\caches\transforms-3\246f528239708f672a9905dd9b6fadde\transformed\jetified-googlemobileads-unity\res\layout\gnt_medium_template_view.xml:35: AAPT: error: attribute layout_constraintBottom_toTopOf (aka com.*.*:layout_constraintBottom_toTopOf) not found.
         
     C:\Users\DELL\.gradle\caches\transforms-3\246f528239708f672a9905dd9b6fadde\transformed\jetified-googlemobileads-unity\res\layout\gnt_medium_template_view.xml:35: AAPT: error: attribute layout_constraintEnd_toEndOf (aka com.*.*:layout_constraintEnd_toEndOf) not found.
         
     C:\Users\DELL\.gradle\caches\transforms-3\246f528239708f672a9905dd9b6fadde\transformed\jetified-googlemobileads-unity\res\layout\gnt_medium_template_view.xml:35: AAPT: error: attribute layout_constraintStart_toStartOf (aka com.*.*:layout_constraintStart_toStartOf) not found.
         
     C:\Users\DELL\.gradle\caches\transforms-3\246f528239708f672a9905dd9b6fadde\transformed\jetified-googlemobileads-unity\res\layout\gnt_medium_template_view.xml:35: AAPT: error: attribute layout_constraintTop_toBottomOf (aka com.*.*:layout_constraintTop_toBottomOf) not found.
         
     C:\Users\DELL\.gradle\caches\transforms-3\246f528239708f672a9905dd9b6fadde\transformed\jetified-googlemobileads-unity\res\layout\gnt_medium_template_view.xml:45: AAPT: error: attribute layout_constraintBottom_toBottomOf (aka com.*.*:layout_constraintBottom_toBottomOf) not found.
         
     C:\Users\DELL\.gradle\caches\transforms-3\246f528239708f672a9905dd9b6fadde\transformed\jetified-googlemobileads-unity\res\layout\gnt_medium_template_view.xml:45: AAPT: error: attribute layout_constraintEnd_toEndOf (aka com.*.*:layout_constraintEnd_toEndOf) not found.
         
     C:\Users\DELL\.gradle\caches\transforms-3\246f528239708f672a9905dd9b6fadde\transformed\jetified-googlemobileads-unity\res\layout\gnt_medium_template_view.xml:45: AAPT: error: attribute layout_constraintStart_toStartOf (aka com.*.*:layout_constraintStart_toStartOf) not found.
         
     C:\Users\DELL\.gradle\caches\transforms-3\246f528239708f672a9905dd9b6fadde\transformed\jetified-googlemobileads-unity\res\layout\gnt_medium_template_view.xml:45: AAPT: error: attribute layout_constraintTop_toTopOf (aka com.*.*:layout_constraintTop_toTopOf) not found.
         
     C:\Users\DELL\.gradle\caches\transforms-3\246f528239708f672a9905dd9b6fadde\transformed\jetified-googlemobileads-unity\res\layout\gnt_medium_template_view.xml:55: AAPT: error: attribute layout_constraintBottom_toBottomOf (aka com.*.*:layout_constraintBottom_toBottomOf) not found.
         
     C:\Users\DELL\.gradle\caches\transforms-3\246f528239708f672a9905dd9b6fadde\transformed\jetified-googlemobileads-unity\res\layout\gnt_medium_template_view.xml:55: AAPT: error: attribute layout_constraintDimensionRatio (aka com.*.*:layout_constraintDimensionRatio) not found.
         
     C:\Users\DELL\.gradle\caches\transforms-3\246f528239708f672a9905dd9b6fadde\transformed\jetified-googlemobileads-unity\res\layout\gnt_medium_template_view.xml:55: AAPT: error: attribute layout_constraintEnd_toStartOf (aka com.*.*:layout_constraintEnd_toStartOf) not found.
         这个问题的原因是gradleTemplate.properties 没有设置android.useAndroidX=true,正常情况下gradleTemplate.properties内容为

点击Assets > External Dependency Manager > Android Resolver > Resolve 应该就能解决自动生成,如果没有,点击Force Resolve

还有就是打Apk过程中长时间的等待Building Gradle project... 如果超过20分钟可能就build失败了,大概问题是gradle 版本不对,我之前用的版本是6.1.1,报错,改为gradle-6.8 之后正常

最好引入Admob 打包的过程中开vpn,因为有些依赖需要翻墙,或者挂其他代理也行,网上教程比较多,可以查询下

遇到问题国外网站会有更多的解决方法,我百度了很久很多都不对症

这篇关于Unity 接入Admob SDK 打Apk 过程中遇到的问题的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/936918

相关文章

浅析Spring Security认证过程

类图 为了方便理解Spring Security认证流程,特意画了如下的类图,包含相关的核心认证类 概述 核心验证器 AuthenticationManager 该对象提供了认证方法的入口,接收一个Authentiaton对象作为参数; public interface AuthenticationManager {Authentication authenticate(Authenti

作业提交过程之HDFSMapReduce

作业提交全过程详解 (1)作业提交 第1步:Client调用job.waitForCompletion方法,向整个集群提交MapReduce作业。 第2步:Client向RM申请一个作业id。 第3步:RM给Client返回该job资源的提交路径和作业id。 第4步:Client提交jar包、切片信息和配置文件到指定的资源提交路径。 第5步:Client提交完资源后,向RM申请运行MrAp

好题——hdu2522(小数问题:求1/n的第一个循环节)

好喜欢这题,第一次做小数问题,一开始真心没思路,然后参考了网上的一些资料。 知识点***********************************无限不循环小数即无理数,不能写作两整数之比*****************************(一开始没想到,小学没学好) 此题1/n肯定是一个有限循环小数,了解这些后就能做此题了。 按照除法的机制,用一个函数表示出来就可以了,代码如下

hdu1043(八数码问题,广搜 + hash(实现状态压缩) )

利用康拓展开将一个排列映射成一个自然数,然后就变成了普通的广搜题。 #include<iostream>#include<algorithm>#include<string>#include<stack>#include<queue>#include<map>#include<stdio.h>#include<stdlib.h>#include<ctype.h>#inclu

购买磨轮平衡机时应该注意什么问题和技巧

在购买磨轮平衡机时,您应该注意以下几个关键点: 平衡精度 平衡精度是衡量平衡机性能的核心指标,直接影响到不平衡量的检测与校准的准确性,从而决定磨轮的振动和噪声水平。高精度的平衡机能显著减少振动和噪声,提高磨削加工的精度。 转速范围 宽广的转速范围意味着平衡机能够处理更多种类的磨轮,适应不同的工作条件和规格要求。 振动监测能力 振动监测能力是评估平衡机性能的重要因素。通过传感器实时监

【机器学习】高斯过程的基本概念和应用领域以及在python中的实例

引言 高斯过程(Gaussian Process,简称GP)是一种概率模型,用于描述一组随机变量的联合概率分布,其中任何一个有限维度的子集都具有高斯分布 文章目录 引言一、高斯过程1.1 基本定义1.1.1 随机过程1.1.2 高斯分布 1.2 高斯过程的特性1.2.1 联合高斯性1.2.2 均值函数1.2.3 协方差函数(或核函数) 1.3 核函数1.4 高斯过程回归(Gauss

缓存雪崩问题

缓存雪崩是缓存中大量key失效后当高并发到来时导致大量请求到数据库,瞬间耗尽数据库资源,导致数据库无法使用。 解决方案: 1、使用锁进行控制 2、对同一类型信息的key设置不同的过期时间 3、缓存预热 1. 什么是缓存雪崩 缓存雪崩是指在短时间内,大量缓存数据同时失效,导致所有请求直接涌向数据库,瞬间增加数据库的负载压力,可能导致数据库性能下降甚至崩溃。这种情况往往发生在缓存中大量 k

6.1.数据结构-c/c++堆详解下篇(堆排序,TopK问题)

上篇:6.1.数据结构-c/c++模拟实现堆上篇(向下,上调整算法,建堆,增删数据)-CSDN博客 本章重点 1.使用堆来完成堆排序 2.使用堆解决TopK问题 目录 一.堆排序 1.1 思路 1.2 代码 1.3 简单测试 二.TopK问题 2.1 思路(求最小): 2.2 C语言代码(手写堆) 2.3 C++代码(使用优先级队列 priority_queue)

【VUE】跨域问题的概念,以及解决方法。

目录 1.跨域概念 2.解决方法 2.1 配置网络请求代理 2.2 使用@CrossOrigin 注解 2.3 通过配置文件实现跨域 2.4 添加 CorsWebFilter 来解决跨域问题 1.跨域概念 跨域问题是由于浏览器实施了同源策略,该策略要求请求的域名、协议和端口必须与提供资源的服务相同。如果不相同,则需要服务器显式地允许这种跨域请求。一般在springbo

题目1254:N皇后问题

题目1254:N皇后问题 时间限制:1 秒 内存限制:128 兆 特殊判题:否 题目描述: N皇后问题,即在N*N的方格棋盘内放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在同一斜线上。因为皇后可以直走,横走和斜走如下图)。 你的任务是,对于给定的N,求出有多少种合法的放置方法。输出N皇后问题所有不同的摆放情况个数。 输入