react-native-iap
react-native-iap copied to clipboard
Task :react-native-iap:compilePlayDebugKotlin FAILED
Please use the Discussion board if you want to get some help. Please use issues to report bugs.
Description
Expected Behavior
Screenshots
Envir
onment:
- react-native-iap:
- react-native:
- Platforms (iOS, Android, emulator, simulator, device):
To Reproduce Steps to reproduce the behavior:
- Go to '...'
- Press '...'
- Error '...' is shown
[Optional] Additional Context
walikom slam brother, I was having this issue a few minutes ago, I traced the last update of this library and I found out that the Kotlin version has changed due to the release of Google Play Billing Library 5.2 increase here gradle.properties#L9 on last version 12.10.7
Apply this patch to your project use patch-package
steps:
- create folder named
patcheson the root of your RN project - under
patchesfolder create a filereact-native-iap+12.10.7.patchand pase code below - run command
npx patch-package
diff --git a/node_modules/react-native-iap/android/gradle.properties b/node_modules/react-native-iap/android/gradle.properties
index e76bb7c..afc8cdd 100644
--- a/node_modules/react-native-iap/android/gradle.properties
+++ b/node_modules/react-native-iap/android/gradle.properties
@@ -6,7 +6,7 @@ RNIap_buildToolsVersion=30.0.2
RNIap_ndkversion=21.4.7075529
RNIap_playServicesVersion=18.1.0
RNIap_amazonSdkVersion=3.0.3
-RNIap_playBillingSdkVersion=5.2.1
+RNIap_playBillingSdkVersion=5.1.0
android.useAndroidX=true
android.enableJetifier=true
Then try to build your project :'D
@ahmedrowaihi Brother I simply updated the kotlin version to "1.8.0" in project/build.gradle and it worked :)
ext { buildToolsVersion = "33.0.0" minSdkVersion = 21 compileSdkVersion = 33 targetSdkVersion = 33 // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP. ndkVersion = "23.1.7779620" kotlinVersion = "1.8.0" androidXAnnotation = "1.1.0" androidXBrowser = "1.0.0" }
Nice, my project's React Native version is 0.69, and using expo modules with version 46.. So updating my kotlin version hits everywhere conflicting with others libs :'(