2

I used google-signin-unity plugin on my game. But this issue happened when I built android apk on unity. unity version is 2022.3.16f1.

What went wrong:
Execution failed for task ':launcher:mergeDexRelease'.
A failure occurred while executing com.android.build.gradle.internal.tasks.DexMergingTaskDelegate
There was a failure while executing work items
A failure occurred while executing com.android.build.gradle.internal.tasks.DexMergingWorkAction
com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
Type com.google.googlesignin.GoogleSignInFragment$State is defined multiple times:
 >D:\project\Library\Bee\Android\Prj\IL2CPP\Gradle\unityLibrary\build.transforms\b912aa27fde5edc070cb71db7c70b335\transformed\classes\classes.dex, 
 >D:\project\Library\Bee\Android\Prj\IL2CPP\Gradle\launcher\build\intermediates\external_libs_dex\release\mergeExtDexRelease\classes.dex
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.

It seems like files in folder below are defined multiple times in another place? native-googlesignin\src\main\java\com\google\googlesignin

I have searched for fixing long time but it still no solution. (gradle and AndroidManifest file setting etc) Does anyone have any idea?

2 Answers 2

1

Go to Project settings-> Player -> Publishing Option -> Minify and select "debug" if u are still producing the game and finally when you need the official release set it to "release"

Sign up to request clarification or add additional context in comments.

Comments

0

Modify the following lines in your settingsTemplate.gradle file. These changes ensure proper functionality when using the Google Sign-In plugin

enter image description here

1 Comment

One way to improve your answer id to provide more context for links and if they're just 2 lines paste them into the answer and save a click to the readers. See the "Provide context for links" section in stackoverflow.com/help/how-to-answer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.