Today we are going to learn how to fix an error that occurs when creating a new project with Expo and TypeScript.
This error is:
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
This error usually occurs because the package name is different between app/build.gradle and our expo project in app.json.
We need to open app/build.gradle and set the project with the correct name, applicationId should match namespace:
And it should work correctly now.