DEV Community

Nour Abdou
Nour Abdou

Posted on • Edited on

2 1

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 😌

Sentry mobile image

Is your mobile app slow? Improve performance with these key strategies.

Improve performance with key strategies like TTID/TTFD & app start analysis.

Read the blog post

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay