Reputation: 1
I am running an expo managed project. The app build fine for ios, but for android is still failed. Looking the error when build locally with android, it seems the problem is related to stripe but I don't know how to solve it since everything work well when i run on physical device. below is the error i have in terminal.
[RUN_GRADLEW] > Task :app:minifyReleaseWithR8 FAILED
[RUN_GRADLEW] ERROR: Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in /tmp/paulin/eas-build-local-nodejs/a32037e6-c759-....c6063c1be96d/build/android/app/build/outputs/mapping/release/missing_rules.txt.
[RUN_GRADLEW] ERROR: R8: Missing class com.stripe.android.pushProvisioning.PushProvisioningActivity$g (referenced from: void com.reactnativestripesdk.pushprovisioning.PushProvisioningProxy$createActivityEventListener$listener$1.onActivityResult(android.app.Activity, int, int, android.content.Intent))
[RUN_GRADLEW] Missing class com.stripe.android.pushProvisioning.PushProvisioningActivityStarter$Args (referenced from: void com.reactnativestripesdk.pushprovisioning.DefaultPushProvisioningProxy.beginPushProvisioning(android.app.Activity, java.lang.String, com.reactnativestripesdk.pushprovisioning.EphemeralKeyProvider))
[RUN_GRADLEW] Missing class com.stripe.android.pushProvisioning.PushProvisioningActivityStarter$Error (referenced from: void com.reactnativestripesdk.pushprovisioning.PushProvisioningProxy$createActivityEventListener$listener$1.onActivityResult(android.app.Activity, int, int, android.content.Intent))
[RUN_GRADLEW] Missing class com.stripe.android.pushProvisioning.PushProvisioningActivityStarter (referenced from: void com.reactnativestripesdk.pushprovisioning.DefaultPushProvisioningProxy.beginPushProvisioning(android.app.Activity, java.lang.String, com.reactnativestripesdk.pushprovisioning.EphemeralKeyProvider))
[RUN_GRADLEW] Missing class com.stripe.android.pushProvisioning.PushProvisioningEphemeralKeyProvider (referenced from: void com.reactnativestripesdk.pushprovisioning.DefaultPushProvisioningProxy.beginPushProvisioning(android.app.Activity, java.lang.String, com.reactnativestripesdk.pushprovisioning.EphemeralKeyProvider) and 1 other context)
[RUN_GRADLEW] > Task :realm:buildCMakeRelease[arm64-v8a][realm-js-android-binding]
[RUN_GRADLEW] FAILURE: Build failed with an exception.
[RUN_GRADLEW] * What went wrong:
[RUN_GRADLEW] Execution failed for task ':app:minifyReleaseWithR8'.
[RUN_GRADLEW] > A failure occurred while executing com.android.build.gradle.internal.tasks.R8Task$R8Runnable
[RUN_GRADLEW] > Compilation failed to complete
[RUN_GRADLEW] * Try:
[RUN_GRADLEW] > Run with --stacktrace option to get the stack trace.
[RUN_GRADLEW] >
[RUN_GRADLEW] Run with --info or --debug option to get more log output.
[RUN_GRADLEW] > Run with --scan to get full insights.
[RUN_GRADLEW] > Get more help at https://help.gradle.org.
[RUN_GRADLEW] BUILD FAILED in 3m 49s
[RUN_GRADLEW] Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
[RUN_GRADLEW] You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
[RUN_GRADLEW] For more on this, please refer to https://docs.gradle.org/8.8/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
[RUN_GRADLEW] 1252 actionable tasks: 1252 executed
[RUN_GRADLEW] Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.
Build failed
Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.
npx exited with non-zero code: 1
Error: build command failed.
Here is my package.json file
{
"name": "project",
"main": "expo-router/entry",
"version": "1.0.3",
"scripts": {
"clean": "sh ./clean-project.sh",
"check:tsc": "! tsc --noEmit | grep 'TS2552\\|TS2304'",
"start": "EXPO_DEBUG=true npx expo start --clear",
"dev": "expo start --dev-client",
"dev:go": "expo start --go",
"serve:app": "expo start --dev-client",
"serve:web": "npx serve web-build --single",
"android": "npx expo run:android -d",
"android:no-cache": "npx expo run:android -d --no-build-cache",
"ios": "expo run:ios",
"web": "expo start --web --no-dev --host localhost --port 3000",
"build:android": "npx eas-cli build -p android --profile preview --local",
"build:ios": "npx eas-cli build -p ios --profile preview --local",
"build:web": "npx expo export --platform web -c --output-dir web-build",
"format": "npx prettier src --write",
"lint": "eslint src/**/*.tsx src/**/*.ts",
"lint:fix": "npm run lint -- --fix",
"offline": "expo start --offline",
"publish:expo": "npx eas-cli update",
"publish:web": "firebase deploy --only hosting",
"setup": "npm ci --silent",
"test": "jest",
"upgrade": "expo upgrade"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"@expo/metro-runtime": "~3.2.3",
"@expo/vector-icons": "^14.0.2",
"@gorhom/bottom-sheet": "^4.6.4",
"@react-native-async-storage/async-storage": "1.23.1",
"@react-native-community/datetimepicker": "8.0.1",
"@react-native-picker/picker": "2.7.5",
"@react-navigation/native": "^6.1.18",
"@realm/babel-plugin": "^0.2.0",
"@realm/react": "^0.10.1",
"@shopify/flash-list": "1.6.4",
"@stripe/stripe-react-native": "0.37.2",
"@tanstack/react-query": "^5.52.0",
"@types/uuid": "^10.0.0",
"axios": "^1.7.4",
"expo": "~51.0.38",
"expo-application": "~5.9.1",
"expo-asset": "~10.0.10",
"expo-auth-session": "~5.5.2",
"expo-build-properties": "~0.12.5",
"expo-checkbox": "~3.0.0",
"expo-constants": "~16.0.2",
"expo-crypto": "~13.0.2",
"expo-dev-client": "~4.0.28",
"expo-device": "~6.0.2",
"expo-font": "~12.0.9",
"expo-image": "~1.13.0",
"expo-image-manipulator": "~12.0.5",
"expo-image-picker": "~15.0.7",
"expo-linking": "~6.3.1",
"expo-local-authentication": "~14.0.1",
"expo-localization": "~15.0.3",
"expo-location": "~17.0.1",
"expo-notifications": "~0.28.19",
"expo-random": "~14.0.1",
"expo-router": "~3.5.23",
"expo-secure-store": "~13.0.2",
"expo-sharing": "~12.0.1",
"expo-sms": "~12.0.1",
"expo-splash-screen": "~0.27.6",
"expo-status-bar": "~1.12.1",
"expo-system-ui": "~3.0.7",
"expo-updates": "~0.25.27",
"expo-web-browser": "~13.0.3",
"firebase": "^10.13.0",
"formik": "^2.4.6",
"i18next": "^23.14.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-i18next": "^15.0.1",
"react-native": "0.74.5",
"react-native-device-info": "^13.0.0",
"react-native-exception-handler": "^2.10.10",
"react-native-gesture-handler": "~2.16.1",
"react-native-get-random-values": "^1.11.0",
"react-native-google-places-autocomplete": "^2.5.7",
"react-native-maps": "1.14.0",
"react-native-maps-directions": "^1.9.0",
"react-native-reanimated": "~3.10.1",
"react-native-root-toast": "^3.6.0",
"react-native-safe-area-context": "4.10.5",
"react-native-screens": "3.31.1",
"react-native-svg": "15.2.0",
"react-native-web": "~0.19.10",
"react-native-webview": "13.8.6",
"realm": "^12.13.1",
"socket.io-client": "^4.7.5",
"yup": "^1.4.0",
"zustand": "^4.5.5",
"expo-linear-gradient": "~13.0.2"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@babel/plugin-proposal-export-namespace-from": "^7.18.9",
"@types/jest": "^29.5.12",
"@types/react": "~18.2.45",
"@types/react-test-renderer": "^18.0.7",
"jest": "^29.2.1",
"jest-expo": "~51.0.3",
"react-native-svg-transformer": "^1.5.0",
"react-test-renderer": "18.2.0",
"ts-node": "^10.9.2",
"typescript": "~5.3.3"
},
"private": true
}
Any help? here is the link of the demo project app link
I don't know what is wrong in my configuration
I try to change the version of @stripe/stripe-react-native but still failed.
Upvotes: 0
Views: 129