Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Bug Error related to Levelplay Update:2 files found with path 'META-INF/kotlinx_coroutines_core.version'

Discussion in 'LevelPlay' started by DanielF1324, Sep 17, 2023.

  1. DanielF1324

    DanielF1324

    Joined:
    Apr 10, 2021
    Posts:
    7
    Hello, I use unity levelplay for displaying my ads, I had created a unity game that used Ironsource and Unity Ads adapters and build and published it, no problem at first. Then however, I wanted to upgrade to the new version of the ironsource and unity ads adapters and on top integrate the google ad adapter, in hopes of increasing my ad revenue. In order to upgrade to the newer versions , I deleted my entire Ironsource folder (under "Assets/Ironsource") and then installed the adapters via the Levelplay integration manager (under "Ads Mediation/Integration Manager"). However, after reimporting everything and trying to build my game now, there is an error and the build failed. When I opened the Editor.log it said the following message:


    " * What went wrong: Execution failed for task ':launcher:mergeReleaseJavaResource'.

    A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction 2 files found with path 'META-INF/kotlinx_coroutines_core.version' from inputs:
    • I:\TitanCameramanRunSkibidi\Library\Bee\Android\Prj\IL2CPP\Gradle\unityLibrary\libs\org.jetbrains.kotlinx.kotlinx-coroutines-core-1.7.1.jar
    • I:\TitanCameramanRunSkibidi\Library\Bee\Android\Prj\IL2CPP\Gradle\unityLibrary\libs\org.jetbrains.kotlinx.kotlinx-coroutines-core-jvm-1.7.1.jar Adding a packagingOptions block may help, please refer to https://google.github.io/android-gr...ild.gradle.internal.dsl.PackagingOptions.html for more information "


    This could theoretically also have something to do with the fact that when I tried to resolve under "Assets/Mobile Dependency Resolver/Android Resolver/Resolve", the resolution kept failing at first, sending following messages into the Editor.log file: "Failed to fetch the following dependencies: org.jetbrains.kotlin:kotlin-bom:1.8.10"

    I have been trying to fix this for 2 days now, but can't seem to find any solution, therefore help would be more than very much appreciated, thanks in advance.
     
  2. yunanhou

    yunanhou

    Unity Technologies

    Joined:
    Feb 23, 2023
    Posts:
    72
    Thanks for your question, it seems that there is some issue with your Unity editor and dependency environments. Can you share below info please?
    1. Unity Editor version?
    2. Gradle version if you are referring to an external one
    3. LevelPlay SDK and adapter version.
    4. Sample project which can replicate the the issue
    Meanwhile, we recommend you to file case here with above info and our tech team will assist you further.

    Thanks
     
  3. tauseefnasir501

    tauseefnasir501

    Joined:
    Apr 2, 2021
    Posts:
    7
    I am getting the same error "Failed to fetch the following dependencies: org.jetbrains.kotlin:kotlin-bom:1.8.10" when resolving andriod dependency using "Assets/Mobile Dependency Resolver/Android Resolver/Resolve"

    unity editor version: 2021.3.7f1
    gradle version: built-in (which came with unity editor)
    levelplay sdk: IronSource_IntegrationManager_v7.5.1
    admob adopter version: 4.3.54.0
    unity ads adopter version: 4.3.36.2
     
  4. arossini-rortos

    arossini-rortos

    Joined:
    Oct 29, 2021
    Posts:
    19
    I have the same "Failed to fetch the following dependencies: org.jetbrains.kotlin:kotlin-bom:1.8.10" error.
    I also have some more information: the problem started with LevelPlay sdk "IronSource_IntegrationManager_v7.3.1.1".
    And the problem happens when you have also IronSource and OneSignal in the project.
    This is a sample project where the problem is easily triggerable by resolving android dependencies (https://drive.google.com/file/d/1NSrrrQXkPfqJNRZnMPuvel2LVS7ukZ_B/view?usp=drive_link)

    We are using Unity 2021.3.28f1 with the built-in JDK, SDK, NDK and gradle versions.

    These are the other things in the project that are triggering the problem:
    • IronSource 7.3.1.1 or higher
    • IronSource adapter - UnityAds 4.3.36.0 or higher
    • OneSignal 3.0.9 or higher (EDIT: OneSignal 3.0.5 or higher)
    • External Dependency Manager for Unity 1.2.175 or higher
    I'm looking for a solution since 2 months but I haven't managed to fix it yet!

    NOTE: I opened a ticket to IronSource, the ticket is #00352919, but they only replied asking me trying to update gradle. I don't know if it's the only solution, but in case, it would be great to know which version is the suggested one for the fix.
     
    Last edited: Sep 18, 2023
  5. tauseefnasir501

    tauseefnasir501

    Joined:
    Apr 2, 2021
    Posts:
    7
    I also have OneSignal v 3.0.5.
     
  6. arossini-rortos

    arossini-rortos

    Joined:
    Oct 29, 2021
    Posts:
    19
    Ok, I'll update the info above (specifing OneSignal 3.0.5 or higher).
    I'm pretty sure we have the same problem so. Let's see if someone from Unity can help us.
     
  7. arossini-rortos

    arossini-rortos

    Joined:
    Oct 29, 2021
    Posts:
    19
    Just a quick update: I have just downloaded gradle-8.3 (latest) and set it in the Unity path.
    The resolution still fail with the same error.
     
  8. tauseefnasir501

    tauseefnasir501

    Joined:
    Apr 2, 2021
    Posts:
    7
    I tried with unity ads and ironsource ads adopter but without adding admob adopter --> under "Ads Mediation/Integration Manager") and it works.

    So I think admob adopter is creating a problem.Can you do the same and verify it?
     
  9. arossini-rortos

    arossini-rortos

    Joined:
    Oct 29, 2021
    Posts:
    19
    Mmm... this is very strange!
    In the test project I linked in the message above, it's failing with only IronSource, OneSignal and UnityAds.

    However I've just tried deleting AdMob and it is still failing to me.
    Can you please download the test project above and tell me if it works for you?
     
  10. DanielF1324

    DanielF1324

    Joined:
    Apr 10, 2021
    Posts:
    7
    Hi, thanks for the answer:
    1. I am using Unity Editor version 2022.2.9f1
    2. I am using the built-in gradle version
    3. I am basically using all the newest SDK and adapter versions:
    a) My ironSource levelplay SDK version is 7.5.1
    b) My UnityAds adapter version is 4.3.36.2
    c) My Google(AdMob and Ad Manager) adapter version is 4.3.54.0
    4. I uploaded my project to google drive and this is the link: https://drive.google.com/drive/folders/13MF_9xVd9eFpchhmi9e2a2kKZpN6YLVB?usp=sharing (I have changed the values of my appKeys and disabled my custom keystore for privacy reasons so that no everyone can see them by the way, though this doesn't affect the error.)
     
    Last edited: Sep 18, 2023
  11. tauseefnasir501

    tauseefnasir501

    Joined:
    Apr 2, 2021
    Posts:
    7
    I tried your provided project and it is working fine. i also generated apk file with it. I used unity editor 2021.3.7f1
     
  12. arossini-rortos

    arossini-rortos

    Joined:
    Oct 29, 2021
    Posts:
    19
    I have just retried, and I have errors.
    So, should we conclude that it is related in some way to the environment where to dependencies resolution is running? If so, what settings should we check on our machines?

    It seems really strange to me honestly. I would expect it depends on Unity version, not on the env.
     
    Last edited: Sep 19, 2023
  13. el_Guero

    el_Guero

    Joined:
    Sep 15, 2017
    Posts:
    186
    Same problem, did you solve it?
     
  14. SKGowrob

    SKGowrob

    Joined:
    Sep 12, 2021
    Posts:
    11
    same error for applovin and airbridge io with appsflyer with facebook sdk makes this issue for me


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

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':unityLibrary:mergeReleaseJavaResource'.
    > A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction
    > 2 files found with path 'META-INF/kotlinx_coroutines_core.version' from inputs:
    - C:\UnityProject\Strike2048 SC\Library\Bee\Android\Prj\IL2CPP\Gradle\unityLibrary\libs\org.jetbrains.kotlinx.kotlinx-coroutines-core-1.7.1.jar
    - C:\UnityProject\Strike2048 SC\Library\Bee\Android\Prj\IL2CPP\Gradle\unityLibrary\libs\org.jetbrains.kotlinx.kotlinx-coroutines-core-jvm-1.7.1.jar
    Adding a packagingOptions block may help, please refer to
    https://google.github.io/android-gr...ild.gradle.internal.dsl.PackagingOptions.html
    for more information

    * 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 13s

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

    Another error console...


    > Configure project :launcher
    =============================================================================
    AppLovin Quality Service Plug-in for Gradle and Android Studio Version 4.13.5
    Copyright (c) 2023 AppLovin Ltd. All rights reserved.
    =============================================================================
    WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 33

    This Android Gradle plugin (7.1.2) was tested up to compileSdk = 32

    This warning can be suppressed by adding
    android.suppressUnsupportedCompileSdk=33
    to this project's gradle.properties

    The build will continue, but you are strongly encouraged to update your project to
    use a newer Android Gradle Plugin that has been tested with compileSdk = 33

    > Task :launcher:preBuild UP-TO-DATE
    > Task :launcher:preReleaseBuild UP-TO-DATE
    > Task :unityLibrary:preBuild UP-TO-DATE
    > Task :unityLibrary:preReleaseBuild UP-TO-DATE
    > Task :unityLibrary:compileReleaseAidl NO-SOURCE
    > Task :launcher:generateReleaseBuildConfig UP-TO-DATE
    > Task :unityLibrary:mergeReleaseJniLibFolders UP-TO-DATE
    > Task :launcher:compileReleaseAidl NO-SOURCE
    > Task :unityLibrary:mergeReleaseNativeLibs UP-TO-DATE
    > Task :launcher:javaPreCompileRelease UP-TO-DATE
    > Task :unityLibrary:stripReleaseDebugSymbols UP-TO-DATE
    > Task :launcher:generateReleaseResValues UP-TO-DATE
    > Task :launcher:createReleaseCompatibleScreenManifests UP-TO-DATE
    > Task :launcher:extractDeepLinksRelease UP-TO-DATE
    > Task :launcher:extractProguardFiles UP-TO-DATE
    > Task :launcher:mergeReleaseJniLibFolders UP-TO-DATE
    > Task :unityLibrary:copyReleaseJniLibsProjectAndLocalJars UP-TO-DATE
    > Task :unityLibrary:compileReleaseRenderscript NO-SOURCE
    > Task :unityLibrary:generateReleaseBuildConfig UP-TO-DATE
    > Task :unityLibrary:generateReleaseResValues UP-TO-DATE
    > Task :unityLibrary:generateReleaseResources UP-TO-DATE
    > Task :unityLibrary:packageReleaseResources UP-TO-DATE
    > Task :unityLibrary:parseReleaseLocalResources UP-TO-DATE
    > Task :unityLibrary:processReleaseManifest UP-TO-DATE

    > Task :launcher:checkReleaseDuplicateClasses
    WARNING: [Processor] Library 'C:\UnityProject\Strike2048 SC\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 :launcher:mergeReleaseShaders UP-TO-DATE
    > Task :launcher:compileReleaseShaders NO-SOURCE
    > Task :launcher:generateReleaseAssets UP-TO-DATE
    > Task :launcher:processReleaseJavaRes NO-SOURCE
    > Task :launcher:collectReleaseDependencies
    > Task :launcher:sdkReleaseDependencyData
    > Task :launcher:validateSigningRelease UP-TO-DATE
    > Task :launcher:writeReleaseAppMetadata UP-TO-DATE
    > Task :launcher:writeReleaseSigningConfigVersions UP-TO-DATE
    > Task :unityLibrary:javaPreCompileRelease UP-TO-DATE
    > Task :unityLibrary:mergeReleaseShaders UP-TO-DATE
    > Task :unityLibrary:compileReleaseShaders NO-SOURCE
    > Task :unityLibrary:generateReleaseAssets UP-TO-DATE
    > Task :unityLibrary:packageReleaseAssets
    > Task :unityLibrary:packageReleaseRenderscript NO-SOURCE
    > Task :unityLibrary:prepareLintJarForPublish UP-TO-DATE
    > Task :unityLibrary:prepareReleaseArtProfile UP-TO-DATE
    > Task :unityLibrary:processReleaseJavaRes UP-TO-DATE
    > Task :unityLibrary:writeReleaseAarMetadata UP-TO-DATE
    > Task :unityLibrary:extractDeepLinksRelease UP-TO-DATE
    > Task :unityLibrary:compileReleaseLibraryResources UP-TO-DATE
    > Task :unityLibrary:bundleLibResRelease UP-TO-DATE
    > Task :unityLibrary:writeReleaseLintModelMetadata UP-TO-DATE
    > Task :unityLibrary:copyReleaseJniLibsProjectOnly UP-TO-DATE
    > Task :launcher:mergeReleaseAssets
    > Task :launcher:compileReleaseRenderscript NO-SOURCE
    > Task :launcher:generateReleaseResources UP-TO-DATE
    > Task :launcher:checkReleaseAarMetadata
    > Task :unityLibrary:generateReleaseRFile
    > Task :unityLibrary:mergeReleaseJavaResource FAILED
    > Task :unityLibrary:extractReleaseAnnotations
    > Task :launcher:mergeReleaseResources
    41 actionable tasks: 10 executed, 31 up-to-date

    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)
     
  15. arossini-rortos

    arossini-rortos

    Joined:
    Oct 29, 2021
    Posts:
    19
    Haven't solved it yet.
    I'm also trying to update the whole project to Unity 2022.3.10f1 but it does not help, same

    Resolution failed

    Failed to fetch the following dependencies:
    org.jetbrains.kotlin:kotlin-bom:1.8.10


    error when trying to resolve Android dependencies.

    And, even without updating the UnityAds to the latest version, with Unity 2022.3.10 the same build error reported above appear.

    @yunanhou, any news about these topics (dependencies resolution and build error)?
     
    Last edited: Sep 25, 2023
  16. Protozoaire

    Protozoaire

    Joined:
    Apr 14, 2015
    Posts:
    62
    Same problem here with Unity 2022.3.10 and also tested with Unity 2022.3.4.

    Edit: Fixed by deleting org.jetbrains.kotlinx.kotlinx-coroutines-core-jvm-1.7.1.jar .......
     
    Last edited: Sep 25, 2023
  17. arossini-rortos

    arossini-rortos

    Joined:
    Oct 29, 2021
    Posts:
    19
    It fixed the build but I guess you will have problem with some plugin that actually has that package as a dependency.
    Or did you find anything else that justify the .jar deletion?
     
  18. Protozoaire

    Protozoaire

    Joined:
    Apr 14, 2015
    Posts:
    62
    Yes it's just a temporary solution to ship my app as I don't have the possibility to wait for an Unity official fix. I tested every part of my app and no crash so far... but I don't like being on the edge like that but it seems org.jetbrains.kotlinx.kotlinx-coroutines-core-jvm-1.7.1.jar is only for Unity (java virtual machine) ...
     
  19. arossini-rortos

    arossini-rortos

    Joined:
    Oct 29, 2021
    Posts:
    19
    I tried the same and my app crash on startup because the OneSignal initialization is failing.
    I guess you don't have OneSignal, am I right?
     
  20. Protozoaire

    Protozoaire

    Joined:
    Apr 14, 2015
    Posts:
    62
    :S Yes I just use Admob (without OneSignal and IronSource) ...
     
  21. NguyenVanSaopr

    NguyenVanSaopr

    Joined:
    Apr 25, 2022
    Posts:
    1
    It's nice to hear that someone has fixed the error. But how do you delete org.jetbrains.kotlinx.kotlinx-coroutines-core-jvm-1.7.1.jar? I tried deleting it but then it reappeared on its own
     
  22. melgeorgiou

    melgeorgiou

    Joined:
    Nov 3, 2012
    Posts:
    775
    I've been getting the same error when running the Android Resolver:

    Resolution failed

    Failed to fetch the following dependencies:
    org.jetbrains.kotlin:kotlin-bom:1.8.10

    On Unity 2021.3.27.

    Also tried to delete the file but I'm guessing it keeps getting regenerated by the Android Resolver? Not sure just yet.
     
    Last edited: Sep 25, 2023
  23. arossini-rortos

    arossini-rortos

    Joined:
    Oct 29, 2021
    Posts:
    19
    To delete that file you have to disable the automatic resolution dependencies on build and run it manually. But it's not an "official workaround".
    If you have OneSignal, for example, it does not work.
     
    Last edited: Sep 25, 2023
    NguyenVanSaopr likes this.
  24. Protozoaire

    Protozoaire

    Joined:
    Apr 14, 2015
    Posts:
    62
    I hope for a Unity official answer too. About OneSignal, perhaps it's crashing because of something else, sometimes it can be caused by Minify (if it's checked, perhaps try to unchecked it).
     
  25. arossini-rortos

    arossini-rortos

    Joined:
    Oct 29, 2021
    Posts:
    19
    I have tried deleting

    org.jetbrains.kotlinx.kotlinx-coroutines-core-1.7.1.jar

    and keep the -jvm one (so the other one compared to your solution).
    Doing that the build is starting correctly.

    But I am not really confident with this approach. I hope someone from Unity will answer here.
     
  26. securegames123

    securegames123

    Joined:
    Jun 30, 2020
    Posts:
    12
    I fixed it by adding following code in custom launcher gradle template. I am not sure if this is the right way to do it, but it works.
    Code (CSharp):
    1. packagingOptions {
    2.  
    3.            exclude('META-INF/kotlinx_coroutines_core.version')
    4.  
    5.     }
     
    Last edited: Sep 26, 2023
  27. arossini-rortos

    arossini-rortos

    Joined:
    Oct 29, 2021
    Posts:
    19
    Thank you @securegames123, it works fine when I try to build .aab.
    Do you know also how can we get it working for .apk builds?
     
  28. SMGamingAcademy

    SMGamingAcademy

    Joined:
    Apr 21, 2022
    Posts:
    1
    Thank you @securegames123, can you share your complete custom launcher gradle template file here
     
  29. arossini-rortos

    arossini-rortos

    Joined:
    Oct 29, 2021
    Posts:
    19
    I was able to build the .aab file with this launcherTemplate.gradle

    Code (Boo):
    1. apply plugin: 'com.android.application'
    2.  
    3. dependencies {
    4.     implementation project(':unityLibrary')
    5.     implementation 'androidx.multidex:multidex:2.0.1'
    6.     }
    7.  
    8. android {
    9.     ndkPath "**NDKPATH**"
    10.  
    11.     compileSdkVersion **APIVERSION**
    12.     buildToolsVersion '**BUILDTOOLS**'
    13.  
    14.     compileOptions {
    15.         sourceCompatibility JavaVersion.VERSION_11
    16.         targetCompatibility JavaVersion.VERSION_11
    17.     }
    18.  
    19.     defaultConfig {
    20.         minSdkVersion **MINSDKVERSION**
    21.         targetSdkVersion **TARGETSDKVERSION**
    22.         applicationId '**APPLICATIONID**'
    23.         multiDexEnabled true
    24.         ndk {
    25.             abiFilters **ABIFILTERS**
    26.         }
    27.         versionCode **VERSIONCODE**
    28.         versionName '**VERSIONNAME**'
    29.     }
    30.  
    31.     aaptOptions {
    32.         noCompress = **BUILTIN_NOCOMPRESS** + unityStreamingAssets.tokenize(', ')
    33.         ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~"
    34.     }**SIGN**
    35.  
    36.     lintOptions {
    37.         abortOnError false
    38.     }
    39.  
    40.     buildTypes {
    41.         debug {
    42.             minifyEnabled **MINIFY_DEBUG**
    43.             proguardFiles getDefaultProguardFile('proguard-android.txt')**SIGNCONFIG**
    44.             jniDebuggable true
    45.         }
    46.         release {
    47.             minifyEnabled **MINIFY_RELEASE**
    48.             proguardFiles getDefaultProguardFile('proguard-android.txt')**SIGNCONFIG**
    49.         }
    50.     }**PACKAGING_OPTIONS****PLAY_ASSET_PACKS****SPLITS**
    51. **BUILT_APK_LOCATION**
    52.     bundle {
    53.         language {
    54.             enableSplit = false
    55.         }
    56.         density {
    57.             enableSplit = false
    58.         }
    59.         abi {
    60.             enableSplit = true
    61.         }
    62.     }
    63.    
    64.     packagingOptions {
    65.         exclude('META-INF/kotlinx_coroutines_core.version')
    66.     }
    67.    
    68. }**SPLITS_VERSION_CODE****LAUNCHER_SOURCE_BUILD_SETUP**
    69.  
    But this does not work for .apk build. I'm still looking for a solution for apk files.
     
  30. securegames123

    securegames123

    Joined:
    Jun 30, 2020
    Posts:
    12
    Here is the code, it should work for aab and apk as well
    Code (CSharp):
    1. apply plugin: 'com.android.application'
    2.  
    3. dependencies {
    4.     implementation project(':unityLibrary')
    5.     }
    6.  
    7. android {
    8.     compileSdkVersion **APIVERSION**
    9.     buildToolsVersion '**BUILDTOOLS**'
    10.  
    11.     compileOptions {
    12.         sourceCompatibility JavaVersion.VERSION_1_8
    13.         targetCompatibility JavaVersion.VERSION_1_8
    14.     }
    15.  
    16.     defaultConfig {
    17.         minSdkVersion **MINSDKVERSION**
    18.         targetSdkVersion **TARGETSDKVERSION**
    19.         applicationId '**APPLICATIONID**'
    20.         ndk {
    21.             abiFilters **ABIFILTERS**
    22.         }
    23.         versionCode **VERSIONCODE**
    24.         versionName '**VERSIONNAME**'
    25.     }
    26.  
    27.     aaptOptions {
    28.         noCompress = **BUILTIN_NOCOMPRESS** + unityStreamingAssets.tokenize(', ')
    29.         ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~"
    30.     }**SIGN**
    31.  
    32.     lintOptions {
    33.         abortOnError false
    34.     }
    35.  
    36.     buildTypes {
    37.         debug {
    38.             minifyEnabled **MINIFY_DEBUG**
    39.             proguardFiles getDefaultProguardFile('proguard-android.txt')**SIGNCONFIG**
    40.             jniDebuggable true
    41.         }
    42.         release {
    43.             minifyEnabled **MINIFY_RELEASE**
    44.             proguardFiles getDefaultProguardFile('proguard-android.txt')**SIGNCONFIG**
    45.         }
    46.     }**PACKAGING_OPTIONS****PLAY_ASSET_PACKS****SPLITS**
    47.  
    48.     packagingOptions {
    49.  
    50.            exclude('META-INF/kotlinx_coroutines_core.version')
    51.  
    52.     }
    53.  
    54. **BUILT_APK_LOCATION**
    55.     bundle {
    56.         language {
    57.             enableSplit = false
    58.         }
    59.         density {
    60.             enableSplit = false
    61.         }
    62.         abi {
    63.             enableSplit = true
    64.         }
    65.     }
    66. }**SPLITS_VERSION_CODE****LAUNCHER_SOURCE_BUILD_SETUP**
     
    Wanderer13 likes this.
  31. chikchik

    chikchik

    Joined:
    Nov 29, 2012
    Posts:
    3
    Unfortunately, it doesn't work for apk build
     
  32. el_Guero

    el_Guero

    Joined:
    Sep 15, 2017
    Posts:
    186
    I solved it by reverting back to an old MAX and old GA version. Both latest versions of their respective plugin triggered that error for me. Maybe that helps someone.
     
  33. arossini-rortos

    arossini-rortos

    Joined:
    Oct 29, 2021
    Posts:
    19
    Can you clarify what MAX and GA are?



    Same for me. The only way I found to build an apk is to delete one of the 2 .jar that are triggering the error. But this is not actually a fix.
    I'm still waiting for an official answer from Unity on how to handle this.
    @yunanhou, do you have some news about this topic?
     
  34. minhhungphan9

    minhhungphan9

    Joined:
    Dec 11, 2022
    Posts:
    1
    @el_Guero I have similar problem about org.jetbrains.kotlin:kotlin-bom:1.8.10 too. And according to my research, this could be related to the internet? Like if the dependencies are downloading from the internet, and they moved their website or something. We have to manually download it. I just don't know how to set up the kotlin file (in our gradle? or environment path?), since I am new to mobile environment in unity2D. (just my personal idea and I still haven't solved it yet)

    Edit: and what project template did you use? 2D or 2D Mobile?
    Edit2: I changed to 2D template and imported my 2D mobile project into it, then swapped to android. Then adjust some player settings. And resolution succeeds. (I am using LevelPlay and skip any unity ads package installation pop-up)
     
    Last edited: Sep 30, 2023
  35. Vahe200312

    Vahe200312

    Joined:
    Jul 26, 2018
    Posts:
    4
    Hi, I'm experiencing the same problem. I'm using Applovin MAX, Unity version 2022.3.10f1. The errors started happening after I updated all the network sdk versions. Currently enabling Custom Gradle Settings Template, Custom Gradle Properties Template and Custom Main Gradle Template without changing anything seems to resolve the issue. Excluding 'META-INF/kotlinx_coroutines_core.version' also helps.
     
  36. victornor

    victornor

    Joined:
    Jan 17, 2014
    Posts:
    91
    This is a OneSignal 5x issue. Deleting the coroutines libs allows me to build, but then the application crashes when calling OneSignal.Initialize();
     
  37. arossini-rortos

    arossini-rortos

    Joined:
    Oct 29, 2021
    Posts:
    19
    As I wrote above, the issue is not strictly related to OneSignal. Furthermore it could happen even using OneSignal 3.X.
    I guess the problem is still hidden and unresolved.
    The worst part is that Unity is completly disappeared from the discussion.
     
  38. Marnelle

    Marnelle

    Joined:
    Apr 14, 2015
    Posts:
    17
    This code doesn't work for me
    Code (CSharp):
    1.     packagingOptions {
    2.  
    3.                exclude('META-INF/kotlinx_coroutines_core.version')
    4.  
    5.         }
    6.  
    These lines work for me in Unity 2022.3.10f1
    Code (CSharp):
    1. packaging {
    2.         resources {
    3.             pickFirst += "META-INF/kotlinx_coroutines_core.version"
    4.         }
    5.     }
    But I get another error now
    Code (CSharp):
    1. [SafeDK-ERROR] Android variants not detected.
    2. Please make sure you place the directive:
    3. apply plugin: 'applovin'
    4. after you apply the Android plugin in your build.gradle file
     
  39. doubletapsoft

    doubletapsoft

    Joined:
    Sep 23, 2013
    Posts:
    32
    We are having the issue after installing the latest AdMob SDK in the AppLovin MAX integration manager.
     
  40. Marnelle

    Marnelle

    Joined:
    Apr 14, 2015
    Posts:
    17
    TuKeKGames and doubletapsoft like this.
  41. arossini-rortos

    arossini-rortos

    Joined:
    Oct 29, 2021
    Posts:
    19
    The issue regarding packaging option is going worst and worst the more you update ads packages into the project.

    Now I have a collision with

    org.jetbrains.kotlinx.kotlinx-coroutines-core-1.7.1
    org.jetbrains.kotlinx.kotlinx-coroutines-core-jvm-1.7.1

    org.jetbrains.kotlinx.kotlinx-serialization-json-1.4.1
    org.jetbrains.kotlinx.kotlinx-serialization-json-jvm-1.4.1

    com.squareup.okio.okio-3.0.0
    com.squareup.okio.okio-jvm-3.0.0

    Building .aab seems to work fine.
    Building .apk is always failing, no matter which packaging option we add/remove.

    Do you know if launcherTemplate.gradle file is actually used when building an apk?
    It seems to me that there is no way to specify packaging option for apk builds.
     
    Last edited: Oct 6, 2023
  42. Kek_Chpeck

    Kek_Chpeck

    Joined:
    Feb 9, 2019
    Posts:
    16
    Solution that works for me:
    Add this to both
    launcherTemplate.gradle
    and
    mainTemplate.gradle


    Code (CSharp):
    1. packagingOptions {
    2.            exclude('META-INF/kotlinx_coroutines_core.version')
    3.     }

    EDIT: It's better to use pickFirst('META-INF/kotlinx_coroutines_core.version') to keep your apk/aab consistent.

    There is a topic, where this problem is described in details: https://stackoverflow.com/questions...jvm-vs-kotlinx-coroutines-c/77264967#77264967
     
    Last edited: Oct 10, 2023
  43. juxy83

    juxy83

    Joined:
    Sep 26, 2015
    Posts:
    2
    I had this bug with Unity 2022.3.11f1 and LevelPlay 7.5.1! I have fixed it by simply removing Vungle!
     
  44. yuriythebest

    yuriythebest

    Joined:
    Nov 21, 2009
    Posts:
    1,133
    Hi! I'm having the same issue where if I add anything more than unityads+chartboost in the Ironsource Integration manager, I get kotlinx related errors during build.

    - where are the
    launcherTemplate.gradle
    and
    mainTemplate.gradle
    located in the unity project? Does this mean for each project I now need to build it as gradle first, edit, and continue the build? isn't there a better/easier way since this is unity's "official" ad solution?
     
  45. Kek_Chpeck

    Kek_Chpeck

    Joined:
    Feb 9, 2019
    Posts:
    16
    In general, every your Android project is built with gradle. You have no option to not use the gradle. The option you have is to manually edit gradle scripts or not. To manually edit gradle files you have to go to
    Edit > ProjectSettings > Player > Android > PublishingSettings
    and mark files you want to edit. There are
    "Custom Launcher Gradle Template"
    and
    "Custom Main Gradle Template"
    there. When you enable these points, corresponding files will be added to your
    Assets/Plugins/Android
    folder
     
  46. yuriythebest

    yuriythebest

    Joined:
    Nov 21, 2009
    Posts:
    1,133

    thanks Kek_Chpeck! I did the steps and now it builds!
    allStuff.jpg


    However, when launching the APK I again get NoClassDefFoundError errors

    errors2.jpg
    Code (CSharp):
    1. 2023-10-30 12:13:31.457 29122-29159/? E/Unity: setUnityBannerLevelPlayListener method doesn't exist, error: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/ironsource/mediationsdk/sdk/InitializationListener;
    2.    IronSourceBannerEvents:Awake()
    3.    UnityEngine.GameObject:.ctor(String, Type[])
    4.    IronSource:.ctor()
    5.    IronSource:get_Agent()
    6.    InterstitialIntegration:Start()
    7. 2023-10-30 12:13:31.457 29122-29159/? I/zygote64: Rejecting re-init on previously-failed class java.lang.Class<com.ironsource.unity.androidbridge.AndroidBridge>: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/ironsource/mediationsdk/sdk/InitializationListener;
    8. 2023-10-30 12:13:31.457 29122-29159/? I/zygote64: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.ironsource.mediationsdk.sdk.InitializationListener" on path: DexPathList[[zip file "/data/app/com.bgs.stickman.airplane-cm2Pz0ZfMM_V0p56tB8TzQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.bgs.stickman.airplane-cm2Pz0ZfMM_V0p56tB8TzQ==/lib/arm64, /data/app/com.bgs.stickman.airplane-cm2Pz0ZfMM_V0p56tB8TzQ==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]
    9. 2023-10-30 12:13:31.457 29122-29159/? I/zygote64: Rejecting re-init on previously-failed class java.lang.Class<com.ironsource.unity.androidbridge.AndroidBridge>: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/ironsource/mediationsdk/sdk/InitializationListener;
    10. 2023-10-30 12:13:31.458 29122-29159/? I/zygote64: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.ironsource.mediationsdk.sdk.InitializationListener" on path: DexPathList[[zip file "/data/app/com.bgs.stickman.airplane-cm2Pz0ZfMM_V0p56tB8TzQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.bgs.stickman.airplane-cm2Pz0ZfMM_V0p56tB8TzQ==/lib/arm64, /data/app/com.bgs.stickman.airplane-cm2Pz0ZfMM_V0p56tB8TzQ==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]
    11. 2023-10-30 12:13:31.461 29122-29159/? E/Unity: AndroidJavaException: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/ironsource/mediationsdk/sdk/InitializationListener;
    12.    java.lang.NoClassDefFoundError: Failed resolution of: Lcom/ironsource/mediationsdk/sdk/InitializationListener;
    13.        at com.unity3d.player.UnityPlayerForActivityOrService.nativeRender(Native Method)
    14.        at com.unity3d.player.L.handleMessage(Unknown Source:140)
    15.        at android.os.Handler.dispatchMessage(Handler.java:101)
    16.        at android.os.Looper.loop(Looper.java:164)
    17.        at com.unity3d.player.O.run(Unknown Source:24)
    18.     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.ironsource.mediationsdk.sdk.InitializationListener" on path: DexPathList[[zip file "/data/app/com.bgs.stickman.airplane-cm2Pz0ZfMM_V0p56tB8TzQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.bgs.stickman.airplane-cm2Pz0ZfMM_V0p56tB8TzQ==/lib/arm64, /data/app/com.bgs.stickman.airplane-cm2Pz0ZfMM_V0p56tB8TzQ==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]
    19.         at dalvik.system.BaseDexClassLoader.findC
    20. 2023-10-30 12:13:34.914 29122-29159/? I/zygote64: Rejecting re-init on previously-failed class java.lang.Class<com.ironsource.unity.androidbridge.AndroidBridge>: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/ironsource/mediationsdk/sdk/InitializationListener;
    21. 2023-10-30 12:13:34.914 29122-29159/? I/zygote64: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.ironsource.mediationsdk.sdk.InitializationListener" on path: DexPathList[[zip file "/data/app/com.bgs.stickman.airplane-cm2Pz0ZfMM_V0p56tB8TzQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.bgs.stickman.airplane-cm2Pz0ZfMM_V0p56tB8TzQ==/lib/arm64, /data/app/com.bgs.stickman.airplane-cm2Pz0ZfMM_V0p56tB8TzQ==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]
    22. 2023-10-30 12:13:34.914 29122-29159/? I/zygote64: Rejecting re-init on previously-failed class java.lang.Class<com.ironsource.unity.androidbridge.AndroidBridge>: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/ironsource/mediationsdk/sdk/InitializationListener;
    23. 2023-10-30 12:13:34.914 29122-29159/? I/zygote64: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.ironsource.mediationsdk.sdk.InitializationListener" on path: DexPathList[[zip file "/data/app/com.bgs.stickman.airplane-cm2Pz0ZfMM_V0p56tB8TzQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.bgs.stickman.airplane-cm2Pz0ZfMM_V0p56tB8TzQ==/lib/arm64, /data/app/com.bgs.stickman.airplane-cm2Pz0ZfMM_V0p56tB8TzQ==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]
    24. 2023-10-30 12:13:34.917 29122-29159/? E/Unity: AndroidJavaException: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/ironsource/mediationsdk/sdk/InitializationListener;
    25.     java.lang.NoClassDefFoundError: Failed resolution of: Lcom/ironsource/mediationsdk/sdk/InitializationListener;
    26.         at com.unity3d.player.UnityPlayerForActivityOrService.nativeRender(Native Method)
    27.         at com.unity3d.player.L.handleMessage(Unknown Source:140)
    28.         at android.os.Handler.dispatchMessage(Handler.java:101)
    29.         at android.os.Looper.loop(Looper.java:164)
    30.         at com.unity3d.player.O.run(Unknown Source:24)
    31.      Caused by: java.lang.ClassNotFoundException: Didn't find class "com.ironsource.mediationsdk.sdk.InitializationListener" on path: DexPathList[[zip file "/data/app/com.bgs.stickman.airplane-cm2Pz0ZfMM_V0p56tB8TzQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.bgs.stickman.airplane-cm2Pz0ZfMM_V0p56tB8TzQ==/lib/arm64, /data/app/com.bgs.stickman.airplane-cm2Pz0ZfMM_V0p56tB8TzQ==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]
    32.        at dalvik.system.BaseDexClassLoader.findC
    33.  

    EDIT: ALso, now when I try to resolve /force resolve mobile dependencies, it says "resolution succeeded" but there is nothing added? is this on purpose?

    resolve5.jpg
     
    Last edited: Oct 30, 2023
    won-gyu likes this.
  47. Kek_Chpeck

    Kek_Chpeck

    Joined:
    Feb 9, 2019
    Posts:
    16
    I'm afraid this is not the theme of this topic. But anyway check External Dependency Resolver warnings. It could ask enable some other gradle templates, when you enable main or launcer templates. I do not clearly remember, and can't check right now, but it, porbably, want you to enable Custom Gradle Properties Template. After you do, It will add your dependencies as build-time dependencies to gradle files instead of downloading them and put to Android/Plugin.
     
  48. unity_DgdF0NVOPLUNAQ

    unity_DgdF0NVOPLUNAQ

    Joined:
    Oct 9, 2021
    Posts:
    2
    @Vahe200312 thanks its work for me I am using Unity 2023.1.17 with Applovin MAX mediation
     
    Jylxi likes this.
  49. VipMath171

    VipMath171

    Joined:
    Aug 2, 2017
    Posts:
    1
    I fixed it just by enable MainGradleTemplate, Launcher Gradle Template and Gradle Properties Template . Unity 22.3.12f1
     
    ShantiB95, Botu, Gilvius-gls and 2 others like this.
  50. rrudmanis

    rrudmanis

    Joined:
    Jan 29, 2014
    Posts:
    1
    Fixed by adding
    packagingOptions {
    pickFirst('META-INF/kotlinx_coroutines_core.version')
    }
    to both launcherTemplate.gradle and mainTemplate.gradle
     
    stellamocha and Jylxi like this.