Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when Launching Android Emulator: Could not find Kotlin Gradle Plugin #935

Open
ChrisMichaelPerezSantiago opened this issue Apr 2, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@ChrisMichaelPerezSantiago

Installed Dependencies:

"react-native": "0.72.7",
"react": "18.2.0",
"@segment/analytics-react-native": "^2.19.1",
"@segment/sovran-react-native": "^1.1.1",

This error is present when launching the android emulator

yarn android
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':segment_sovran-react-native'.
> Could not determine the dependencies of null.
   > Could not resolve all task dependencies for configuration ':segment_sovran-react-native:classpath'.
      > Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:null.
        Searched in the following locations:
          - https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/null/kotlin-gradle-plugin-null.pom
          - https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/null/kotlin-gradle-plugin-null.pom
        Required by:
            project :segment_sovran-react-native

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
@ChrisMichaelPerezSantiago ChrisMichaelPerezSantiago added the bug Something isn't working label Apr 2, 2024
@cescobaz
Copy link

cescobaz commented Apr 8, 2024

Hello, same issue here, I have react-native 0.70.8.

@JesusMaterano
Copy link

JesusMaterano commented Apr 8, 2024

Hi,

I managed to by pass this adding this to the gradle.properties

kotlinVersion=1.7.0

@cescobaz
Copy link

cescobaz commented Apr 8, 2024

I found a workaround:

org.jetbrains.kotlin:kotlin-gradle-plugin:null has null version. The lib searches for kotlin version by the following line:

File:

def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["AnalyticsReactNative_kotlinVersion"]

So it expects the version to be in the root project (the app project) or in the project (I don't know what it refers to).
The project properties it refers to I think is:

AnalyticsReactNative_kotlinVersion=1.7.0

So I set the kotlinVersion = 1.7.0 in my app project and it works!

Because I have the following in my android/build.gradle

        if (findProperty('android.kotlinVersion')) {
            kotlinVersion = findProperty('android.kotlinVersion')
        }

I changed my android/build.properties and added:

android.kotlinVersion=1.7.0

OR you can just add the version to your android/build.gradle:

buildscript {
    ext {
         kotlinVersion = '1.7.0'
         .....
    }
}

Hope it helps

@luihugo
Copy link

luihugo commented Apr 11, 2024

Faced the same issue the fixxes above work perfectly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants