Todd Codes
Todd Codes

Reputation: 21

React-native: Can't build the android app

I am a newbie, just started dipping my toe in react-native. The first hello world app did run okay, as I started the second one I am getting this error:

:app:transformClassesWithDexForDebug FAILED

FAILURE: Build failed with an exception.

*What went wrong:
Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: java.lang.RuntimeException:java.lang.RuntimeException:com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException

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

BUILD FAILED

Total time: 14.034 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html

Upvotes: 2

Views: 308

Answers (1)

Renan C. Araujo
Renan C. Araujo

Reputation: 902

It looks like your app is now multidex, you can learn mor about here

To solve this, just enable multidexing on build.gradle:

defaultConfig {
        ...
        minSdkVersion 14
        targetSdkVersion 21
        ...

        // Enabling multidex support.
        multiDexEnabled true
    }

Upvotes: 1

Related Questions