gpt4 book ai didi

javascript - React-native:无法构建Android应用程序

转载 作者:行者123 更新时间:2023-11-29 23:51:36 25 4
gpt4 key购买 nike

我是一个新手,刚开始接触 react-native。第一个 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

最佳答案

看起来您的应用现在是 multidex,您可以了解更多关于 here 的信息

要解决这个问题,只需在 build.gradle 上启用 multidexing:

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

// Enabling multidex support.
multiDexEnabled true
}

关于javascript - React-native:无法构建Android应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42680212/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com