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 image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here β†’

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

πŸ‘‹ Kindness is contagious

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

Okay