Reputation: 163
Im trying to run a react-native project on the android emulator from Android Studio. However whenever I run npx expo run:android I get a few errors:
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.
I've tried many different post suggestions, cleaning the gradle, adjusting the versions, and much more to no avail.
It might be worth mentioning that IOS runs completely fine.
Upvotes: 1
Views: 2312
Reputation: 430
Error: The Kotlin Gradle plugin was loaded multiple times in different subprojects.
ext
{
kotlinVersion = findProperty('android.kotlinVersion') ?: '1.9.10'
}
and Inside dependencies section paste
dependencies
{
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"`
}
NOTE: Kotlin version change as per your requirements.
I hope it works for you!!!!!
Upvotes: 0
Reputation: 163
Just figured this out. My Namespace in android -> app -> build.gradle was somehow SLIGHTLY different then the other package names. Make sure these all are the same.
Upvotes: 1