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 : Home · twitter-archive/twitter-kit-unity Wiki · GitHub

Follow the instructions and you are good to go. I was able to gradle build without error.

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!

Try this: check if your project folder has more than one AndroidManifest.xml, just keep only 1 manifest file and rebuild.