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:
我是一个新手,刚开始接触计算机。第一个hello world应用运行得很好,当我开始第二个应用时,我得到了这个错误:
: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
1 个解决方案
#1
1
It looks like your app is now multidex, you can learn mor about here
看起来你的应用程序现在是multidex,你可以在这里了解mor
To solve this, just enable multidexing on build.gradle
:
要解决这个问题,只需在build上启用多路复用。
defaultConfig {
...
minSdkVersion 14
targetSdkVersion 21
...
// Enabling multidex support.
multiDexEnabled true
}
#1
1
It looks like your app is now multidex, you can learn mor about here
看起来你的应用程序现在是multidex,你可以在这里了解mor
To solve this, just enable multidexing on build.gradle
:
要解决这个问题,只需在build上启用多路复用。
defaultConfig {
...
minSdkVersion 14
targetSdkVersion 21
...
// Enabling multidex support.
multiDexEnabled true
}