Just tried out Unity 6.0 and surprisingly, upgrading the Unity version didn’t completely break down things! Managed to get the iOS build working on device!
However, didn’t get the same success with Android build!
On building the android platform, build fails with following grade error:
What went wrong:
A problem occurred evaluating project ‘:launcher’.
Failed to apply plugin ‘com.android.internal.application’.
The option ‘android.enableDexingArtifactTransform’ is deprecated.
The current default is ‘true’.
It was removed in version 8.3 of the Android Gradle plugin.
If you run into issues with dexing transforms, try setting android.useFullClasspathForDexingTransform = true instead.
Apparently the Unity 6 uses gradle 8.4 and it seems to be not compatible with certain package. I tried the recommendation in the error message without any luck. Wonder if manually downgrading the gradle could solve the issue?
Actually, this is not solving my problem, still I am getting gradle failed error after adding this line in gradle.porperties A problem occurred evaluating project ':launcher'. > Failed to apply plugin 'com.android.internal.application'. > com.android.builder.errors.EvalIssueException: The option 'android.enableDexingArtifactTransform' is deprecated. The current default is 'true'. It was removed in version 8.3 of the Android Gradle plugin. If you run into issues with dexing transforms, try setting android.useFullClasspathForDexingTransform = true instead.
To everyone, this indeed is a very simple problem to fix for the Unity Team.
check update below for easier solution
I actually managed to make it work by Exporting Android Project instead of making an Android Build. And, then going to the gradle file, and manually fixing by making the change as written in the error message.
There is a line android.enableDexing… that needs to be disabled. Then, you insert another line instead of that android.useFullClasspath… (See the error log in my first post to see the exact lines without any spelling mistake).
You can actually create a PostBuild Script to automate this every time you export an android project. Then, you need to install Android Studio and I can confirm that I was able to build apk file with android studio from the exported project.
In fact, Unity also uses Android NDK to build your project after the first step of building android project. Just in an automated way so we don’t have this additional trouble. But, good thing is that the two manual build steps (unity then Android Studio) is actually quite fast..
All that Unity Team needs to do is to incorporate these changes when building the android project and before running the android NDK on it.
Hope that helps.
UPDATE:
There is an easier way to do the above without exporting Android Project. In Project Settings, enable custom gradle template. then, you will find a gradleTemplate.properties file in your Assets/Plugins/Android folder.
You can just add this line in this file: android.useFullClasspathForDexingTransform=true
I tried this solution. Still get the same error. Using Unity 6 as well. Any other suggestions?
Did you try exporting the project for Android Studio? That method should work better than "the easier" way I suggested. In Build window, select "export project". This will create an Android Studio project in the folder you select
Not able to use Android Resolver either in Unity 6.
Starting a Gradle Daemon (subsequent builds will be faster)java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
Finally fixed the issue for my case. I had it since yesterday, and no matter what I did I couldn’t get it to build for Android. Clean Library completely, remove and install IAP and a few other possible assets, changed the line that’s given in the error report, but it would always get overridden.
In the end I found that the deprecated code is called in another 4 places aside form the gradleTemplate.properties
So I changed it all from android.enableDexingArtifactTransform=false
to android.useFullClasspathForDexingTransform=true
Unity is not adding enableDexingArtifactTransform, the issue might be caused by a third-party plugin and EDM4U. Could you please share with us which plugins are you using so that we can report it to the developer?
I assume you tried adding android.useFullClasspathForDexingTransform = true to the gradle.properties file as it recommends, am I right?
com.google.external-dependency-manager-1.2.179.tgz Apart from that, most important plugins are related to firebase
I'm getting the same error and I'm not using any plugins. I tried adding android.useFullClasspathForDexingTransform=true to the gradle.properties file also.
Hey guys did you figure out the issue, i am having it too. stuck with it for days, dont know what to do please help. i also tried to add the line inside gradle.properties buy did not work still got the issue
Try exporting Android Project. Then build in Android Studio.. after replacing the lines in gradle.properties as suggested in the solution. Try compile using Android Studio not Unity! Worth a try
I have tried all the above mentioned solutions, none of them worked..
Finally I got it working just by moving my project to internal storage from external storage.
Weird
I have the same problem! Is there a solution to this problem?
– unitydeveloper18Is there a way to find out the offending package? I'm running into this issue as well.
– dustin_trippActually, this is not solving my problem, still I am getting gradle failed error after adding this line in gradle.porperties A problem occurred evaluating project ':launcher'. > Failed to apply plugin 'com.android.internal.application'. > com.android.builder.errors.EvalIssueException: The option 'android.enableDexingArtifactTransform' is deprecated. The current default is 'true'. It was removed in version 8.3 of the Android Gradle plugin. If you run into issues with dexing transforms, try setting
– karthick221405android.useFullClasspathForDexingTransform = trueinstead.Did you ever resolve this?
– MackNugget