- Home /
Gradle build error with Twitter Fabric
I am running into CommandInvokationFailure: Gradle build failed.
stderr[ C:\Users\User\Documents\Unity Games\BoilerplateServices\Temp\gradleOut\src\main\AndroidManifest.xml:9:
Error: Avoid hardcoding the debug mode; leaving it out allows debug and release builds to automatically assign one [HardcodedDebugMode]
android:name="io.fabric.unity.android.FabricApplication" android:icon="@drawable/app_icon" android:label="@string/app_name" android:theme="@style/UnityThemeSelector" android:debuggable="false" android:isGame="true" android:banner="@drawable/app_banner">
====================================================================================
SOLUTION AS OF JULY 14TH
Remove ALL of the fabric plugin. Replace with twitterKit : https://dev.twitter.com/twitterkit/unity/installation
Follow the instructions and you are good to go. I was able to gradle build without error.
I think I the error has something to do with this specifically.
I may have isolated $$anonymous$$e:
I'm not sure but I think there is either a missing file: android:icon, android:label, android:theme. And that android debuggable is conflicting somewhere.
I cannot seem to pinpoint where the manifest in fabric(twitter) stores these.
The only fix that I have found is you must remove ALL of fabric and reinstall their Other plugin twitter$$anonymous$$it. https://dev.twitter.com/twitterkit/unity/installation
Answer by alex181189 · Jul 10, 2017 at 10:11 AM
The same happens to me.
CommandInvokationFailure: Gradle build failed. /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/bin/java -classpath "/Applications/Unity/PlaybackEngines/AndroidPlayer/Tools/gradle/lib/gradle-launcher-2.14.jar" org.gradle.launcher.GradleMain "assembleRelease"
stderr[ ../Temp/gradleOut/src/main/AndroidManifest.xml:6: Error: Avoid hardcoding the debug mode; leaving it out allows debug and release builds to automatically assign one [HardcodedDebugMode]
~~~~~~~~~~~~~~~~~~~~~~~~~~
Explanation for issues of type "HardcodedDebugMode": It's best to leave out the android:debuggable attribute from the manifest. If you do, then the tools will automatically insert android:debuggable=true when building an APK to debug on an emulator or device. And when you perform a release build, such as Exporting APK, it will automatically set it to false.
If on the other hand you specify a specific value in the manifest file, then the tools will always use it. This can lead to accidentally publishing your app with debug information.
1 errors, 0 warnings
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':transformClassesWithDexForRelease'.
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lio/fabric/unity/android/BuildConfig;
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. ] stdout[ Incremental java compilation is an incubating feature. :preBuild UP-TO-DATE . . :transformClassesWithDexForRelease FAILED
thanks!
$$anonymous$$y code was a 9 where yours is a 6. I don't know what that means unfortunately. I think I may be missing a file that the outgoing android manifest is looking for.
Hey, I didn't have the required karma in order to comment on the other post.
This solution looks like it could help a lot. I'm not sure what you are changing around where. Would it be possible for you to give some more specific directions on the other post?
Seems like a good solution, could you guide me better? I'm a little lost, I'm using the latest version of unity 2017.1.0f3 Thank you!
Answer by teexiii · Jan 07, 2018 at 04:47 PM
Try this: check if your project folder has more than one AndroidManifest.xml, just keep only 1 manifest file and rebuild.
Your answer
Follow this Question
Related Questions
Android build crashes on start up. 2 Answers
How to increase number of supported devices when publishing to the google play store 0 Answers
CommandInvokationFailure: Gradle build failed. unity 2019.4.22 1 Answer
com.android.tools.r8 compilation error please help 0 Answers
multiple apks to match certain devices 0 Answers