2

After I export my Unity project to Android Studio I cannot create release build (but it works perfectly for debug build)

I have next error: FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':transformClassesWithJarMergingForRelease'.

    com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: io/fabric/unity/android/BuildConfig.class

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

It caused by this two lines in my build.gradle file: compile project(':fabric-init') compile project(':fabric')

So, if I comment one of them it works good, but I need both of them

in 'fabric' I have io/fabric/unity/android package name in 'fabric-init' I have io/fabric/sdk/android package name

So, package names are different. So why I have an error when using both? Can someone help me, please?

1 Answer 1

1

I got the same problem and when I add "minSdkVersion 19" to build.gradle it worked for me, but this means %73.9 of Android devices can run the app.

android {
    defaultConfig {
        minSdkVersion 19
        targetSdkVersion 25
        multiDexEnabled true
    }
}
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.