您好我正在尝试在 Unity 中实现 Vungle 广告。尽管我真的是无辜的,但我的 adsense 帐户因无效点击而被关闭。因此,即使是谷歌移动广告插件也在我的项目中
因此,在遵循本指南之后,我尝试整合 Vungle 广告,但出现了很多问题。这是相同的屏幕截图
所以第一个错误是这样的:
> Configure project :launcher
WARNING: The option setting 'android.enableR8=false' is deprecated.
It will be removed in version 5.0 of the Android Gradle plugin.
You will no longer be able to disable R8
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()
我试图通过这个答案在这里解决这个问题(我从 4.0.1' 变成了 3.4.0 ,但这仍然没有解决问题。事实上它说使用了贬低的 Gradle 功能。完整的错误如下和截图这里的错误:
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.1.1/userguide/command_line_interface.html#sec:command_line_warnings
对于此处提到的下一个错误, 我遵循了此答案并检查了这些是否已按此处
android.useAndroidX=true android.enableJetifier=true
我已经添加了此处指南中提到的依赖项。您可以在此处查看相同的屏幕截图。
以下是详细的错误
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':launcher:lintVitalRelease'.
> Could not resolve all artifacts for configuration ':launcher:debugRuntimeClasspath'.
> Could not find com.google.firebase:firebase-app-unity:8.7.0.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-app-unity/8.7.0/firebase-app-unity-8.7.0.pom
- https://jcenter.bintray.com/com/google/firebase/firebase-app-unity/8.7.0/firebase-app-unity-8.7.0.pom
- file:/C:/Users/cheth/FlappyBirdX/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/libs/firebase-app-unity-8.7.0.jar
- file:/C:/Users/cheth/FlappyBirdX/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/libs/firebase-app-unity.jar
- https://maven.google.com/com/google/firebase/firebase-app-unity/8.7.0/firebase-app-unity-8.7.0.pom
- file:////Assets/GeneratedLocalRepo/Firebase/m2repository/com/google/firebase/firebase-app-unity/8.7.0/firebase-app-unity-8.7.0.pom
- file:/C:/Users/cheth/.m2/repository/com/google/firebase/firebase-app-unity/8.7.0/firebase-app-unity-8.7.0.pom
- https://repo.maven.apache.org/maven2/com/google/firebase/firebase-app-unity/8.7.0/firebase-app-unity-8.7.0.pom
Required by:
project :launcher > project :unityLibrary
> Could not find com.google.firebase:firebase-messaging-unity:8.7.0.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-messaging-unity/8.7.0/firebase-messaging-unity-8.7.0.pom
- https://jcenter.bintray.com/com/google/firebase/firebase-messaging-unity/8.7.0/firebase-messaging-unity-8.7.0.pom
- file:/C:/Users/cheth/FlappyBirdX/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/libs/firebase-messaging-unity-8.7.0.jar
- file:/C:/Users/cheth/FlappyBirdX/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/libs/firebase-messaging-unity.jar
- https://maven.google.com/com/google/firebase/firebase-messaging-unity/8.7.0/firebase-messaging-unity-8.7.0.pom
- file:////Assets/GeneratedLocalRepo/Firebase/m2repository/com/google/firebase/firebase-messaging-unity/8.7.0/firebase-messaging-unity-8.7.0.pom
- file:/C:/Users/cheth/.m2/repository/com/google/firebase/firebase-messaging-unity/8.7.0/firebase-messaging-unity-8.7.0.pom
- https://repo.maven.apache.org/maven2/com/google/firebase/firebase-messaging-unity/8.7.0/firebase-messaging-unity-8.7.0.pom
Required by:
project :launcher > project :unityLibrary
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 11s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()
和
CommandInvokationFailure: Gradle build failed.
C:\Program Files\Unity\Hub\Editor\2021.2.5f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2021.2.5f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-6.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"
stderr[
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':launcher:lintVitalRelease'.
> Could not resolve all artifacts for configuration ':launcher:debugRuntimeClasspath'.
> Could not find com.google.firebase:firebase-app-unity:8.7.0.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-app-unity/8.7.0/firebase-app-unity-8.7.0.pom
- https://jcenter.bintray.com/com/google/firebase/firebase-app-unity/8.7.0/firebase-app-unity-8.7.0.pom
- file:/C:/Users/cheth/FlappyBirdX/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/libs/firebase-app-unity-8.7.0.jar
- file:/C:/Users/cheth/FlappyBirdX/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/libs/firebase-app-unity.jar
- https://maven.google.com/com/google/firebase/firebase-app-unity/8.7.0/firebase-app-unity-8.7.0.pom
- file:////Assets/GeneratedLocalRepo/Firebase/m2repository/com/google/firebase/firebase-app-unity/8.7.0/firebase-app-unity-8.7.0.pom
- file:/C:/Users/cheth/.m2/repository/com/google/firebase/firebase-app-unity/8.7.0/firebase-app-unity-8.7.0.pom
- https://repo.maven.apache.org/maven2/com/google/firebase/firebase-app-unity/8.7.0/firebase-app-unity-8.7.0.pom
Required by:
project :launcher > project :unityLibrary
> Could not find com.google.firebase:firebase-messaging-unity:8.7.0.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-messaging-unity/8.7.0/firebase-messaging-unity-8.7.0.pom
- https://jcenter.bintray.com/com/google/firebase/firebase-messaging-unity/8.7.0/firebase-messaging-unity-8.7.0.pom
- file:/C:/Users/cheth/FlappyBirdX/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/libs/firebase-messaging-unity-8.7.0.jar
- file:/C:/Users/cheth/FlappyBirdX/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/libs/firebase-messaging-unity.jar
- https://maven.google.com/com/google/firebase/firebase-messaging-unity/8.7.0/firebase-messaging-unity-8.7.0.pom
- file:////Assets/GeneratedLocalRepo/Firebase/m2repository/com/google/firebase/firebase-messaging-unity/8.7.0/firebase-messaging-unity-8.7.0.pom
- file:/C:/Users/cheth/.m2/repository/com/google/firebase/firebase-messaging-unity/8.7.0/firebase-messaging-unity-8.7.0.pom
- https://repo.maven.apache.org/maven2/com/google/firebase/firebase-messaging-unity/8.7.0/firebase-messaging-unity-8.7.0.pom
Required by:
project :launcher > project :unityLibrary
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 11s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
]
stdout[
> Configure project :launcher
WARNING: The option setting 'android.enableR8=false' is deprecated.
It will be removed in version 5.0 of the Android Gradle plugin.
You will no longer be able to disable R8
]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <674ff79a87ce43deb10cddc279e66761>:0)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <674ff79a87ce43deb10cddc279e66761>:0)
UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <674ff79a87ce43deb10cddc279e66761>:0)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <674ff79a87ce43deb10cddc279e66761>:0)
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, Unity.Android.Gradle.AndroidGradle androidGradle, System.String workingdir, System.String task, System.Action`1[T] progress) (at <674ff79a87ce43deb10cddc279e66761>:0)
Rethrow as GradleInvokationException: Gradle build failed
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, Unity.Android.Gradle.AndroidGradle androidGradle, System.String workingdir, System.String task, System.Action`1[T] progress) (at <674ff79a87ce43deb10cddc279e66761>:0)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <674ff79a87ce43deb10cddc279e66761>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <674ff79a87ce43deb10cddc279e66761>:0)
Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown.
UnityEditor.Android.PostProcessor.CancelPostProcess.AbortBuild (System.String title, System.String message, System.Exception ex) (at <674ff79a87ce43deb10cddc279e66761>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <674ff79a87ce43deb10cddc279e66761>:0)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, AndroidPlayerBuildProgram.Data.AndroidPlayerBuildProgramOutput buildProgramOutput) (at <674ff79a87ce43deb10cddc279e66761>:0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <674ff79a87ce43deb10cddc279e66761>:0)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.Int32 subtarget, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <3cbc70f1ae9747e88614d75932150c59>:0)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()