stripe-terminal-react-native: Expo 50 build not working on Android
Describe the bug Building Android with Java 17 (default build envrionment on Expo for 50), is giving this error when using Expo 50:
To Reproduce Steps to reproduce the behavior:
- Install lib
- Install expo-build-properties to up the minSdkVersion to 26 as Expo 50 by default has 23 - see https://github.com/stripe/stripe-terminal-react-native/issues/584#issuecomment-1848922273
- Build Android and it fails
Expected behavior Android build should work
Execution failed for task ':stripe_stripe-terminal-react-native:compileDebugKotlin'.
> 'compileDebugJavaWithJavac' task (current target is 17) and 'compileDebugKotlin' task (current target is 1.8) jvm target compatibility should be set to the same Java version.
Consider using JVM toolchain: https://kotl.in/gradle/jvm/toolchain
* 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 5m 31s
I already used expo-build-properties to up the minSdkVersion to 26 and tried the solution shared here - https://github.com/stripe/stripe-terminal-react-native/issues/584#issuecomment-1848922273 so my plugin is like this:
[
"expo-build-properties",
{
"android": {
"minSdkVersion": 26,
"compileSdkVersion": 34,
"targetSdkVersion": 34,
"buildToolsVersion": "34.0.0",
"packagingOptions": {
"exclude": ["org/bouncycastle/x509/CertPathReviewerMessages*"]
}
}
}
],
Screenshots Please see error logs
Stripe Terminal React Native SDK version
“@stripe/stripe-terminal-react-native”: “^0.0.1-beta.15”,
Smartphone (please complete the following information):
Not applicable
Additional context
No
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 32
I have exactly the same problem. No solution found.
Hey ! the build.gradle file needs some updates in order to follow Expo 50 migration directions. In the changelog they say :
For those who are interested, in the meantime, here is the patch file :
patches/@stripe+stripe-terminal-react-native+0.0.1-beta.15.patchWe recently merged https://github.com/stripe/stripe-terminal-react-native/pull/616 to address compatibility issues for Java 17. We are trying to get a new release out as soon as possible, and will address the Expo issues in that. I will update this issue with any new information.
we just released https://github.com/stripe/stripe-terminal-react-native/releases/tag/v0.0.1-beta.17 to address this issue
hey @isaachinman sorry i missed the discussion on this post, repeating the response on the new issue for specific Expo bug on
beta.16https://github.com/stripe/stripe-terminal-react-native/issues/650:we are aware of this issue and have merged https://github.com/stripe/stripe-terminal-react-native/pull/652 to address it. We are targeting a release this week to fully resolve it
I managed to build on expo server with this image : ubuntu-22.04-jdk-17-ndk-r21e.
You can change the image in eas.json by adding the following in a profile :
"android": { "image": "ubuntu-22.04-jdk-17-ndk-r21e" }