AppLovin / AppLovin-MAX-Unity-Plugin

130 stars 35 forks source link

admob, yandex and possibly IronSource adapters cannot be built on Android in Unity 2021.3.30 #286

Open mel-geo opened 1 year ago

mel-geo commented 1 year ago

MAX Plugin Version

5.11.3

Unity Version

2021.3.30

Device/Platform Info

Android

Current Behavior

I have the following adapters:

Google admob IronSource Unity Ads Liftoff Monetize Yandex

Trying to build with those adapters together causes the google play .aab build to fail and I get errors (see below).

The Android Resolver completes successfully in the Editor, even with all the adapters added.

If I remove admob, yandex and IronSource I am able to build the game. Obviously, I'd rather keep all of my integrations. I should also mention that it works on iOS, but the Android version is failing. It is also worth mentioning that I also have the official Google Play Services plugin as well ( something that we absolutely need on Android for achievements and so on).

Any help is appreciated!

ERROR LOG:

`Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. java.util.NoSuchElementException: Key /Users/melgeo/.gradle/caches/transforms-2/files-2.1/da961c69edf37cde97f57fd5231ef0c1/jetified-androidx.core.core-1.9.0-runtime.jar is missing in the map. at kotlin.collections.MapsKtMapWithDefaultKt.getOrImplicitDefaultNullable(MapWithDefault.kt:24) at kotlin.collections.MapsKtMapsKt.getValue(Maps.kt:296) at com.android.build.gradle.internal.tasks.DexArchiveBuilderTaskDelegate.getDexOutputForJar(DexArchiveBuilderTaskDelegate.kt:831) at com.android.build.gradle.internal.tasks.DexArchiveBuilderTaskDelegate.removeChangedJarOutputs(DexArchiveBuilderTaskDelegate.kt:577) at com.android.build.gradle.internal.tasks.DexArchiveBuilderTaskDelegate.processClassFromInput(DexArchiveBuilderTaskDelegate.kt:428) at com.android.build.gradle.internal.tasks.DexArchiveBuilderTaskDelegate.access$processClassFromInput(DexArchiveBuilderTaskDelegate.kt:69) at com.android.build.gradle.internal.tasks.DexArchiveBuilderTaskDelegate$doProcess$$inlined$use$lambda$1.invoke(DexArchiveBuilderTaskDelegate.kt:251) at com.android.build.gradle.internal.tasks.DexArchiveBuilderTaskDelegate$doProcess$$inlined$use$lambda$1.invoke(DexArchiveBuilderTaskDelegate.kt:69) at com.android.build.gradle.internal.tasks.DexArchiveBuilderTaskDelegate.doProcess(DexArchiveBuilderTaskDelegate.kt:314) at com.android.build.gradle.internal.tasks.DexArchiveBuilderTask.doTaskAction(DexArchiveBuilderTask.kt:192) at com.android.build.gradle.internal.tasks.NewIncrementalTask$taskAction$$inlined$recordTaskAction$1.invoke(AndroidVariantTask.kt:73) at com.android.build.gradle.internal.tasks.NewIncrementalTask$taskAction$$inlined$recordTaskAction$1.invoke(AndroidVariantTask.kt:34) at com.android.build.gradle.internal.tasks.Blocks.recordSpan(Blocks.java:91) at com.android.build.gradle.internal.tasks.NewIncrementalTask.taskAction(NewIncrementalTask.kt:34) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104) at org.gradle.api.internal.project.taskfactory.IncrementalInputsTaskAction.doExecute(IncrementalInputsTaskAction.java:32) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:42) at org.gradle.api.internal.project.taskfactory.AbstractIncrementalTaskAction.execute(AbstractIncrementalTaskAction.java:25) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.run(ExecuteActionsTaskExecuter.java:568) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394) at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158) at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92) at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:553) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:536) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$300(ExecuteActionsTaskExecuter.java:109) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.executeWithPreviousOutputFiles(ExecuteActionsTaskExecuter.java:276) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:265) at org.gradle.internal.execution.steps.ExecuteStep.lambda$execute$0(ExecuteStep.java:32) at java.util.Optional.map(Optional.java:215) at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:32) at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:26) at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:63) at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:35) at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:49) at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:34) at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:43) at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:73) at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:54) at org.gradle.internal.execution.steps.CatchExceptionStep.execute(CatchExceptionStep.java:34) at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:44) at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:54) at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:38) at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:49) at org.gradle.internal.execution.steps.CacheStep.executeWithoutCache(CacheStep.java:153) at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:67) at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:41) at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:44) at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:33) at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:38) at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:24) at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:92) at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:85) at java.util.Optional.map(Optional.java:215) at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:55) at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:39) at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:76) at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:37) at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:36) at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:26) at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:94) at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:49) at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:79) at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:53) at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:74) at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:78) at java.util.Optional.orElseGet(Optional.java:267) at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:78) at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:34) at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:39) at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:40) at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:28) at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:33) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:192) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:184) at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:109) at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46) at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:62) at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57) at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56) at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52) at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416) at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406) at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158) at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102) at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52) at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:41) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:372) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:359) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:352) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:338) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64) at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56) at java.lang.Thread.run(Thread.java:748)

FAILURE: Build failed with an exception.

BUILD FAILED in 17s

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUIUtility.cs:189) `

Expected Behavior

The build should work when building the following adapters together:

Google admob IronSource Unity Ads Liftoff Monetize Yandex

How to Reproduce

Building with those adapters will cause errors on Android using Unity 2021.3.30.

Additional Info

No response

mel-geo commented 1 year ago

Quick update:

I was able to get Yandex and IronSource working by using the Android Resolver from the Google Play package (it won't work with the newer resolver supplied in the Max package). I also enabled the custom Gradle properties template (as described in the Resolver settings section under Jetifier).

However, I still can't get admob working due to this error ( see below ).

Any help would be appreciated!


`CommandInvokationFailure: Gradle build failed. /Applications/Unity/Hub/Editor/2021.3.30f1/PlaybackEngines/AndroidPlayer/OpenJDK/bin/java -classpath "/Applications/Unity/Hub/Editor/2021.3.30f1/PlaybackEngines/AndroidPlayer/Tools/gradle/lib/gradle-launcher-6.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "bundleRelease"

Environment Variables: LAUNCH_DARKLY_CLIENT_TOKEN_STAGING = 60a7e30fafc7e60e33446282 SSH_AUTH_SOCK = /private/tmp/com.apple.launchd.sO6usjkCa7/Listeners WOOTRIC_CLIENT_TOKEN = NPS-aa8be4c3 XPC_FLAGS = 0x0 DEBUG_ENV_VAR = UnityHub HEAP_CLIENT_TOKEN_STAGING = 3786794399 MallocNanoZone = 0 DISPLAY = /private/tmp/com.apple.launchd.zcwDCTs2mW/org.macosforge.xquartz:0 ORIGINAL_XDG_CURRENT_DESKTOP = undefined SHELL = /bin/zsh PATH = /usr/bin:/bin:/usr/sbin:/sbin CFBundleIdentifier = com.unity3d.unityhub AMPLITUDE_API_KEY_STAGING = 83ee04fccc67e4fcc7dd527c4c6f1e21 AMPLITUDE_API_KEY = 28f3cae0b33b8b3702120c9ed1a935aa HOME = /Users/melgeo USER = melgeo LAUNCH_DARKLY_CLIENT_TOKEN = 60a7e30fafc7e60e33446283 CF_USER_TEXT_ENCODING = 0x1F5:0:2 HEAP_CLIENT_TOKEN = 1717415662 TMPDIR = /var/folders/bk/jmlhvpps7fs1t3fw16bh37nm0000gn/T/ LOGNAME = melgeo JAVA_HOME = /Applications/Unity/Hub/Editor/2021.3.30f1/PlaybackEngines/AndroidPlayer/OpenJDK SENTRY_ACCESS_TOKEN = 3df78d9e53f8456aa90fbae044ce1a6261421ab1d0014674bc2e933477289017 JAVA_TOOL_OPTIONS = -Dfile.encoding=UTF-8 XPC_SERVICE_NAME = application.com.unity3d.unityhub.1128188232.1128188238 COMMAND_MODE = unix2003

stderr[ Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.

FAILURE: Build completed with 3 failures.

1: Task failed with an exception.

2: Task failed with an exception.

3: Task failed with an exception.

BUILD FAILED in 18s ] 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

AppLovin Quality Service Plug-in for Gradle and Android Studio Version 4.13.5 Copyright (c) 2023 AppLovin Ltd. All rights reserved.

Task :launcher:preBuild UP-TO-DATE Task :launcher:preReleaseBuild UP-TO-DATE Task :UnityDataAssetPack:generateAssetPackManifest Task :UnityStreamingAssetsPack:generateAssetPackManifest Task :launcher:processReleaseAssetPackManifests Task :unityLibrary:preBuild UP-TO-DATE Task :unityLibrary:preReleaseBuild UP-TO-DATE Task :unityLibrary:packageReleaseRenderscript NO-SOURCE Task :launcher:generateReleaseResValues Task :launcher:compileReleaseRenderscript NO-SOURCE Task :launcher:generateReleaseResources Task :unityLibrary:GooglePlayGamesManifest.androidlib:preBuild UP-TO-DATE Task :unityLibrary:GooglePlayGamesManifest.androidlib:preReleaseBuild UP-TO-DATE Task :unityLibrary:GooglePlayGamesManifest.androidlib:packageReleaseRenderscript NO-SOURCE Task :unityLibrary:generateReleaseResValues aapt2 W 09-26 23:17:18 5298 1758370 LoadedArsc.cpp:657] Unknown chunk type '200'.

Task :unityLibrary:GooglePlayGamesManifest.androidlib:compileReleaseRenderscript NO-SOURCE Task :unityLibrary:GooglePlayGamesManifest.androidlib:generateReleaseResValues Task :unityLibrary:GooglePlayGamesManifest.androidlib:generateReleaseResources Task :unityLibrary:GooglePlayGamesManifest.androidlib:packageReleaseResources Task :unityLibrary:extractDeepLinksRelease Task :unityLibrary:GooglePlayGamesManifest.androidlib:extractDeepLinksRelease Task :launcher:createReleaseCompatibleScreenManifests aapt2 W 09-26 23:17:18 5299 1758376 LoadedArsc.cpp:657] Unknown chunk type '200'.

Task :launcher:extractDeepLinksRelease Task :launcher:linkReleaseManifestForAssetPacks

Transform artifact androidx.core.core-1.9.0-.aar (:androidx.core.core-1.9.0:) with JetifyTransform WARNING: [Processor] Library '/Users/melgeo/Desktop/UNITY - Post Brutal 2021/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/libs/androidx.core.core-1.9.0.aar' contains references to both AndroidX and old support library. This seems like the library is partially migrated. Jetifier will try to rewrite the library anyway. Example of androidX reference: 'androidx/versionedparcelable/VersionedParcel' Example of support library reference: 'android/support/v4/app/RemoteActionCompatParcelizer'

Task :unityLibrary:GooglePlayGamesManifest.androidlib:compileReleaseLibraryResources Task :unityLibrary:GooglePlayGamesManifest.androidlib:processReleaseManifest Task :unityLibrary:processReleaseManifest Task :unityLibrary:GooglePlayGamesManifest.androidlib:compileReleaseAidl NO-SOURCE Task :unityLibrary:GooglePlayGamesManifest.androidlib:parseReleaseLocalResources Task :unityLibrary:GooglePlayGamesManifest.androidlib:generateReleaseRFile Task :unityLibrary:generateReleaseBuildConfig Task :unityLibrary:javaPreCompileRelease Task :unityLibrary:GooglePlayGamesManifest.androidlib:generateReleaseBuildConfig Task :unityLibrary:GooglePlayGamesManifest.androidlib:javaPreCompileRelease Task :unityLibrary:mergeReleaseShaders Task :unityLibrary:compileReleaseShaders NO-SOURCE Task :unityLibrary:generateReleaseAssets UP-TO-DATE Task :unityLibrary:packageReleaseAssets Task :unityLibrary:processReleaseJavaRes Task :unityLibrary:GooglePlayGamesManifest.androidlib:compileReleaseJavaWithJavac Task :unityLibrary:GooglePlayGamesManifest.androidlib:mergeReleaseShaders Task :unityLibrary:GooglePlayGamesManifest.androidlib:compileReleaseShaders NO-SOURCE Task :unityLibrary:GooglePlayGamesManifest.androidlib:generateReleaseAssets UP-TO-DATE Task :unityLibrary:GooglePlayGamesManifest.androidlib:packageReleaseAssets Task :unityLibrary:GooglePlayGamesManifest.androidlib:processReleaseJavaRes NO-SOURCE Task :unityLibrary:GooglePlayGamesManifest.androidlib:bundleLibResRelease NO-SOURCE Task :unityLibrary:GooglePlayGamesManifest.androidlib:mergeReleaseJniLibFolders Task :unityLibrary:GooglePlayGamesManifest.androidlib:bundleLibRuntimeToJarRelease Task :unityLibrary:GooglePlayGamesManifest.androidlib:bundleLibCompileToJarRelease Task :unityLibrary:GooglePlayGamesManifest.androidlib:mergeReleaseNativeLibs Task :unityLibrary:GooglePlayGamesManifest.androidlib:stripReleaseDebugSymbols NO-SOURCE Task :unityLibrary:GooglePlayGamesManifest.androidlib:copyReleaseJniLibsProjectOnly Task :unityLibrary:mergeReleaseJniLibFolders Task :unityLibrary:compileReleaseRenderscript NO-SOURCE Task :unityLibrary:generateReleaseResources Task :unityLibrary:packageReleaseResources Task :unityLibrary:compileReleaseAidl NO-SOURCE Task :unityLibrary:compileReleaseLibraryResources Task :unityLibrary:parseReleaseLocalResources Task :unityLibrary:bundleLibResRelease Task :unityLibrary:generateReleaseRFile

Task :unityLibrary:compileReleaseJavaWithJavac

Task :unityLibrary:mergeReleaseNativeLibs Task :unityLibrary:stripReleaseDebugSymbols Task :unityLibrary:copyReleaseJniLibsProjectOnly Task :unityLibrary:bundleLibRuntimeToJarRelease Task :unityLibrary:bundleLibCompileToJarRelease

Task :launcher:processReleaseManifest /Users/melgeo/Desktop/UNITY - Post Brutal 2021/Library/Bee/Android/Prj/IL2CPP/Gradle/launcher/src/main/AndroidManifest.xml:15:7-145 Warning: meta-data#com.unity3d.services.core.network.core.CronetInitializer was tagged at AndroidManifest.xml:15 to remove other declarations but no other declaration present

Task :launcher:checkReleaseDuplicateClasses Task :launcher:compileReleaseAidl NO-SOURCE Task :launcher:generateReleaseBuildConfig Task :launcher:mergeReleaseShaders Task :launcher:compileReleaseShaders NO-SOURCE Task :launcher:generateReleaseAssets UP-TO-DATE Task :launcher:mergeReleaseAssets Task :launcher:processReleaseJavaRes NO-SOURCE Task :launcher:mergeReleaseJniLibFolders Task :launcher:collectReleaseDependencies Task :launcher:configureReleaseDependencies Task :launcher:javaPreCompileRelease Task :launcher:validateSigningRelease Task :launcher:mergeReleaseResources Task :launcher:processReleaseResources FAILED Task :launcher:bundleReleaseResources FAILED Task :launcher:parseReleaseIntegrityConfig Task :launcher:assetPackReleasePreBundleTask Task :launcher:mergeReleaseJavaResource FAILED Task :launcher:mergeReleaseNativeLibs

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 61 actionable tasks: 61 executed ] exit code: 1 UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0) UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0) UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0) UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action1[T] progress, System.String error) (at <fdb0d6ed6122429cb6b5410fa8712f3f>:0) UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, Unity.Android.Gradle.AndroidGradle androidGradle, System.String workingdir, System.String task, System.Action1[T] progress) (at :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.Action1[T] progress) (at <fdb0d6ed6122429cb6b5410fa8712f3f>:0) UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <fdb0d6ed6122429cb6b5410fa8712f3f>:0) UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <fdb0d6ed6122429cb6b5410fa8712f3f>: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 <fdb0d6ed6122429cb6b5410fa8712f3f>:0) UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <fdb0d6ed6122429cb6b5410fa8712f3f>:0) UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, AndroidPlayerBuildProgram.Data.AndroidPlayerBuildProgramOutput buildProgramOutput) (at <fdb0d6ed6122429cb6b5410fa8712f3f>:0) UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <fdb0d6ed6122429cb6b5410fa8712f3f>: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 /Users/bokken/build/output/unity/unity/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:370) UnityEditor.GenericMenu:CatchMenu(Object, String[], Int32) (at /Users/bokken/build/output/unity/unity/Editor/Mono/GUI/GenericMenu.cs:127)

JonathanLiuApp commented 1 year ago

It looks like the first two errors could be caused by the Admob adapter which now requires Android Gradle Plugin 4.2.1 (or newer). Could you try updating and see if that helps?

mel-geo commented 1 year ago

Hi @JonathanLiuApp

Thanks for the reply. Admittedly, I'm still a novice when it comes to all of this Android dependency stuff. This is what I did:

1) Setup a custom baseProjectTemplate.gradle by using the checkbox in the publishing settings. 2) I changed classpath 'com.android.tools.build:gradle:4.0.1' to classpath 'com.android.tools.build:gradle:4.2.1'

On the next build, I tried to build it with what I know works ( without the admob adapters ) and it fails even without them. I got this error log below.

It may be that I didn't setup gradle properly. In that case, if you could point me towards how I could do that, that would be great!

Thanks

ERROR LOG:

`CommandInvokationFailure: Gradle build failed. /Applications/Unity/Hub/Editor/2021.3.30f1/PlaybackEngines/AndroidPlayer/OpenJDK/bin/java -classpath "/Applications/Unity/Hub/Editor/2021.3.30f1/PlaybackEngines/AndroidPlayer/Tools/gradle/lib/gradle-launcher-6.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "bundleRelease"

Environment Variables: LAUNCH_DARKLY_CLIENT_TOKEN_STAGING = 60a7e30fafc7e60e33446282 SSH_AUTH_SOCK = /private/tmp/com.apple.launchd.sO6usjkCa7/Listeners WOOTRIC_CLIENT_TOKEN = NPS-aa8be4c3 XPC_FLAGS = 0x0 DEBUG_ENV_VAR = UnityHub HEAP_CLIENT_TOKEN_STAGING = 3786794399 MallocNanoZone = 0 DISPLAY = /private/tmp/com.apple.launchd.zcwDCTs2mW/org.macosforge.xquartz:0 ORIGINAL_XDG_CURRENT_DESKTOP = undefined SHELL = /bin/zsh PATH = /usr/bin:/bin:/usr/sbin:/sbin CFBundleIdentifier = com.unity3d.unityhub AMPLITUDE_API_KEY_STAGING = 83ee04fccc67e4fcc7dd527c4c6f1e21 AMPLITUDE_API_KEY = 28f3cae0b33b8b3702120c9ed1a935aa HOME = /Users/melgeo USER = melgeo LAUNCH_DARKLY_CLIENT_TOKEN = 60a7e30fafc7e60e33446283 CF_USER_TEXT_ENCODING = 0x1F5:0:2 HEAP_CLIENT_TOKEN = 1717415662 TMPDIR = /var/folders/bk/jmlhvpps7fs1t3fw16bh37nm0000gn/T/ LOGNAME = melgeo JAVA_HOME = /Applications/Unity/Hub/Editor/2021.3.30f1/PlaybackEngines/AndroidPlayer/OpenJDK SENTRY_ACCESS_TOKEN = 3df78d9e53f8456aa90fbae044ce1a6261421ab1d0014674bc2e933477289017 JAVA_TOOL_OPTIONS = -Dfile.encoding=UTF-8 XPC_SERVICE_NAME = application.com.unity3d.unityhub.1128188232.1128188238 COMMAND_MODE = unix2003

stderr[ Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

FAILURE: Build failed with an exception.

BUILD FAILED in 19s ] stdout[ Starting a Gradle Daemon (subsequent builds will be faster) ] exit code: 1 UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0) UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0) UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0) UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action1[T] progress, System.String error) (at <fdb0d6ed6122429cb6b5410fa8712f3f>:0) UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, Unity.Android.Gradle.AndroidGradle androidGradle, System.String workingdir, System.String task, System.Action1[T] progress) (at :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.Action1[T] progress) (at <fdb0d6ed6122429cb6b5410fa8712f3f>:0) UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <fdb0d6ed6122429cb6b5410fa8712f3f>:0) UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <fdb0d6ed6122429cb6b5410fa8712f3f>: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 <fdb0d6ed6122429cb6b5410fa8712f3f>:0) UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <fdb0d6ed6122429cb6b5410fa8712f3f>:0) UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, AndroidPlayerBuildProgram.Data.AndroidPlayerBuildProgramOutput buildProgramOutput) (at <fdb0d6ed6122429cb6b5410fa8712f3f>:0) UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <fdb0d6ed6122429cb6b5410fa8712f3f>: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 /Users/bokken/build/output/unity/unity/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:370) UnityEditor.GenericMenu:CatchMenu(Object, String[], Int32) (at /Users/bokken/build/output/unity/unity/Editor/Mono/GUI/GenericMenu.cs:127)

Shady9595 commented 1 year ago

I am also getting a very similar problem to this my Unity version is 2022.3.10f1 LTS and it has an updated gradle version. Even upon removing all adapters I still cant make my build Max v5.11.3

JonathanLiuApp commented 1 year ago

@mel-geo It looks like you would need to update your Gradle version to at least 6.7.1. Try replacing the distributionUrl in your gradle/wrapper/gradle-wrapper.properties file with https\://services.gradle.org/distributions/gradle-6.9.3-bin.zip.

usmanGD commented 1 year ago

i am also getting the same error my conflicts are in "org.jetbrains.kotlinx.kotlinx-coroutines-core-1.7.1" and "org.jetbrains.kotlinx.kotlinx-coroutines-core-jvm-1.7.1" dependencies. i tried to build with custom main gradle and custom gradle properties build succeed but create ANR and crashes on play console.

TrongHieu90 commented 1 year ago

@mel-geo @JonathanLiuApp I am also stuck on this. I am able to get Unity Ads working but not Admob per article here: https://docs.unity3d.com/Manual/android-gradle-overview.html

Unity 2021 LTS doesn't support Android Gradle Plug-in version 4.2.1 with the built-in Gradle version 6.1.1

per android document: https://developer.android.com/build/releases/gradle-plugin?buildsystem=ndk-build

Gradle needs to be update to 6.7 at least. This is such an insane breaking issue.

TrongHieu90 commented 1 year ago

Able to build admob finally. Upgrade gradle t0 6.9.3 and custom gradle plugin to 4.2.1

usmanGD commented 1 year ago

@TrongHieu90 can you tell which plugins you are using in your project ?

TrongHieu90 commented 1 year ago

@usmanGD firebase, max, gameanalytics. That is all. Try to solve your issue with Force Resolve option (From External Dependency Manager)

tungvl99ql commented 1 year ago

@usmanGD firebase, max, gameanalytics. That is all. Try to solve your issue with Force Resolve option (From External Dependency Manager)

Able to build admob finally. Upgrade gradle t0 6.9.3 and custom gradle plugin to 4.2.1

mình cũng gặp trường hợp tương tự ở unity 2022 ,max v5.11.5 khi add admob,ironsource, inmobi và yandex, mặc dù đã thay đổi đường dẫn đến folder gradle 6.9 ở preferences

JonathanLiuApp commented 1 year ago

Google published how to get admob adapter 22.4.0 and later working in Unity. https://developers.google.com/admob/unity/gradle

github-actions[bot] commented 2 weeks ago

This issue is stale because it has been open for 30 days with no activity.