naoufal / react-native-payments

Accept Payments with Apple Pay and Android Pay using the Payment Request API.
https://www.npmjs.com/package/react-native-payments
1.59k stars 413 forks source link

Android Build Error #407

Open SE-Umee opened 6 months ago

SE-Umee commented 6 months ago

Hi, I am getting this error while building the app on Android. How can I fix this? Note Build Tools version is (30.0.3)

Configure project :notifee_react-native :notifee_react-native @notifee/react-native found at /Users/se-umee/Desktop/apps/Motmaena_App/node_modules/@notifee/react-native :notifee_react-native package.json found at /Users/se-umee/Desktop/apps/Motmaena_App/node_modules/@notifee/react-native/package.json :notifee_react-native:version set from package.json: 7.8.2 (7,8,2 - 7008002) :notifee_react-native:android.compileSdk using custom value: 33 :notifee_react-native:android.targetSdk using custom value: 33 :notifee_react-native:android.minSdk using custom value: 21 :notifee_react-native:reactNativeAndroidDir /Users/se-umee/Desktop/apps/Motmaena_App/node_modules/react-native/android WARNING:The specified Android SDK Build Tools version (28.0.3) is ignored, as it is below the minimum supported version (30.0.3) for Android Gradle Plugin 7.4.2. Android SDK Build Tools 30.0.3 will be used. To suppress this warning, remove "buildToolsVersion '28.0.3'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/8.0.1/userguide/command_line_interface.html#sec:command_line_warnings 5 actionable tasks: 5 up-to-date

info 💡 Tip: Make sure that you have set up your development environment correctly, by running react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor

FAILURE: Build failed with an exception.

BUILD FAILED in 9s error Failed to install the app. info Run CLI with --verbose flag for more details.

![Uploading Screenshot 2024-05-18 at 10.19.33 AM.png…]()

ali5049 commented 2 months ago

In node_modules/react-native-payments/android/src/main/java/com/reactnativepayments/ReactNativePaymentsModule.java

Search and change all the android.support to androidx

for example android.support.annotation Becomes androidx.annotation

Then by using patch-package you can make a patch After making the changes, save them and then run this command: npx patch-package react-native-payments