razorpay / react-native-razorpay

React Native wrapper for Razorpay's mobile SDKs
https://www.npmjs.com/package/react-native-razorpay
MIT License
124 stars 107 forks source link

Cannot build android in react native after integrating razorpay #385

Closed hemant1996 closed 2 years ago

hemant1996 commented 2 years ago

Description

Build Error on react native 0.63.3 and react 16.13.1

Razorpay Package Version :

react-native-razorpay version 2.2.8

Xcode Version (iOS) :

Razorpay-pod version (iOS) :

Java and Gradle Version (android) :

What you did:

Followed the instructions from here https://razorpay.com/docs/payment-gateway/react-native-integration/standard/android/

What happened:

After doing npm run android, getting the below error

info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1365 file(s) to forward-jetify. Using 8 workers...
info JS server already running.
info Installing the app...

> Configure project :app
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed soon. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

> Configure project :react-native-firebase_analytics
:react-native-firebase_analytics package.json found at /home/user/Desktop/Code base/myproject/node_modules/@react-native-firebase/analytics/package.json
:react-native-firebase_app package.json found at /home/user/Desktop/Code base/myproject/node_modules/@react-native-firebase/app/package.json
:react-native-firebase_analytics:firebase.bom using default value: 28.1.0
:react-native-firebase_analytics package.json found at /home/user/Desktop/Code base/myproject/node_modules/@react-native-firebase/analytics/package.json
:react-native-firebase_analytics:version set from package.json: 12.1.0 (12,1,0 - 12001000)
:react-native-firebase_analytics:android.compileSdk using custom value: 29
:react-native-firebase_analytics:android.targetSdk using custom value: 30
:react-native-firebase_analytics:android.minSdk using custom value: 21
:react-native-firebase_analytics:reactNativeAndroidDir /home/user/Desktop/Code base/myproject/node_modules/react-native/android

> Configure project :react-native-firebase_app
:react-native-firebase_app package.json found at /home/user/Desktop/Code base/myproject/node_modules/@react-native-firebase/app/package.json
:react-native-firebase_app:firebase.bom using default value: 28.1.0
:react-native-firebase_app:play.play-services-auth using default value: 19.0.0
:react-native-firebase_app package.json found at /home/user/Desktop/Code base/myproject/node_modules/@react-native-firebase/app/package.json
:react-native-firebase_app:version set from package.json: 12.1.0 (12,1,0 - 12001000)
:react-native-firebase_app:android.compileSdk using custom value: 29
:react-native-firebase_app:android.targetSdk using custom value: 30
:react-native-firebase_app:android.minSdk using custom value: 21
:react-native-firebase_app:reactNativeAndroidDir /home/user/Desktop/Code base/myproject/node_modules/react-native/android

> Configure project :react-native-firebase_auth
:react-native-firebase_auth package.json found at /home/user/Desktop/Code base/myproject/node_modules/@react-native-firebase/auth/package.json
:react-native-firebase_app package.json found at /home/user/Desktop/Code base/myproject/node_modules/@react-native-firebase/app/package.json
:react-native-firebase_auth:firebase.bom using default value: 28.1.0
:react-native-firebase_auth package.json found at /home/user/Desktop/Code base/myproject/node_modules/@react-native-firebase/auth/package.json
:react-native-firebase_auth:version set from package.json: 12.1.0 (12,1,0 - 12001000)
:react-native-firebase_auth:android.compileSdk using custom value: 29
:react-native-firebase_auth:android.targetSdk using custom value: 30
:react-native-firebase_auth:android.minSdk using custom value: 21
:react-native-firebase_auth:reactNativeAndroidDir /home/user/Desktop/Code base/myproject/node_modules/react-native/android

> Configure project :react-native-firebase_messaging
:react-native-firebase_messaging package.json found at /home/user/Desktop/Code base/myproject/node_modules/@react-native-firebase/messaging/package.json
:react-native-firebase_app package.json found at /home/user/Desktop/Code base/myproject/node_modules/@react-native-firebase/app/package.json
:react-native-firebase_messaging:firebase.bom using default value: 28.1.0
:react-native-firebase_messaging package.json found at /home/user/Desktop/Code base/myproject/node_modules/@react-native-firebase/messaging/package.json
:react-native-firebase_messaging:version set from package.json: 12.1.0 (12,1,0 - 12001000)
:react-native-firebase_messaging:android.compileSdk using custom value: 29
:react-native-firebase_messaging:android.targetSdk using custom value: 30
:react-native-firebase_messaging:android.minSdk using custom value: 21
:react-native-firebase_messaging:reactNativeAndroidDir /home/user/Desktop/Code base/myproject/node_modules/react-native/android

> Task :app:processDebugResources FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings
222 actionable tasks: 3 executed, 219 up-to-date

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Android resource linking failed
     /home/user/.gradle/caches/transforms-2/files-2.1/ae933febd443fd509332c729536bf1e1/checkout-1.6.16/AndroidManifest.xml:11:5-37:15: AAPT: error: unexpected element <queries> found in <manifest>.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 8s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. https://razorpay.com/docs/payment-gateway/react-native-integration/standard/android/
  2. Followed Exact steps here

Suggested solution:

Code example, screenshot, or link to a repository:

suhaillilac commented 2 years ago

Hi , Am having the same issue , how you solve the issue

cyberwr commented 2 years ago

Try to add this or greater version -> classpath 'com.android.tools.build:gradle:4.0.1' in android/build.gradle file.

Let me know if it works for you.

Thanks