Closed vivekmahato26 closed 3 years ago
I do have same problem with both iOS and Android projects
@vivekmahato26 does your project meet all sdk's requirements https://github.com/stripe/stripe-react-native#android ? if so, please provide some more information about your error since
"java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/internal/zzbq;"
doesn't say much and seems to be not related to the SDK.
@alexbubly what is your exact problem? this issue is related only to android and you can't run it on both platforms. Please create another issue using our template.
closing due to inactivity, please reopen if you still having issues.
Describe the bug I am building an eCommerce app with Pure React Native without Expo. The app runs perfectly until I install the stripe/stripe-react-native package. The Gradle build works fine along with the meteor server but the app crashes immediately without any warnings or errors. when I ran adb logcat the following error message was there: - "java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/internal/zzbq;"
After removing the package the app runs properly again without any crashes or errors.
To Reproduce Steps to reproduce the behavior: create a react native project with react-native CLI install stripe/stripe-react-native run:- npm run android
Expected behavior there shouldn't be any crashes;
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
My gradle file: - buildscript { ext { buildToolsVersion = "29.0.3" minSdkVersion = 21 compileSdkVersion = 29 targetSdkVersion = 29 ndkVersion = "20.1.5948944" } repositories { google() jcenter() } dependencies { classpath("com.android.tools.build:gradle:4.1.0") // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } }
allprojects { repositories { mavenLocal() maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url("$rootDir/../node_modules/react-native/android") } maven { // Android JSC is installed from npm url("$rootDir/../node_modules/jsc-android/dist") }
}
My app/build.gradle file: - apply plugin: "com.android.application"
import com.android.build.OutputFile
/**
react-native bundle
with the correct arguments during the Android buildapply from: "../../node_modules/react-native/react.gradle"
line.project.ext.react = [ enableHermes: false, // clean and rebuild if changing ]
apply from: "../../node_modules/react-native/react.gradle" /**
/**
/**
def jscFlavor = 'org.webkit:android-jsc-intl:+'
Date.toLocaleString
andString.localeCompare
that/**
android { ndkVersion rootProject.ext.ndkVersion
}
dependencies { implementation fileTree(dir: "libs", include: ["*.jar"]) //noinspection GradleDynamicVersion implementation "com.facebook.react:react-native:+" // From node_modules
}
// Run this once to be able to run the application with BUCK // puts all compile dependencies into folder libs for BUCK to use task copyDownloadableDepsToLibs(type: Copy) { from configurations.compile into 'libs' }
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
My Package.json file: -
{ "name": "vevibes", "version": "0.0.1", "private": true, "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", "start": "react-native start", "test": "jest", "lint": "eslint ." }, "dependencies": { "@react-native-async-storage/async-storage": "^1.15.5", "@react-native-community/geolocation": "^2.0.2", "@react-native-community/masked-view": "^0.1.11", "@react-navigation/drawer": "^5.12.5", "@react-navigation/native": "^5.9.4", "@react-navigation/stack": "^5.14.5", "algoliasearch": "^4.10.3", "axios": "^0.21.1", "graphql": "^15.5.1", "graphql-request": "^3.4.0", "moment": "^2.29.1", "react": "17.0.1", "react-devtools": "^4.13.5", "react-is": "^17.0.2", "react-native": "0.64.2", "react-native-animatable": "^1.3.3", "react-native-collapsible": "^1.6.0", "react-native-dash": "0.0.11", "react-native-date-picker": "^3.3.2", "react-native-elements": "^3.4.2", "react-native-fs": "^2.18.0", "react-native-gesture-handler": "^1.10.3", "react-native-image-picker": "^4.0.6", "react-native-keychain": "^7.0.0", "react-native-linear-gradient": "^2.5.6", "react-native-modalize": "^2.0.8", "react-native-otp-textinput": "0.0.8", "react-native-paper": "^4.9.2", "react-native-paper-dropdown": "1.0.3", "react-native-permissions": "^3.0.4", "react-native-reanimated": "^2.2.0", "react-native-safe-area-context": "^3.2.0", "react-native-screens": "^3.3.0", "react-native-vector-icons": "^8.1.0", "react-native-windows": "^0.64.14", "tipsi-stripe": "^9.0.0", "toggle-switch-react-native": "^3.2.0", "tsutils": "^3.21.0", "typescript": "^4.3.5" }, "devDependencies": { "@babel/core": "^7.12.9", "@babel/runtime": "^7.12.5", "@react-native-community/eslint-config": "^2.0.0", "babel-jest": "^26.6.3", "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.64.0", "react-test-renderer": "17.0.1" }, "jest": { "preset": "react-native" } }