Closed abhijitCN closed 1 month ago
it looks like your project's minSDK is set at 21, but we require at least 26: https://github.com/stripe/stripe-terminal-react-native?tab=readme-ov-file#android
FAILURE: Build failed with an exception.
Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Failed to transform jackson-core-2.16.1.jar (com.fasterxml.jackson.core:jackson-core:2.16.1) to match attributes {artifactType=enumerated-runtime-classes, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
Execution failed for JetifyTransform: C:\Users\FN.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-core\2.16.1\9456bb3cdd0f79f91a5f730a1b1bb041a380c91f\jackson-core-2.16.1.jar. Failed to transform 'C:\Users\FN.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-core\2.16.1\9456bb3cdd0f79f91a5f730a1b1bb041a380c91f\jackson-core-2.16.1.jar' using Jetifier. Reason: IllegalArgumentException, message: Unsupported class file major version 65. (Run with --stacktrace for more details.)
now I use => I am using => { buildToolsVersion = "34.0.0" minSdkVersion = 26 compileSdkVersion = 34 targetSdkVersion = 34 ndkVersion = "25.1.8937393" kotlinVersion = "1.8.0" } and "dependencies": { "@stripe/stripe-terminal-react-native": "^0.0.1-beta.16", "react": "18.2.0", "react-native": "0.73.6" } and gradle-8.3-all.zip for Android also using java version "17.0.10" 2024-01-16 LTS
it looks like your project's minSDK is set at 21, but we require at least 26: https://github.com/stripe/stripe-terminal-react-native?tab=readme-ov-file#android
I'm having the same issue, not sure how to get around it.
I'm having the same issue, not sure how to get around it.
Hello, can you please share all the versions along with Java, Kotln, React-native, minSdkVersion, targetSdkVersion, and compileSdkVersion that version? and in iOS your project is running fine? please share
I'm having the same issue, not sure how to get around it.
Hello, can you please share all the versions along with Java, Kotln, React-native, minSdkVersion, targetSdkVersion, and compileSdkVersion that version? and in iOS your project is running fine? please share
My iOS app builds fine. Android fails with the issues you mentioned. I'm using target version 33, compile version 34, min version 26, react 18.2, react Native 73.6. I can build fine using the previous version and expo 49 (0.0.1-beta.15), but I'd like to use expo 50 so I can better integrate sentry
unable to run @stripe/stripe-terminal-react-native in latest react-native 0.73.6 FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:checkDebugDuplicateClasses'. Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Failed to transform jackson-core-2.16.1.jar (com.fasterxml.jackson.core:jackson-core:2.16.1) to match attributes {artifactType=enumerated-runtime-classes, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
I am using => { buildToolsVersion = "34.0.0" minSdkVersion = 26 compileSdkVersion = 34 targetSdkVersion = 34 ndkVersion = "25.1.8937393" kotlinVersion = "1.8.0" } and "dependencies": { "@stripe/stripe-terminal-react-native": "^0.0.1-beta.16", "react": "18.2.0", "react-native": "0.73.6" } and gradle-8.3-all.zip for Android which version is wrong for me
Same problem I am getting
I'm having the same issue, not sure how to get around it.
Hello, can you please share all the versions along with Java, Kotln, React-native, minSdkVersion, targetSdkVersion, and compileSdkVersion that version? and in iOS your project is running fine? please share
My iOS app builds fine. Android fails with the issues you mentioned. I'm using target version 33, compile version 34, min version 26, react 18.2, react Native 73.6. I can build fine using the previous version and expo 49 (0.0.1-beta.15), but I'd like to use expo 50 so I can better integrate sentry
how to use in expo ?
this is an issue due to updating the the underlying Terminal Android SDK to 3.4.0
: https://github.com/stripe/stripe-terminal-android/issues/433#issuecomment-1970088784
If you update your gradle.properties
to include either
android.jetifier.ignorelist = jackson-core
or
android.enableJetifier = false
does it resolve the issue?
this is an issue due to us underlying the underlying Terminal Android SDK to
3.4.0
: stripe/stripe-terminal-android#433 (comment)If you update your
gradle.properties
to include eitherandroid.jetifier.ignorelist = jackson-core
orandroid.enableJetifier = false
does it resolve the issue?
Still does not resolve the issue. I tried removing the android.enableJetifier=true
line completely (after following some recommendations on the google issue tracker), changing it to android.enableJetifier=false
, and tried android.jetifier.ignorelist=jackson-core-2.16.1.jar
and android.jetifier.ignorelist=jackson-core
underneath android.enableJetifier=true
in gradle.properties after running npx expo prebuild to generate the android directory. Still getting the same error.
[RUN_GRADLEW] FAILURE: Build failed with an exception.
[RUN_GRADLEW] * What went wrong:
[RUN_GRADLEW] Execution failed for task ':app:checkDebugDuplicateClasses'.
[RUN_GRADLEW] > Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
[RUN_GRADLEW] > Failed to transform jackson-core-2.16.1.jar (com.fasterxml.jackson.core:jackson-core:2.16.1) to match attributes {artifactType=enumerated-runtime-classes, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
[RUN_GRADLEW] >
[RUN_GRADLEW] Execution failed for JetifyTransform: /Users/dustin/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-core/2.16.1/9456bb3cdd0f79f91a5f730a1b1bb041a380c91f/jackson-core-2.16.1.jar.
[RUN_GRADLEW] > Failed to transform '/Users/dustin/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-core/2.16.1/9456bb3cdd0f79f91a5f730a1b1bb041a380c91f/jackson-core-2.16.1.jar' using Jetifier. Reason: IllegalArgumentException, message: Unsupported class file major version 65. (Run with --stacktrace for more details.)
[RUN_GRADLEW] Suggestions:
[RUN_GRADLEW] - Check out existing issues at https://issuetracker.google.com/issues?q=componentid:460323&s=modified_time:desc, it's possible that this issue has already been filed there.
[RUN_GRADLEW] - If this issue has not been filed, please report it at https://issuetracker.google.com/issues/new?component=460323 (run with --stacktrace and provide a stack trace if possible).
[RUN_GRADLEW] * Try:
[RUN_GRADLEW] > Run with --stacktrace option to get the stack trace.
[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 1m 5s
[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.3/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
[RUN_GRADLEW] 435 actionable tasks: 434 executed, 1 up-to-date
[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.
ignorelist
this is an issue due to us underlying the underlying Terminal Android SDK to
3.4.0
: stripe/stripe-terminal-android#433 (comment)If you update your
gradle.properties
to include eitherandroid.jetifier.ignorelist = jackson-core
orandroid.enableJetifier = false
does it resolve the issue?
this is an issue due to us underlying the underlying Terminal Android SDK to
3.4.0
: stripe/stripe-terminal-android#433 (comment)If you update your
gradle.properties
to include eitherandroid.jetifier.ignorelist = jackson-core
orandroid.enableJetifier = false
does it resolve the issue?
this is an issue due to us underlying the underlying Terminal Android SDK to
3.4.0
: stripe/stripe-terminal-android#433 (comment)If you update your
gradle.properties
to include eitherandroid.jetifier.ignorelist = jackson-core
orandroid.enableJetifier = false
does it resolve the issue?
thank you @nazli-stripe app built successfully using android.enableJetifier = false in latest teact native project USING => "react": "18.2.0", "react-native": "0.73.6", buildToolsVersion = "34.0.0" minSdkVersion = 26 compileSdkVersion = 34 targetSdkVersion = 33 ndkVersion = "25.1.8937393" kotlinVersion = "1.8.0"
For those on expo you can write a plugin to edit the gradle.properties file
yourplugin.js
const { withGradleProperties } = require('@expo/config-plugins');
/**
* tl;dr fix for
* https://github.com/stripe/stripe-terminal-react-native/issues/653
*
* This is a workaround for an issue with the Stripe Terminal SDK and Jetifier.
* Should be able to remove this once stripe is updated to sdk 18
* @param {*} config
* @param {*} customName
* @returns
*/
const withJetifierIgnoringJackson = (config, customName) => {
return withGradleProperties(config, async config => {
config.modResults.push({
key: 'android.jetifier.ignorelist',
value: 'jackson-core',
type: 'property',
});
return config;
});
};
/// Use the plugin
module.exports = withJetifierIgnoringJackson;
and then in appconfig
{
...
plugins: ['./pathto/yourplugin']
}
For those on expo you can write a plugin to edit the gradle.properties file
yourplugin.js
const { withGradleProperties } = require('@expo/config-plugins'); /** * tl;dr fix for * https://github.com/stripe/stripe-terminal-react-native/issues/653 * * This is a workaround for an issue with the Stripe Terminal SDK and Jetifier. * Should be able to remove this once stripe is updated to sdk 18 * @param {*} config * @param {*} customName * @returns */ const withJetifierIgnoringJackson = (config, customName) => { return withGradleProperties(config, async config => { config.modResults.push({ key: 'android.jetifier.ignorelist', value: 'jackson-core', type: 'property', }); return config; }); }; /// Use the plugin module.exports = withJetifierIgnoringJackson;
and then in appconfig
{ ... plugins: ['./pathto/yourplugin'] }
Damn, after about 2 days of solving this bug, this solution worked perfectly for me, thank you
For those on expo you can write a plugin to edit the gradle.properties file
yourplugin.js
const { withGradleProperties } = require('@expo/config-plugins'); /** * tl;dr fix for * https://github.com/stripe/stripe-terminal-react-native/issues/653 * * This is a workaround for an issue with the Stripe Terminal SDK and Jetifier. * Should be able to remove this once stripe is updated to sdk 18 * @param {*} config * @param {*} customName * @returns */ const withJetifierIgnoringJackson = (config, customName) => { return withGradleProperties(config, async config => { config.modResults.push({ key: 'android.jetifier.ignorelist', value: 'jackson-core', type: 'property', }); return config; }); }; /// Use the plugin module.exports = withJetifierIgnoringJackson;
and then in appconfig
{ ... plugins: ['./pathto/yourplugin'] }
This works for me as well, thank you @Eonfuzz!!
closing this one as there is a working fix, thanks @Eonfuzz for the patch!
@nazli-stripe When will you update to sdk 18?
@isaachinman next release, should be by end of june
android/gradle.properties Change it android.enableJetifier=true To android.enableJetifier=false
@Eonfuzz Wouldn't it be possible to achieve that without a custom plugin, via expo-build-properties
?
For those on expo you can write a plugin to edit the gradle.properties file
yourplugin.js
const { withGradleProperties } = require('@expo/config-plugins'); /** * tl;dr fix for * https://github.com/stripe/stripe-terminal-react-native/issues/653 * * This is a workaround for an issue with the Stripe Terminal SDK and Jetifier. * Should be able to remove this once stripe is updated to sdk 18 * @param {*} config * @param {*} customName * @returns */ const withJetifierIgnoringJackson = (config, customName) => { return withGradleProperties(config, async config => { config.modResults.push({ key: 'android.jetifier.ignorelist', value: 'jackson-core', type: 'property', }); return config; }); }; /// Use the plugin module.exports = withJetifierIgnoringJackson;
and then in appconfig
{ ... plugins: ['./pathto/yourplugin'] }
@Eonfuzz : I am getting this error with "require('@expo/config-plugins');". Did you get this?
@Eonfuzz Wouldn't it be possible to achieve that without a custom plugin, via
expo-build-properties
?
I couldn't see how to edit the specific gradle prop I was after in that documentation, if you find out a way please let me know!
@hungcaovn do you have @expo/config-plugins installed? https://www.npmjs.com/package/@expo/config-plugins
@Eonfuzz : Yes I did
@nazli-stripe I don't think this is an acceptable solution.
changing android.jettifier
to false
produces a different issue mentioned here
https://medium.com/@hasperong/duplicate-class-android-support-v4-app-inotificationsidechannel-found-in-modules-classes-1719262dfdcd
and the fix is to enable jettifier 😓
@mykel-unwritten please check below versions
"react": "18.2.0", "react-native": "0.73.6", buildToolsVersion = "34.0.0" minSdkVersion = 26 compileSdkVersion = 34 targetSdkVersion = 33 ndkVersion = "25.1.8937393" kotlinVersion = "1.8.0"
hi @abhijitCN pretty much the same, the only difference is im on react-native 0.73.7
and targetSdkVersion is 34
i'm on stripe terminal library beta16
disabling jettifier shows me this error, could this be an issue from another library?
enabling jettifier fixes the issue above but jackson core error shows up
@nazli-stripe given this the "fix" for expo to work correctly with stripe-terminal-react-native could you please add it to your expo setup file?
Hey, trying to restart this discussion 😄
I've followed the rough path to get here but like @mykel-unwritten, I'm getting an error that's meant to be solved by re-enabling jettifier. What are we meant to do there ? Is there something else we can try ?
Thank you for your help 🤞
More info : Build properties : "minSdkVersion" : 26, "compileSdkVersion" : 34, "targetSdkVersion" : 33
@stripe/stripe-terminal-react-native: ^0.0.1-beta.19 expo ~50.0.19 react 18.2 react-native 0.73.6
@Eonfuzz added in https://github.com/stripe/stripe-terminal-react-native/pull/754
beta.20 release updated expo config to automatically disable jettifier for jackson-core
in your file android/gradle.properties
add this, below android.enableJetifier=true
:
android.jetifier.ignorelist=jackson-core
unable to run @stripe/stripe-terminal-react-native in latest react-native 0.73.6 FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:checkDebugDuplicateClasses'. Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Failed to transform jackson-core-2.16.1.jar (com.fasterxml.jackson.core:jackson-core:2.16.1) to match attributes {artifactType=enumerated-runtime-classes, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
I am using => { buildToolsVersion = "34.0.0" minSdkVersion = 26 compileSdkVersion = 34 targetSdkVersion = 34 ndkVersion = "25.1.8937393" kotlinVersion = "1.8.0" } and "dependencies": { "@stripe/stripe-terminal-react-native": "^0.0.1-beta.16", "react": "18.2.0", "react-native": "0.73.6" } and gradle-8.3-all.zip for Android which version is wrong for me