googlesamples / unity-jar-resolver

Unity plugin which resolves Android & iOS dependencies and performs version management
Other
1.21k stars 336 forks source link

[Bug] checkReleaseDuplicateClasses errors on build an AAB file with the enabled setting "Build app bundle (Google Play)" and "Split application binary" at the same time. #653

Closed dendyak closed 7 months ago

dendyak commented 7 months ago

[REQUIRED] Please describe the issue here:

In Unity when I'm trying to build an AAB file with the enabled setting "Build app bundle (Google Play)" and "Split application binary" at the same time I'm facing errors, telling me about duplicate classes. When I send a bug report to Unity, there is the link: https://issuetracker.unity3d.com/issues/error-execution-failed-for-task-launcher-checkreleaseduplicateclasses-is-thrown-when-building-with-a-build-app-bundle-google-play-and-split-application-binary-enabled-at-the-same-time

Unity said me that it is not a problem of Unity because: "this problem started to happen because we were forced to replace dependency of obsolete com.google.android.play:core package with dependency of com.google.android.play:asset-delivery. This change cannot be reverted. But it appears that Google External Dependency Manager (which is not the Unity developed tool) can't correctly resolve dependencies in this case".

EDM4U team, please can you fix this on your side?

Issue repro rate: 100%

I have a downloadable sample project that reproduces the bug: https://drive.google.com/file/d/1ixPdW3QJcO-hWfu-Vpupubt0ZmSHZs-k Repro project is just simple empty project with GoogleMobileAds 8.4.1 plugin attached and resolved by External Dependency Manager 1.2.176. Also "BUILD APP BUNDLE (GOOGLE PLAY)" and "SPLIT APPLICATION BINARY" enabled at the same time. Try to BUILD this project and you will see many "checkReleaseDuplicateClasses" errors.

It does not happens on older version of Unity (2022.2.9f1 for example), but Unity said me it is not their problem.

google-oss-bot commented 7 months ago

This issue does not seem to follow the issue template. Make sure you provide all the required information.

dendyak commented 7 months ago

to fix:

1 - clean up all aar and jar files and also their metafiles from Assets/Plugins/Android folder 2 - delete Library/Bee/Android/Prj/IL2CPP/Gradle folder 3 - open project 4 - check that Custom Main Gradle Template, Custom Gradle Settings Template, Custom Gradle Properties Template are turned on in Player settings 5 - run Assets/Eternal Dependency Manager/Android Resolver/Resolve (it should end immediately, there should be no new files in Assets/Plugins/Android appear) 6 - build AAB