reactjs 从Expo托管工作流中弹出后,Android构建失败

jei2mxaa  于 2023-04-05  发布在  React
关注(0)|答案(1)|浏览(117)
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-modules-core'

> Task :app:compileDebugJavaWithJavac FAILED
/Users/rahulkumar/Documents/learning-react-native/FavouritePlaces/android/app/src/main/java/com/rahulkumarmbd/FavouritePlaces/MainApplication.java:26: error: cannot find symbol
        return BuildConfig.DEBUG;
               ^
  symbol: variable BuildConfig
/Users/rahulkumar/Documents/learning-react-native/FavouritePlaces/android/app/src/main/java/com/rahulkumarmbd/FavouritePlaces/MainApplication.java:45: error: cannot find symbol
        return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
               ^
  symbol: variable BuildConfig
/Users/rahulkumar/Documents/learning-react-native/FavouritePlaces/android/app/src/main/java/com/rahulkumarmbd/FavouritePlaces/MainApplication.java:50: error: cannot find symbol
        return BuildConfig.IS_HERMES_ENABLED;
               ^
  symbol: variable BuildConfig
/Users/rahulkumar/Documents/learning-react-native/FavouritePlaces/android/app/src/main/java/com/rahulkumarmbd/FavouritePlaces/MainApplication.java:63: error: cannot find symbol
    if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
        ^
  symbol:   variable BuildConfig
  location: class MainApplication
/Users/rahulkumar/Documents/learning-react-native/FavouritePlaces/android/app/src/main/java/com/rahulkumarmbd/FavouritePlaces/MainActivity.java:19: error: package R does not exist
    setTheme(R.style.AppTheme);
              ^
/Users/rahulkumar/Documents/learning-react-native/FavouritePlaces/android/app/src/main/java/com/rahulkumarmbd/FavouritePlaces/MainActivity.java:39: error: cannot find symbol
    return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED, new DefaultReactActivityDelegate(
                                                  ^
  symbol:   variable BuildConfig
  location: class MainActivity
6 errors

我正在运行这个命令expo run:android在弹出后,我希望它能够成功。我已经尝试了多种方法,这是由聊天GPT建议的。喜欢将其添加到build.gradle中

plugins {
    id 'org.jetbrains.kotlin.jvm' version '1.6.10'
    // other plugins...
}
sd2nnvve

sd2nnvve1#

这个问题是由于namespace在android的android/app/build.gradle文件,它是别的东西,即myfavouriteplaces,并期待这一点,在此之后,我能够解决这个问题
com.rahulkumarmbd.FavouritePlaces

相关问题