react-native-iap icon indicating copy to clipboard operation
react-native-iap copied to clipboard

Task :react-native-iap:compilePlayDebugKotlin FAILED

Open MuhammadRafeh opened this issue 2 years ago • 4 comments
trafficstars

Please use the Discussion board if you want to get some help. Please use issues to report bugs.

Description

Expected Behavior

Screenshots

Envir Screenshot 2023-08-20 at 8 47 32 PM onment:

  • react-native-iap:
  • react-native:
  • Platforms (iOS, Android, emulator, simulator, device):

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Press '...'
  3. Error '...' is shown

[Optional] Additional Context

MuhammadRafeh avatar Aug 20 '23 15:08 MuhammadRafeh

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:

  1. create folder named patches on the root of your RN project
  2. under patches folder create a file react-native-iap+12.10.7.patch and pase code below
  3. 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 avatar Aug 20 '23 16:08 ahmedrowaihi

@ahmedrowaihi Brother I simply updated the kotlin version to "1.8.0" in project/build.gradle and it worked :)

MuhammadRafeh avatar Aug 20 '23 18:08 MuhammadRafeh

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" }

MuhammadRafeh avatar Aug 20 '23 18:08 MuhammadRafeh

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 :'(

ahmedrowaihi avatar Aug 21 '23 01:08 ahmedrowaihi