Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

Question Dependency error with Mediation Android build

Discussion in 'Unity Mediation' started by PatriotsvsSocialist, Nov 12, 2022.

  1. PatriotsvsSocialist

    PatriotsvsSocialist

    Joined:
    Sep 18, 2021
    Posts:
    9
    What went wrong:
    Could not determine the dependencies of task ':launcher: processDebugResources'.
    > Could not resolve all task dependencies for configuration ':launcher:debugRuntimeClasspath'.

    Unities Solution:
    If the Android build continues to fail, the likely issue is that there are some conflicting dependencies. For example, if you are using an SDK version with a dependency that is incompatible with Unity Mediation.

    I hate to be ignorant, but I'm in over my head. How do I know which SDK to upgrade or where to even start looking for such SDK?
     
    russellnadin and pandolfini like this.
  2. TonismoGames

    TonismoGames

    Joined:
    Jun 12, 2018
    Posts:
    111
    I am also having issues with this coming from using Admob plugin
     
  3. DeclanMcPartlin

    DeclanMcPartlin

    Unity Technologies

    Joined:
    Nov 19, 2020
    Posts:
    146
    Hello @PatriotsvsSocialist, @TonismoGames,

    Please use 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 (if applicable).

    After that, make sure the dependencies have been resolved (you should see a popup asking you to resolve on build, click Resolve). Once that is done, please share your mainTemplate.gradle file here so we can look at what are the native dependencies being included in your build.

    Thanks!
     
    Noooaaahhhh likes this.
  4. sonnguyen9800

    sonnguyen9800

    Joined:
    Dec 9, 2020
    Posts:
    8

    Hello, I encountered this same error. Also, here is my mainTemplate.gradle file:

    Code (Boo):
    1. // Android Resolver Repos Start
    2. ([rootProject] + (rootProject.subprojects as List)).each {
    3.     ext {
    4.         it.setProperty("android.useAndroidX", true)
    5.         it.setProperty("android.enableJetifier", true)
    6.     }
    7. }
    8. ([rootProject] + (rootProject.subprojects as List)).each { project ->
    9.     project.repositories {
    10.         def unityProjectPath = $/file:///**DIR_UNITYPROJECT**/$.replace("\\", "/")
    11.         maven {
    12.             url "https://maven.google.com"
    13.         }
    14.         maven {
    15.             url "https://unity3ddist.jfrog.io/artifactory/unity-mediation-mvn-prod-local/" // Assets/Editor/MediationAdapterDependencies.xml:6
    16.         }
    17.         mavenLocal()
    18.         jcenter()
    19.         mavenCentral()
    20.     }
    21. }
    22. // Android Resolver Repos End
    23. apply plugin: 'com.android.library'
    24. **APPLY_PLUGINS**
    25.  
    26. dependencies {
    27.     implementation fileTree(dir: 'libs', include: ['*.jar'])
    28. // Android Resolver Dependencies Start
    29.     implementation 'com.unity3d.mediation:mediation-sdk:[1.0,2.0[' // Assets/Editor/MediationAdapterDependencies.xml:8
    30.     implementation 'com.unity3d.mediation:unityads-adapter:[1.0,2.0[' // Assets/Editor/MediationAdapterDependencies.xml:10
    31. // Android Resolver Dependencies End
    32. **DEPS**}
    33.  
    34. // Android Resolver Exclusions Start
    35. android {
    36.   packagingOptions {
    37.       exclude ('/lib/armeabi/*' + '*')
    38.       exclude ('/lib/mips/*' + '*')
    39.       exclude ('/lib/mips64/*' + '*')
    40.       exclude ('/lib/x86/*' + '*')
    41.       exclude ('/lib/x86_64/*' + '*')
    42.   }
    43. }
    44. // Android Resolver Exclusions End
    45. android {
    46.     compileSdkVersion **APIVERSION**
    47.     buildToolsVersion '**BUILDTOOLS**'
    48.  
    49.     compileOptions {
    50.         sourceCompatibility JavaVersion.VERSION_1_8
    51.         targetCompatibility JavaVersion.VERSION_1_8
    52.     }
    53.  
    54.     defaultConfig {
    55.         minSdkVersion **MINSDKVERSION**
    56.         targetSdkVersion **TARGETSDKVERSION**
    57.         ndk {
    58.             abiFilters **ABIFILTERS**
    59.         }
    60.         versionCode **VERSIONCODE**
    61.         versionName '**VERSIONNAME**'
    62.         consumerProguardFiles 'proguard-unity.txt'**USER_PROGUARD**
    63.     }
    64.  
    65.     lintOptions {
    66.         abortOnError false
    67.     }
    68.  
    69.     aaptOptions {
    70.         noCompress = **BUILTIN_NOCOMPRESS** + unityStreamingAssets.tokenize(', ')
    71.         ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~"
    72.     }**PACKAGING_OPTIONS**
    73. }**REPOSITORIES**
    74. **IL_CPP_BUILD_SETUP**
    75. **SOURCE_BUILD_SETUP**
    76. **EXTERNAL_SOURCES**
    77.  
     
    russellnadin likes this.