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
102 stars 49 forks source link

CommandError: Failed to resolve plugin for module "@stripe/stripe-terminal-react-native" relative #650

Closed erick-repo closed 4 months ago

erick-repo commented 5 months ago

I'm not able to compile using the library @stripe/stripe-terminal-react-native

 npx expo run:android 
(node:45909) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)

CommandError: Failed to resolve plugin for module "@stripe/stripe-terminal-react-native" relative to "/Users//Github/App"

It use to work using version "@stripe/stripe-terminal-react-native": "^0.0.1-beta.15" but not anymore Steps to reproduce the behavior:

I have these lines on :

[
        "@stripe/stripe-terminal-react-native",
        {
          "bluetoothBackgroundMode": true,
          "locationWhenInUsePermission": "Location access is required in order to accept payments.",
          "bluetoothPeripheralPermission": "Bluetooth access is required in order to connect to supported bluetooth card readers.",
          "bluetoothAlwaysUsagePermission": "This app uses Bluetooth to connect to supported card readers."
        }
      ],

If i remove those lines from app.json the build advances a bit more but then i get 21 errors:

npx expo run:android 
(node:67094) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
› Building app...
Configuration on demand is an incubating feature.

> Configure project :app
 ℹ️  Applying gradle plugin 'expo-updates-gradle-plugin' (expo-updates@0.18.19)

> Configure project :stripe_stripe-terminal-react-native
RN SDK package.json version: 0.0.1-beta.16

> Configure project :expo

Using expo modules
  - expo-application (5.3.1)
  - expo-constants (14.4.2)
  - expo-eas-client (0.6.0)
  - expo-file-system (15.4.5)
  - expo-font (11.4.0)
  - expo-image-loader (4.3.0)
  - expo-image-picker (14.3.2)
  - expo-json-utils (0.7.1)
  - expo-keep-awake (12.3.0)
  - expo-location (16.1.0)
  - expo-manifests (0.7.2)
  - expo-modules-core (1.5.13)
  - expo-modules-core$android-annotation-processor (1.5.13)
  - expo-modules-core$android-annotation (1.5.13)
  - expo-splash-screen (0.20.5)
  - expo-structured-headers (3.3.0)
  - expo-system-ui (2.4.0)
  - expo-updates (0.18.19)

> Configure project :react-native-reanimated
No AAR for react-native-reanimated found. Attempting to build from source.
Android gradle plugin: 7.4.2
Gradle: 8.0.1
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.

The Kotlin Gradle plugin was loaded multiple times in different subprojects, which is not supported and may break the build. 
This might happen in subprojects that apply the Kotlin plugins with the Gradle 'plugins { ... }' DSL if they specify explicit versions, even if the versions are equal.
Please add the Kotlin plugin to the common parent project or the root project, then remove the versions in the subprojects.
If the parent project does not need the plugin, add 'apply false' to the plugin line.
See: https://docs.gradle.org/current/userguide/plugins.html#sec:subprojects_plugins_dsl
The Kotlin plugin was loaded in the following projects: ':shopify_flash-list', ':stripe_stripe-react-native', ':stripe_stripe-terminal-react-native', ':expo-modules-core', ...

> Task :app:checkDebugAarMetadata FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
   > 21 issues were found when checking AAR metadata:

       1.  Dependency 'androidx.room:room-runtime:2.6.1' requires libraries and applications that
           depend on it to compile against version 34 or later of the
           Android APIs.

Any help i would appreciate. I have been spending too much time on this.

luisflorido commented 5 months ago

In the build process maybe they don't build correctly, the "lib" folder is missing from the package, that's why the plugin can't load.

I had a similar problem with react-native-builder-bob in a project, updating to the latest version fixed it for me

hungcaovn commented 4 months ago

Getting same issue, it must be an issue with latest version 0.0.1-beta.16. Please help us to fix and release this asap

nazli-stripe commented 4 months ago

hey all, 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

nazli-stripe commented 4 months ago

we just released https://github.com/stripe/stripe-terminal-react-native/releases/tag/v0.0.1-beta.17 to address this issue