Search Unity

Bug Unity build Error - ' SDK incompatible with the package ' How do I solve?

Discussion in 'Unity Mediation' started by WaffleChicken, Nov 21, 2022.

  1. WaffleChicken

    WaffleChicken

    Joined:
    Aug 19, 2022
    Posts:
    5
    Hi, I've been really stressed with Unity, because I can't build my project after using Unity Advertisement with Mediation package, and I couldn't find solution.

    When I build it, this appears.



    And this is the Error log.


    BuildFailedException: Build canceled
    Unity.Services.Mediation.Build.Editor.AndroidNativeDependenciesPreBuildCheck.DisplayIssueDetectedDialog (System.Boolean noDialog, System.String issue, Unity.Services.Mediation.Build.Editor.AndroidNativeDependenciesPreBuildCheck+UserAction action) (at Library/PackageCache/com.unity.services.mediation@1.0.5/Editor/Build/PreBuild/AndroidNativeDependenciesPreBuildCheck.cs:144)
    Unity.Services.Mediation.Build.Editor.AndroidNativeDependenciesPreBuildCheck.ValidateDependencies (System.Boolean noDialog) (at Library/PackageCache/com.unity.services.mediation@1.0.5/Editor/Build/PreBuild/AndroidNativeDependenciesPreBuildCheck.cs:92)
    Unity.Services.Mediation.Build.Editor.AndroidNativeDependenciesPreBuildCheck.OnPreprocessBuild (UnityEditor.Build.Reporting.BuildReport report) (at Library/PackageCache/com.unity.services.mediation@1.0.5/Editor/Build/PreBuild/AndroidNativeDependenciesPreBuildCheck.cs:48)
    UnityEditor.Build.BuildPipelineInterfaces+<>c__DisplayClass16_0.<OnBuildPreProcess>b__1 (UnityEditor.Build.IPreprocessBuildWithReport bpp) (at <4ce403b7cdf744109283ae55cdc24285>:0)
    UnityEditor.Build.BuildPipelineInterfaces.InvokeCallbackInterfacesPair[T1,T2] (System.Collections.Generic.List`1[T] oneInterfaces, System.Action`1[T] invocationOne, System.Collections.Generic.List`1[T] twoInterfaces, System.Action`1[T] invocationTwo, System.Boolean exitOnFailure) (at <4ce403b7cdf744109283ae55cdc24285>:0)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&)

    Error building Player: BuildFailedException: Build canceled

    Build completed with a result of 'Failed' in 507 seconds (507357 ms)
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)
    UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
    at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002da] in <4ce403b7cdf744109283ae55cdc24285>:0
    at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <4ce403b7cdf744109283ae55cdc24285>:0
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)
    [Package Manager Window] Cannot perform upm operation: Unable to perform online search:
    Request [GET https://packages.unity.com/-/api/search?host=editor&provider=enterprise] failed with status code [504] [NotFound].
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()
    [Package Manager Window] Error searching for packages.
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()
    `
    MY UNITY EDITOR VERSION : 2022.1.23f1
    MY PACKAGE MANAGER :






    I tried adding Custom Main Gradle Template, remove all binaries(.aar, .jar), and resolve, but it didn't work, and causes error below.

    Error Log :

    `
    Starting a Gradle Daemon, 1 incompatible Daemon 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

    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.slidingpanelayout:slidingpanelayout:1.0.0, androidx.fragment:fragment: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.legacy:legacy-support-core-ui:1.0.0, androidx.lifecycle:lifecycle-livedata:2.0.0, androidx.tracing:tracing:1.0.0, androidx.lifecycle:lifecycle-viewmodel:2.0.0, androidx.browser:browser:1.0.0, androidx.lifecycle:lifecycle-livedata-core:2.0.0, androidx.arch.core:core-runti me: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

    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.slidingpanelayout:slidingpanelayout:1.0.0, androidx.fragment:fragment: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.legacy:legacy-support-core-ui:1.0.0, androidx.lifecycle:lifecycle-livedata:2.0.0, androidx.tracing:tracing:1.0.0, androidx.lifecycle:lifecycle-viewmodel:2.0.0, androidx.browser:browser:1.0.0, androidx.lifecycle:lifecycle-livedata-core:2.0.0, androidx.arch.core:core-runti me: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

    BUILD FAILED in 26s
    Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
    ]
    stdout[

    Starting a Gradle Daemon, 1 incompatible Daemon 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
    ]
    `
    So I added Custom Gradle Properties Template, and added 'android.useAndroidX=true' in properties script. But still got the errors.


    Thank you for reading these, and any help would be greatly appreciated.
     
    unity_Sh39zRilfrxeUA likes this.
  2. DeclanMcPartlin

    DeclanMcPartlin

    Unity Technologies

    Joined:
    Nov 19, 2020
    Posts:
    146
    Which errors did you get?

    I believe you're nearly there, I'd recommend also adding this to your gradleTemplate.properties file:

    android.enableJetifier=true

    Thanks for reaching out!
     
  3. WaffleChicken

    WaffleChicken

    Joined:
    Aug 19, 2022
    Posts:
    5


    I also added 'android.enableJetifier=true' just before, but still got the errors.




    Error Log :

    Starting a Gradle Daemon, 1 incompatible Daemon 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
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)


    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'.
    > Did not resolve 'android.arch.lifecycle:runtime:1.1.1' which is part of the dependency lock state
    > Did not resolve 'com.android.support:support-compat:26.1.0' which is part of the dependency lock state
    > Did not resolve 'android.arch.core:runtime:1.1.1' which is part of the dependency lock state
    > Did not resolve 'android.arch.lifecycle:viewmodel:1.1.1' which is part of the dependency lock state
    > Did not resolve 'android.arch.lifecycle:livedata:1.1.1' which is part of the dependency lock state
    > Did not resolve 'com.android.support:support-core-utils:26.1.0' which is part of the dependency lock state
    > Did not resolve 'android.arch.lifecycle:extensions:1.1.1' which is part of the dependency lock state
    > Did not resolve 'com.android.support:support-core-ui:26.1.0' which is part of the dependency lock state
    > Resolved 'androidx.lifecycle:lifecycle-service:2.0.0' which is not part of the dependency lock state
    > Did not resolve 'com.android.support:support-annotations:26.1.0' which is part of the dependency lock state
    > Resolved 'androidx.lifecycle:lifecycle-process:2.0.0' which is not part of the dependency lock state
    > Did not resolve 'android.arch.lifecycle:livedata-core:1.1.1' which is part of the dependency lock state
    > Did not resolve 'android.arch.lifecycle:common:1.1.1' which is part of the dependency lock state
    > Did not resolve 'com.android.support:support-fragment:26.1.0' which is part of the dependency lock state
    > Resolved 'androidx.lifecycle:lifecycle-extensions:2.0.0' which is not part of the dependency lock state
    > Did not resolve 'android.arch.core:common:1.1.1' which is part of the dependency lock state

    * 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 27s
    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\2022.1.23f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2022.1.23f1\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'.
    > Did not resolve 'android.arch.lifecycle:runtime:1.1.1' which is part of the dependency lock state
    > Did not resolve 'com.android.support:support-compat:26.1.0' which is part of the dependency lock state
    > Did not resolve 'android.arch.core:runtime:1.1.1' which is part of the dependency lock state
    > Did not resolve 'android.arch.lifecycle:viewmodel:1.1.1' which is part of the dependency lock state
    > Did not resolve 'android.arch.lifecycle:livedata:1.1.1' which is part of the dependency lock state
    > Did not resolve 'com.android.support:support-core-utils:26.1.0' which is part of the dependency lock state
    > Did not resolve 'android.arch.lifecycle:extensions:1.1.1' which is part of the dependency lock state
    > Did not resolve 'com.android.support:support-core-ui:26.1.0' which is part of the dependency lock state
    > Resolved 'androidx.lifecycle:lifecycle-service:2.0.0' which is not part of the dependency lock state
    > Did not resolve 'com.android.support:support-annotations:26.1.0' which is part of the dependency lock state
    > Resolved 'androidx.lifecycle:lifecycle-process:2.0.0' which is not part of the dependency lock state
    > Did not resolve 'android.arch.lifecycle:livedata-core:1.1.1' which is part of the dependency lock state
    > Did not resolve 'android.arch.lifecycle:common:1.1.1' which is part of the dependency lock state
    > Did not resolve 'com.android.support:support-fragment:26.1.0' which is part of the dependency lock state
    > Resolved 'androidx.lifecycle:lifecycle-extensions:2.0.0' which is not part of the dependency lock state
    > Did not resolve 'android.arch.core:common:1.1.1' which is part of the dependency lock state

    * 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 27s
    Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
    ]
    stdout[
    Starting a Gradle Daemon, 1 incompatible Daemon 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
    ]
    exit code: 1
    UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <6ba6f58d0f264bb59a4f0a6df92c605b>:0)
    UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <6ba6f58d0f264bb59a4f0a6df92c605b>:0)
    UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <6ba6f58d0f264bb59a4f0a6df92c605b>:0)
    UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <6ba6f58d0f264bb59a4f0a6df92c605b>: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 <6ba6f58d0f264bb59a4f0a6df92c605b>: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 <6ba6f58d0f264bb59a4f0a6df92c605b>:0)
    UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <6ba6f58d0f264bb59a4f0a6df92c605b>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <6ba6f58d0f264bb59a4f0a6df92c605b>: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 <6ba6f58d0f264bb59a4f0a6df92c605b>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <6ba6f58d0f264bb59a4f0a6df92c605b>:0)
    UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, AndroidPlayerBuildProgram.Data.AndroidPlayerBuildProgramOutput buildProgramOutput) (at <6ba6f58d0f264bb59a4f0a6df92c605b>:0)
    UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <6ba6f58d0f264bb59a4f0a6df92c605b>: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 <4ce403b7cdf744109283ae55cdc24285>:0)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&)


    Build completed with a result of 'Failed' in 494 seconds (493626 ms)
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)


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

    My Build Settings


    gradleTemplate.properties file before I tried to build




    gradleTemplate.properties file after I tried to build


    Thanks for your help!
     
  4. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    501
    Had the same issue, after adding
    android.enableJetifier=true
    android.useAndroidX=true

    it worked, but only when set to Release build, Master doesn't work which seems to be another issue.

    However on iOS it now reports "'UnityMediationSdk/UnityMediationSdk.h' file not found"

    So just as an info...
     
  5. AppleseedSmoothie

    AppleseedSmoothie

    Joined:
    Jul 4, 2016
    Posts:
    2
    Any new information regarding this? I'm getting the exact same issue and adding android.enableJetifier=true and stuff to gradle properties does nothing. I heard something about there being an issue with Unity Mediation? I'm assuming reinstalling the entire Android SDK might be a valid solution right? Only thing I can think of
     
  6. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    501
    I simply switched to LevelPlay since Unity Mediation is deprecated. Now also iOS compiled for me.
     
    WaffleChicken likes this.
  7. WaffleChicken

    WaffleChicken

    Joined:
    Aug 19, 2022
    Posts:
    5
    Is it worked???
     
  8. swimmng

    swimmng

    Joined:
    Feb 14, 2018
    Posts:
    1
    I have the same problem. I tried the above solution, but the problem is not solved.
     

    Attached Files:

  9. DeclanMcPartlin

    DeclanMcPartlin

    Unity Technologies

    Joined:
    Nov 19, 2020
    Posts:
    146
    Hey everyone, if this error shows up for you as well, it looks like your dependency lock files need to be regenerated. Either delete the folder Assets/Editor/Platform-Dependencies or uncheck the box for Generate Deterministic Builds with Lock Files in Services/Unity Mediation/Configure/Build Settings. Another option is to check the box for Force Future Builds to Include the Newest Valid Native Dependencies. This will also regenerate the lock files.

    Regarding the iOS issue mentioned above, this is a very generic umbrella issue already reported multiple times, please create a separate thread if non of the existing solutions in this forum work for you, also include all the versions of the tools you are using (cocoapods, Xcode, Editor, ..) along with all the console logs (especially the Unity Editor console logs).

    Let us know if that works. Thanks!
     
    rlofeudo likes this.
  10. WaffleChicken

    WaffleChicken

    Joined:
    Aug 19, 2022
    Posts:
    5
    I just tried everything you said(delete the folder Assets/Editor/Platform-Dependencies, uncheck the box for Generate Deterministic Builds with Lock Files in Services/Unity Mediation/Configure/Build Settings, check the box for Force Future Builds to Include the Newest Valid Native Dependencies), but got the same error as before.

    (I tried in initial settings : Custom Main Gradle Template unchecked, Custom Gradle Properties Template unchecked)

    And even the dependency lock file doesn't seem to be regenerated(there is no Assets/Editor/Platform-Dependencies folder after removed and build).

    Thanks for your help

    (I'm just going to try using LevelPlay at another test project...)
     
    Last edited: Nov 29, 2022
  11. watermelonlab

    watermelonlab

    Joined:
    Sep 17, 2015
    Posts:
    15
    I am able to build successfully with custom manifest check on , custom main Gradle template check on and custom Gradle properties template check on. But at run time I am getting this log: I checked my ad unit which is correct.
    Help me to do that.

    2022-11-30 14:20:36.011 11655 11655 Info logger Mediation SDK version: 1.1.0
    2022-11-30 14:20:39.177 11655 12581 Info tracker register new receiver with filter com.digitalmedia.hunt.track.process
    2022-11-30 14:20:41.800 11655 12462 Debug SharedPreferencesImpl Time required to fsync /data/user/0/com.water.mancalabestboardgame/shared_prefs/unity_mediation_data+privacy.xml: [<1: 0, <2: 0, <4: 0, <8: 0, <16: 0, <32: 0, <64: 0, <128: 0, <256: 0, <512: 1, <1024: 0, <2048: 0, <4096: 0, <8192: 0, <16384: 0, >=16384: 0]
    2022-11-30 14:20:41.839 11655 12642 Info logger The Unity Mediation SDK has been initialized.
    2022-11-30 14:20:43.691 11655 12837 Error logger com.unity3d.mediation.l0: Exception raised while retrieving the Ad Unit Configuration: com.unity3d.mediation.k0: Requested Ad Unit has incorrect format.
     
  12. Settos

    Settos

    Joined:
    Aug 3, 2015
    Posts:
    16
    I have the same error message. However, Unity still manages to build when I ignore it and the app seems to work perfectly fine. But can I be sure that it is fine?

    Another thing, is the Unity LevelPlay thing mentioned here legit? Are we supposed to to move to that? Why doesn't the Unity website clearly tell us that.
     
    ferryjufri likes this.
  13. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,778
    Unity Ads -> Mediation -> Level Play and all the documentation associated with these migrations are the most convoluted and confusing mess of documentation if have ever seen. Nothing is up to date. Documentation is spread across multiple websites and all tell you conflicting out of date information.

    Inside unity itself it also tells you conflicting information. Unity Ads tells you to install the ads package even though it's incompatible with mediation that is already installed.

    Seriously bad.

    From what i can tell, all of these are out of date and you should NOT use any of them
    https://docs.unity.com/ads/en/UnityDeveloperIntegrations.html
    https://docs.unity.com/mediation/IntroToMediation.html
    Even though they are linked to on the Dashboard.... nice 3 hour distraction, thanks unity. It even says 'REQUIRED' But it's the old and soon to be unsupported version of Unity Ads.

    Screen Shot 2022-12-26 at 5.11.33 PM.png


    And this is the most up to date but not quite current implementation of Ads for Unity. Which is acutally just IronSource confusingly named as Unity LevelPlay, you know because why would i implement IronSource when I'm trying to implement UnityAds (I know you merged but this is next level confusing naming of SDKs).
    https://developers.is.com/ironsource-mobile/general/move-to-unity-levelplay/#step-1

    What's the bet that in 6 months I'll need to rip all this out and re-implement the same stuff again only with 'IronSource' replaced by 'Unity' in the code, oh and some other implementation details around caching and showing ad units that seems to change in ever version ever made.

    I'm looking forward to that. (Sarc).
     
    Last edited: Dec 26, 2022
  14. Settos

    Settos

    Joined:
    Aug 3, 2015
    Posts:
    16
    Yeah, it really might be the most convoluted mess I've seen working with Unity. I've given up half way through. Now I can't even reinstall "advertisement with mediation" anymore as that this stillbirth was removed from the package manager. And I had moved to "advertisement with mediation" only at the beginning of this month. I've just wasted days with this S***. So I've gone back to using Unity Ads legacy. Since I only use Unity Ads for now I don't see a need for mediation, so it's not a big issue for me, but then again, they are stopping support for it so there is that. But I won't migrate until they make the migration smooth. Why the f## isn't there a simple full script with we can just copy and modify. I won't touch it anymore, because I know that once I integrate it they'll change things again. I'll wait until they got their act together.

    You know what is really crazy? Unity made the deal 5 months ago. You'd think they'd figured it out by now. From what I can tell, there is some super easy integration for Adobe Air, but not for Unity. They should work on integrating whatever they want with it into the Unity Editor, to make it smooth like the good old legacy unity ads.
     
    anycolourulike likes this.
  15. mibrar

    mibrar

    Joined:
    Nov 20, 2012
    Posts:
    2
    tried all stuff but in vain upload_2023-1-11_0-36-12.png
     
  16. mibrar

    mibrar

    Joined:
    Nov 20, 2012
    Posts:
    2
    also tried upload_2023-1-11_0-37-39.png
     
  17. unitydevelopers-greg

    unitydevelopers-greg

    Joined:
    Nov 15, 2018
    Posts:
    12
    This mess really need to be fixed @DeclanMcPartlin Package should work out of the box without each dev spending days trying to tweak their settings to the ideal scenario mediation package supports.
     
    anycolourulike likes this.
  18. jcGrenier

    jcGrenier

    Unity Technologies

    Joined:
    Feb 23, 2021
    Posts:
    145
    Hey @unitydevelopers-greg ,
    While I totally understand your (and other users) frustration, and I can admit the transition from Unity Mediation to LevelPlay could have been smoother (and I immensely appreciate you guys giving us feedback, as it helps inform us and the decision makers, so we can make our product better) making a one-size fits all package is unfortunately near impossible.
    Mediation in itself is a complex domain. It relies on third party libraries from several different providers, that must play nice with one another, and the solution must ensure proper libraries compatibility between all the dependencies.
    Add to that the fact that every user has a different application, and their own requirements, it becomes very tough to have a solution that works for everyone.
    For example, our documentation encourages using a mainTemplate.gradle file, but some users may not be able to or want to, so we can't simply force the setting, or even enable it without the user's knowledge, because if we do, some users will have an easier time, while some will be more frustrated.
    This is why our approach is to offer documentation and inform our users so they can make their own decision.

    We hope LevelPlay will soon be fully integrated, and that as we receive more feedback from our users, we can provide more informations, and make informed decisions to make the product more convenient to use. In the meantime, please keep sharing your issues with us, as an issue we never hear about is an issue we can not address :)
     
  19. jarzykk

    jarzykk

    Joined:
    May 18, 2022
    Posts:
    5
    Hi all.
    Have you found solution for the problem? I'va faced the same issue.
    Errors:

    > 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

    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 953ms
    Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

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

    CommandInvokationFailure: Gradle build failed.

    Build completed with a result of 'Failed' in 38 seconds (38360 ms)

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

    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)
    C:\Program Files\Unity\Hub\Editor\2021.3.4f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2021.3.4f1\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'.
    > 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 953ms
    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 <c3a2c42a45424b88b29dfadf7f497cbb>:0)
    UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <c3a2c42a45424b88b29dfadf7f497cbb>:0)
    UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <c3a2c42a45424b88b29dfadf7f497cbb>:0)
    UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <c3a2c42a45424b88b29dfadf7f497cbb>: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 <c3a2c42a45424b88b29dfadf7f497cbb>: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 <c3a2c42a45424b88b29dfadf7f497cbb>:0)
    UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <c3a2c42a45424b88b29dfadf7f497cbb>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <c3a2c42a45424b88b29dfadf7f497cbb>: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 <c3a2c42a45424b88b29dfadf7f497cbb>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <c3a2c42a45424b88b29dfadf7f497cbb>:0)
    UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, AndroidPlayerBuildProgram.Data.AndroidPlayerBuildProgramOutput buildProgramOutput) (at <c3a2c42a45424b88b29dfadf7f497cbb>:0)
    UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <c3a2c42a45424b88b29dfadf7f497cbb>: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 <36f62d8e760b48f7af5d32916f997ce1>:0)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&)
     
    Last edited: Feb 16, 2023
  20. jcGrenier

    jcGrenier

    Unity Technologies

    Joined:
    Feb 23, 2021
    Posts:
    145
    Have you tried what the error message suggests?
    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.
     
  21. TheLUNARTICK

    TheLUNARTICK

    Joined:
    Feb 15, 2014
    Posts:
    10
    Wow, I have been struggling with these same issues over the past week. I was just barely getting used to Unity Ads... and now it has changed again. Super challenging for a bit of a novice.

    I will continue to read through the threads to see what works.

    Thanks for the Support Devs! @jcGrenier and @DeclanMcPartlin, greatly appreciate you guys jumping in with the insight and support! It can't be easy.
     
    jcGrenier likes this.
  22. SlothDogGames

    SlothDogGames

    Joined:
    Aug 17, 2021
    Posts:
    6
    i installed google ads sdk under the ads mediation menu and now no longer want to use it. How do i delete the SDK as there's no clear files and it's causing an error when i triy to build to my android device?
     
  23. valonsoft

    valonsoft

    Joined:
    May 22, 2016
    Posts:
    28
    The easiest way to solve this problem is to migrate to Unity 2022.2
     
  24. EdwinOlima

    EdwinOlima

    Joined:
    Jul 27, 2017
    Posts:
    11
    This Gradle issue was bugging me for months and after a Unity rep said there was something wrong with the Gradle installed I did the following:

    1- uninstalled Unity, Unity Hub Visual Studio, and removed all references to Unity, Unity Hub and Gradle in the windows Registry using the Registry Editor (type Reg in windows search bar for this app). Be careful deleting stuff here though.

    2-I then reinstalled Unity Hub, Unity (latest version) and Visual Studio 2022,

    3-Opened up the project I was working on in Unity and deleted the "Android" folder in plugins. This will get recreated on build. Come to think of it next time I will start by deleting this folder first before doing steps 1 & 2 and see if it works, because it gets recreated on build.


    4-Run a build and it created an APK !. There was one warning message (about checking gradle check box) which i ignored to let the Unity Editor continue, and it created the APK. It was bigger than previously but I was able to upload to google playstore.

    If the above steps help anyone please vote up, thanks.
     
    Last edited: Mar 7, 2023
  25. luispuertolas

    luispuertolas

    Joined:
    Sep 26, 2017
    Posts:
    7
    The problem was solved by making the SDK folder and all files and subfolders readable. However, it is not working anymore on unity 2022.2.12f. It is impossible to make the folders readable through windows explorer because as soon as you do it, they become non-readable again.
     
  26. a17714375388

    a17714375388

    Joined:
    Sep 23, 2022
    Posts:
    10
    I got a simliar problems and has been blocked for many times, And try the available solutions for many times, it still doesn't work:(
     
  27. Ak47-forever

    Ak47-forever

    Joined:
    Mar 1, 2015
    Posts:
    16
    this is pain
     
    yildirimcemalcan likes this.
  28. toan-stt

    toan-stt

    Joined:
    Sep 30, 2013
    Posts:
    11
    I have the same problem, please help
     
  29. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,778
    Google requires an update. I cannot install the latest level play sdk into my project.

    I thought I'd run a test and install it into a blank project. Can't do that either. It's royally broken.

    Steps:
    Create blank project.
    Build to android to test SDK is working - this works
    Import IronSource
    Build to android - this works
    Import unity ads adaptor
    Problems - resolver does not work - No longer able to build to android.

    Unity v2022.3.17f
    IronSource v7.3.0
    Unity Ads Adaptor v4.3.39.2
    Android SDK target level 32, 33, 34 (tried all 3)

    I followed these instructions:
    https://developers.is.com/ironsource-mobile/unity/unity-plugin/#step-1