2017-03-08 73 views
2

我是一名新手,刚刚开始将我的脚趾浸入反应原生。在第一个Hello World应用程序并运行没关系,我开始了第二个我收到此错误:React-native:无法构建Android应用程序

: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

它看起来像你的应用程序现在multidex,你可以了解铁道部有关here

为了解决这个问题,只是启用多重索引build.gradle

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

     // Enabling multidex support. 
     multiDexEnabled true 
    } 
+0

这并没有解决它。 :( –

相关问题