Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug No Android build possible after importing "Advertisement with Mediation".

Discussion in 'Unity Mediation' started by IT-Loesungen-Huntemann, Nov 13, 2022.

  1. IT-Loesungen-Huntemann

    IT-Loesungen-Huntemann

    Joined:
    Sep 30, 2022
    Posts:
    3
    Whenever I install "Advertisement with Mediation (ver. 1.5.0)" in a project, I can no longer create Android builds afterwards.

    This even applies to new, empty projects.

    The following error message appears:
    upload_2022-11-13_19-52-12.png

    When I click Resolve, the build process starts right away and hangs. I end up having to kill Unity via Task Manager.

    Nothing happens via Assetts -> Mobile Dependeny Resolver -> Android Resolver -> Force Resolver.

    I'm using Unity 2021.3.11f1.

    Does anyone have an idea how I can get this fixed?
     

    Attached Files:

    ooxcit and pandolfini like this.
  2. pandolfini

    pandolfini

    Joined:
    Feb 5, 2020
    Posts:
    16
    We are seeing the same issue. Android will not build and the resolver locks up when trying to resolve whatever conflict it is finding. iOS Cocoapods was also a mess when trying to build from an M1 Mac, but we resolved this by installing silicon pods manually (it improperly had Intel pods installed).

    Unity, did you test this?
     
    ParkerNeptune likes this.
  3. DeclanMcPartlin

    DeclanMcPartlin

    Unity Technologies

    Joined:
    Nov 19, 2020
    Posts:
    146
    @IT-Loesungen-Huntemann, @pandolfini, @ParkerNeptune could you all confirm if you're facing these issues on Windows?

    Also, are any of you using the mainTemplate.gradle file? We highly recommend using the mainTemplate.gradle file instead of directly including the dependencies (Edit > Project Settings > Player > Android > Publishing Settings > Custom Main Gradle Template), make sure to clear out the binaries from the Plugins/Android folder before building to avoid duplicate binaries.

    Let us know if that fixes your issue while we look into this freezing issue, thanks!
     
    jerryjekums92 likes this.
  4. IT-Loesungen-Huntemann

    IT-Loesungen-Huntemann

    Joined:
    Sep 30, 2022
    Posts:
    3
    hey,
    I tried it with a fresh project, unfortunately still without success. The build starts, but at some point a "Build failed" error message appears.
    The console shows the following messages:


    Starting a Gradle Daemon, 2 incompatible Daemons could not be reused, use --status for details

    > 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
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.3.13f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\30.0.2\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.3.13f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.3.13f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-29\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.3.13f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-30\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.3.13f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.3.13f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\30.0.2\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.3.13f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.3.13f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-29\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.3.13f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-30\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.3.13f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only

    UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)




    FAILURE: Build failed with an exception.

    * What went wrong:
    Could not determine the dependencies of task ':launcher:lintVitalRelease'.
    > This project uses AndroidX dependencies, but the 'android.useAndroidX' property is not enabled. Set this property to true in the gradle.properties file and retry.
    The following AndroidX dependencies are detected: androidx.fragment:fragment:1.0.0, androidx.slidingpanelayout:slidingpanelayout:1.0.0, androidx.versionedparcelable:versionedparcelable:1.1.0, androidx.core:core:1.2.0, androidx.customview:customview:1.0.0, androidx.swiperefreshlayout:swiperefreshlayout:1.0.0, androidx.interpolator:interpolator:1.0.0, androidx.loader:loader:1.0.0, androidx.drawerlayout:drawerlayout:1.0.0, androidx.viewpager:viewpager:1.0.0, androidx.collection:collection:1.0.0, androidx.localbroadcastmanager:localbroadcastmanager:1.0.0, androidx.lifecycle:lifecycle-common:2.0.0, androidx.arch.core:core-common:2.0.0, androidx.annotation:annotation:1.2.0, androidx.startup:startup-runtime:1.0.0, androidx.tracing:tracing:1.0.0, androidx.legacy:legacy-support-core-ui:1.0.0, androidx.lifecycle:lifecycle-livedata:2.0.0, androidx.lifecycle:lifecycle-viewmodel:2.0.0, androidx.lifecycle:lifecycle-livedata-core:2.0.0, androidx.arch.core:core-runtime:2.0.0, androidx.legacy:legacy-support-core-utils:1.0.0, androidx.documentfile:documentfile:1.0.0, androidx.cursoradapter:cursoradapter:1.0.0, androidx.lifecycle:lifecycle-runtime:2.0.0, androidx.coordinatorlayout:coordinatorlayout:1.0.0, androidx.asynclayoutinflater:asynclayoutinflater:1.0.0, androidx.print:print:1.0.0

    * 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 5s
    Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

    UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)



    CommandInvokationFailure: Gradle build failed.
    C:\Program Files\Unity\Hub\Editor\2021.3.13f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2021.3.13f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-6.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"

    Environment Variables:
    USERDOMAIN = Peters-PC
    ProgramFiles = C:\Program Files
    TMP = C:\Users\ALEXAN~1\AppData\Local\Temp
    PROCESSOR_ARCHITECTURE = AMD64
    PROCESSOR_REVISION = a503
    OneDriveConsumer = C:\Users\Peter\OneDrive
    OS = Windows_NT
    CHROME_CRASHPAD_PIPE_NAME = \\.\pipe\crashpad_89164_LYCRZTDWEFCQDHFL
    PROCESSOR_IDENTIFIER = Intel64 Family 6 Model 165 Stepping 3, GenuineIntel
    ProgramW6432 = C:\Program Files
    USERPROFILE = C:\Users\Peter
    JAVA_HOME = C:\Program Files\Unity\Hub\Editor\2021.3.13f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK
    CommonProgramFiles = C:\Program Files\Common Files
    DriverData = C:\Windows\System32\Drivers\DriverData
    ComSpec = C:\WINDOWS\system32\cmd.exe
    PSModulePath = C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
    ANDROID_NDK_ROOT = C:\Program Files\Unity\Hub\Editor\2021.3.13f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK
    USERNAME = Peter
    NUMBER_OF_PROCESSORS = 12
    JAVA_TOOL_OPTIONS = -Dfile.encoding=UTF-8
    BURST_ANDROID_MIN_API_LEVEL = 22
    FPS_BROWSER_APP_PROFILE_STRING = Internet Explorer
    TEMP = C:\Users\ALEXAN~1\AppData\Local\Temp
    Path = C:\Program Files\PlasticSCM5\server;C:\Program Files\PlasticSCM5\client;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\PuTTY\;C:\Program Files\dotnet\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Inkscape\bin;C:\Program Files\platform-tools;C:\Users\Peter\AppData\Local\Microsoft\WindowsApps;C:\Users\Peter\.dotnet\tools;
    COMPUTERNAME = PeterS-PC
    PATHEXT = .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
    ALLUSERSPROFILE = C:\ProgramData
    SystemDrive = C:
    windir = C:\WINDOWS
    FPS_BROWSER_USER_PROFILE_STRING = Default
    HOMEPATH = \Users\Peter
    PUBLIC = C:\Users\Public
    CommonProgramFiles(x86) = C:\Program Files (x86)\Common Files
    APPDATA = C:\Users\Peter\AppData\Roaming
    OneDrive = C:\Users\Peter\OneDrive
    PROCESSOR_LEVEL = 6
    CommonProgramW6432 = C:\Program Files\Common Files
    ProgramFiles(x86) = C:\Program Files (x86)
    SystemRoot = C:\WINDOWS
    SESSIONNAME = Console
    LOGONSERVER = \\PeterS-PC
    LOCALAPPDATA = C:\Users\Peter\AppData\Local
    HOMEDRIVE = C:
    USERDOMAIN_ROAMINGPROFILE = Peters-PC
    ProgramData = C:\ProgramData
    ORIGINAL_XDG_CURRENT_DESKTOP = undefined


    stderr[

    FAILURE: Build failed with an exception.

    * What went wrong:
    Could not determine the dependencies of task ':launcher:lintVitalRelease'.
    > This project uses AndroidX dependencies, but the 'android.useAndroidX' property is not enabled. Set this property to true in the gradle.properties file and retry.
    The following AndroidX dependencies are detected: androidx.fragment:fragment:1.0.0, androidx.slidingpanelayout:slidingpanelayout:1.0.0, androidx.versionedparcelable:versionedparcelable:1.1.0, androidx.core:core:1.2.0, androidx.customview:customview:1.0.0, androidx.swiperefreshlayout:swiperefreshlayout:1.0.0, androidx.interpolator:interpolator:1.0.0, androidx.loader:loader:1.0.0, androidx.drawerlayout:drawerlayout:1.0.0, androidx.viewpager:viewpager:1.0.0, androidx.collection:collection:1.0.0, androidx.localbroadcastmanager:localbroadcastmanager:1.0.0, androidx.lifecycle:lifecycle-common:2.0.0, androidx.arch.core:core-common:2.0.0, androidx.annotation:annotation:1.2.0, androidx.startup:startup-runtime:1.0.0, androidx.tracing:tracing:1.0.0, androidx.legacy:legacy-support-core-ui:1.0.0, androidx.lifecycle:lifecycle-livedata:2.0.0, androidx.lifecycle:lifecycle-viewmodel:2.0.0, androidx.lifecycle:lifecycle-livedata-core:2.0.0, androidx.arch.core:core-runtime:2.0.0, androidx.legacy:legacy-support-core-utils:1.0.0, androidx.documentfile:documentfile:1.0.0, androidx.cursoradapter:cursoradapter:1.0.0, androidx.lifecycle:lifecycle-runtime:2.0.0, androidx.coordinatorlayout:coordinatorlayout:1.0.0, androidx.asynclayoutinflater:asynclayoutinflater:1.0.0, androidx.print:print:1.0.0

    * 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 5s
    Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
    ]
    stdout[
    Starting a Gradle Daemon, 2 incompatible Daemons could not be reused, use --status for details

    > 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
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.3.13f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\30.0.2\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.3.13f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.3.13f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-29\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.3.13f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-30\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.3.13f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.3.13f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\30.0.2\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.3.13f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.3.13f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-29\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.3.13f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-30\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.3.13f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only
    ]
    exit code: 1
    UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <b8958c706cdd4a7fa97745ad82493d62>:0)
    UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <b8958c706cdd4a7fa97745ad82493d62>:0)
    UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <b8958c706cdd4a7fa97745ad82493d62>:0)
    UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <b8958c706cdd4a7fa97745ad82493d62>: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 <b8958c706cdd4a7fa97745ad82493d62>: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 <b8958c706cdd4a7fa97745ad82493d62>:0)
    UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <b8958c706cdd4a7fa97745ad82493d62>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <b8958c706cdd4a7fa97745ad82493d62>: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 <b8958c706cdd4a7fa97745ad82493d62>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <b8958c706cdd4a7fa97745ad82493d62>:0)
    UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, AndroidPlayerBuildProgram.Data.AndroidPlayerBuildProgramOutput buildProgramOutput) (at <b8958c706cdd4a7fa97745ad82493d62>:0)
    UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <b8958c706cdd4a7fa97745ad82493d62>: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 <dc1a47a5816e4be7bc6817ee4d339e75>:0)
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)



    Build completed with a result of 'Failed' in 67 seconds (67164 ms)
    UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)



    UnityEditor.BuildPlayerWindow+BuildMethodException: 4 errors
    at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002da] in <dc1a47a5816e4be7bc6817ee4d339e75>:0
    at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <dc1a47a5816e4be7bc6817ee4d339e75>:0
    UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
     
    WaffleChicken likes this.
  5. WaffleChicken

    WaffleChicken

    Joined:
    Aug 19, 2022
    Posts:
    5

    I think I have exactly same problem.
    https://forum.unity.com/threads/uni...ible-with-the-package-how-do-i-solve.1363974/
     
  6. DeclanMcPartlin

    DeclanMcPartlin

    Unity Technologies

    Joined:
    Nov 19, 2020
    Posts:
    146
    Hey @Journeyoon, are you able to successfully build though?

    @IT-Loesungen-Huntemann you seem to have the same issue as the thread Journeyoon linked to, I'll provide potential solutions there, let us know if they work for you.

    Thanks!
     
  7. dousi96

    dousi96

    Joined:
    Jul 28, 2014
    Posts:
    23
    I still have this issue trying to build my game for android.
    I'm on a Windows 11 PC using Unity 2022.2.10f1.
    I have these packages installed:
    upload_2023-3-10_7-47-35.png