我试图在Android Studio的Android模拟器上运行一个react-native项目。然而,每当我运行npx expo run:android时,我都会得到一些错误:
The Kotlin Gradle plugin was loaded multiple times in different subprojects, which is not supported and may break the build.
This might happen in subprojects that apply the Kotlin plugins with the Gradle 'plugins { ... }' DSL if they specify explicit versions, even if the versions are equal.
Please add the Kotlin plugin to the common parent project or the root project, then remove the versions in the subprojects.
If the parent project does not need the plugin, add 'apply false' to the plugin line.
See: https://docs.gradle.org/current/userguide/plugins.html#sec:subprojects_plugins_dsl
The Kotlin plugin was loaded in the following projects: ':expo', ':expo-av', ':react-native-gesture-handler', ':react-native-safe-area-context', ...
> Task :app:compileDebugJavaWithJavac FAILED
error: cannot find symbol
return BuildConfig.DEBUG;
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
字符串
我尝试了许多不同的帖子建议,清理gradle,调整版本,还有更多的无济于事。
值得一提的是,IOS运行完全正常。
1条答案
按热度按时间vyswwuz21#
我刚想明白。我在android -> app -> build.gradle中的命名空间与其他包名略有不同。确保这些都是一样的。