Can't find and disable older versions of duplicate classes. ':launcher:checkReleaseDuplicateClasses'. error

When building to Android I get this error with a host of duplicate classes. Around 15 or so different ones. I can find the newer versions of the duplicate classes and disable them and successfully build but I believe this is causing crashes on Android 14 devices. Below is just one example:

> Duplicate class android.support.v4.app.RemoteActionCompatParcelizer found in modules core-1.1.0-runtime (androidx.core:core:1.1.0) and jetified-androidx.core.core-1.2.0-runtime (:androidx.core.core-1.2.0:)

For example in the editor I can find androidx.core.core-1.2.0 and exclude it but I can’t find androidx.core:core:1.1.0 anywhere and exclude that one instead. How can I exclude the older versions so that I can build with the newer ones?

If you’re using EDM4U, you need to enable gradle templates - main gradle template, settings gradle, gradle proprties, and force resolve again.

The above issue appears only when EDM4U downloads dependencies directly to Unity project rather than letting gradle deal with it.

Thanks for the quick reply!

I did what you said and that did fix the duplicate classes error but now I’m getting a new error. I have deleted resolved libraries and force resolved again. During the force resolve I can see these files that it says it can’t find are being resolved. I also can’t see the original .jar files that were causing the duplicate class error in my plugins/android folder any more. Also attached is a screenshot of my build settings in the project settings/player menu.


1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':launcher:mapReleaseSourceSetPaths'.
> Could not resolve all files for configuration ':launcher:releaseRuntimeClasspath'.
   > Could not find com.google.firebase:firebase-analytics-unity:10.5.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-analytics-unity/10.5.0/firebase-analytics-unity-10.5.0.pom
       - https://repo.maven.apache.org/maven2/com/google/firebase/firebase-analytics-unity/10.5.0/firebase-analytics-unity-10.5.0.pom
       - file:/C:/*******/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/libs/firebase-analytics-unity-10.5.0.jar
       - file:/C:/*******/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/libs/firebase-analytics-unity.jar
     Required by:
         project :launcher > project :unityLibrary
   > Could not find com.google.firebase:firebase-app-unity:10.5.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-app-unity/10.5.0/firebase-app-unity-10.5.0.pom
       - https://repo.maven.apache.org/maven2/com/google/firebase/firebase-app-unity/10.5.0/firebase-app-unity-10.5.0.pom
       - file:/C:*******/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/libs/firebase-app-unity-10.5.0.jar
       - file:/C:/*******/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/libs/firebase-app-unity.jar
     Required by:
         project :launcher > project :unityLibrary
   > Could not find com.google.firebase:firebase-auth-unity:10.5.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-auth-unity/10.5.0/firebase-auth-unity-10.5.0.pom
       - https://repo.maven.apache.org/maven2/com/google/firebase/firebase-auth-unity/10.5.0/firebase-auth-unity-10.5.0.pom
       - file:/C:/*******/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/libs/firebase-auth-unity-10.5.0.jar
       - file:/C:/*******/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/libs/firebase-auth-unity.jar
     Required by:
         project :launcher > project :unityLibrary
   > Could not find com.google.firebase:firebase-database-unity:10.5.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-database-unity/10.5.0/firebase-database-unity-10.5.0.pom
       - https://repo.maven.apache.org/maven2/com/google/firebase/firebase-database-unity/10.5.0/firebase-database-unity-10.5.0.pom
       - file:/C:/*******/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/libs/firebase-database-unity-10.5.0.jar
       - file:/C:/*******/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/libs/firebase-database-unity.jar
     Required by:
         project :launcher > project :unityLibrary
   > Could not find com.google.firebase:firebase-firestore-unity:10.5.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-firestore-unity/10.5.0/firebase-firestore-unity-10.5.0.pom
       - https://repo.maven.apache.org/maven2/com/google/firebase/firebase-firestore-unity/10.5.0/firebase-firestore-unity-10.5.0.pom
       - file:/C:/*******/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/libs/firebase-firestore-unity-10.5.0.jar
       - file:/C:/*******/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/libs/firebase-firestore-unity.jar
     Required by:
         project :launcher > project :unityLibrary
   > Could not find com.google.firebase:firebase-messaging-unity:10.5.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-messaging-unity/10.5.0/firebase-messaging-unity-10.5.0.pom
       - https://repo.maven.apache.org/maven2/com/google/firebase/firebase-messaging-unity/10.5.0/firebase-messaging-unity-10.5.0.pom
       - file:/C:/*******/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/libs/firebase-messaging-unity-10.5.0.jar
       - file:/C:/*******/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/libs/firebase-messaging-unity.jar
     Required by:
         project :launcher > project :unityLibrary
   > Could not find com.google.firebase:firebase-storage-unity:10.5.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-storage-unity/10.5.0/firebase-storage-unity-10.5.0.pom
       - https://repo.maven.apache.org/maven2/com/google/firebase/firebase-storage-unity/10.5.0/firebase-storage-unity-10.5.0.pom
       - file:/C:/*******/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/libs/firebase-storage-unity-10.5.0.jar
       - file:/C:/*******/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/libs/firebase-storage-unity.jar
     Required by:
         project :launcher > project :unityLibrary
   > Could not find com.google.games:gpgs-plugin-support:0.11.01.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/google/games/gpgs-plugin-support/0.11.01/gpgs-plugin-support-0.11.01.pom
       - https://repo.maven.apache.org/maven2/com/google/games/gpgs-plugin-support/0.11.01/gpgs-plugin-support-0.11.01.pom
       - file:/C:/*******/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/libs/gpgs-plugin-support-0.11.01.jar
       - file:/C:/*******/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/libs/gpgs-plugin-support.jar
     Required by:
         project :launcher > project :unityLibrary

* 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.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
java.lang.StackOverflowError (no error message)

* 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.
==============================================================================

3: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':unityLibrary:generateReleaseRFile'.
> Could not resolve all files for configuration ':unityLibrary:releaseCompileClasspath'.
   > Could not find com.google.firebase:firebase-analytics-unity:10.5.0.
     Required by:
         project :unityLibrary
   > Could not find com.google.firebase:firebase-app-unity:10.5.0.
     Required by:
         project :unityLibrary
   > Could not find com.google.firebase:firebase-auth-unity:10.5.0.
     Required by:
         project :unityLibrary
   > Could not find com.google.firebase:firebase-database-unity:10.5.0.
     Required by:
         project :unityLibrary
   > Could not find com.google.firebase:firebase-firestore-unity:10.5.0.
     Required by:
         project :unityLibrary
   > Could not find com.google.firebase:firebase-messaging-unity:10.5.0.
     Required by:
         project :unityLibrary
   > Could not find com.google.firebase:firebase-storage-unity:10.5.0.
     Required by:
         project :unityLibrary
   > Could not find com.google.games:gpgs-plugin-support:0.11.01.
     Required by:
         project :unityLibrary

What Unity version are using?

I am using 2022.3.38f1.

I also noticed taking a 2nd look through my files that a new folder was generated called GeneratedLocalRepo that contains those files it says can’t be found. They are the only thing located inside this folder.

So the initial problem was solved by creating the custom main, settings, and properties gradle templates as suggested by @Tomas1856 but it then created the secondary issue with not being able to locate my firebase plugins. That was solved by updating my firebase sdks to the latest version but the it created a 3rd problem of the app crashing on launch. If you get an app crash after following this steps you can check this post for how I ended up fixing that.