stripe / stripe-terminal-react-native

React Native SDK for Stripe Terminal
https://stripe.com/docs/terminal/payments/setup-integration?terminal-sdk-platform=react-native
MIT License
106 stars 50 forks source link

Build fails when using stripe-terminal-react-native on Expo SDK 50 and RN 0.73.6 #669

Closed itbeginswithi closed 5 months ago

itbeginswithi commented 5 months ago

Describe the bug I've just updated my app from Expo v.49 & RN 0.72.6 to Expo v.50 & RN 0.73.6, and now my local Android build is failing with the following exception.

C:\Users\lenovo\Desktop\uberclone\node_modules\@stripe\stripe-terminal-react-native\android\src\main\java\com\stripeterminalreactnative\listener\RNReaderReconnectionListener.kt:32:18: warning: this declaration overrides deprecated member but not marked as deprecated itself. This deprecation won't be inherited in future releases. Please add @Deprecated annotation or suppress. See https://youtrack.jetbrains.com/issue/KT-47902 for details
    override fun onReaderReconnectStarted(reader: Reader, cancelReconnect: Cancelable) {
                 ^

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}.
      > Execution failed for JetifyTransform: C:\Users\lenovo\.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\lenovo\.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.)
           Suggestions:
            - 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.    
            - 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).

To Reproduce Steps to reproduce the behavior:

  1. init an expo app: npx create-expo-app StickerSmash
  2. add @stripe/stripe-terminal-react-native
  3. build the app using: npx expo run android => Build fails with an exception

Expected behavior A clear and concise description of what you expected to happen.

Stripe Terminal React Native SDK version ^0.0.1-beta.17

Smartphone (please complete the following information):

Additional context Following the migration of an Expo app to Expo 50, my attempts to build the application were unsuccessful, due to issues with stripe-terminal-react-native SDK. I cross-referenced the Expo 50 changelog and confirmed that I'm using the recommended SDK versions for compatibility with the latest release. Updating the react-stripe-terminal SDK may be necessary to align with the changes introduced in RN 0.73;

React Native 0.73 changed from Java to Kotlin for Android Main* classes: MainApplication.java/MainActivity.java are now MainApplication.kt/MainActivity.kt. If you depend on any config plugins that use dangerous modifications to change these files, they may need to be updated for SDK 50 support.

nazli-stripe commented 5 months ago

Did you take a look at https://github.com/stripe/stripe-terminal-react-native/issues/653 Issues with jackson-core are coming from an upgrade in the Terminal Android SDK and the solution is to disable jetifier. Let me know if that fixes it

itbeginswithi commented 5 months ago

It works, thank you.