DEV Community

Nour Abdou
Nour Abdou

Posted on • Updated on

Solution of "Could not resolve all artifacts for configuration ':react-native-iap:classpath'"

Error

Issue Scenario:

After updating react-native-iap to resolve this issue on google play:
We've detected that this app uses an unsupported version of Play Billing. Please upgrade to Billing Library version 4 or newer to publish this app

The following error will raised for old RN version:
Could not resolve all artifacts for configuration ':react-native-iap:classpath'.
Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0.

Solution

1- Add the following to android/build.gradle

buildscript {
    ext {
        ...
        kotlinVersion = '1.5.0' //<-- add this
    }
    ...
    dependencies {
       ...
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" //<-- add this

    }
}
Enter fullscreen mode Exit fullscreen mode

2- To prevent app:debugRuntimeClasspath error

add this line to android/app/build.gradle

android {
    ...
    defaultConfig {
        ...
        missingDimensionStrategy ('store', 'play') //<-- add this
    }
    ...
}
Enter fullscreen mode Exit fullscreen mode

If the following error raised:

Execution failed for task ':react-native-iap:compilePlayDebugKotlin'. >Compilation error.
change kotlinVersion in step-1.

Happy Coding 😍
Happy Building 😌

Top comments (0)