square/in-app-payments-react-native-plugin

Android build error on Square SDK for React Native

Closed this issue · 9 comments

Describe the issue

Hello,

I have a RN app that contains the react-native-square-in-app-payments version 1.7.1.

This week, we updated our app to Expo SDK 47 and everything worked for iOS but not for android, we are facing the following issue when we try to build an .apk:

FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-square-in-app-payments:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action
   > Android resource linking failed
     ERROR:/Users/vagrant/git/node_modules/react-native-square-in-app-payments/android/build/intermediates/merged_res/release/values/values.xml:3145: AAPT: error: resource android:attr/lStar not found.

I looked some StackOverflow question and they all say that we should upgrade the compileSdkVersion and targetSdkVersion to solve this issue:
rodgomesc/vision-camera-code-scanner#112 (comment)

To Reproduce

Build an .apk file using a project with expo (ejected): ^47.0.0 and react-native-square-in-app-payments ^1.7.1

Expected behavior

Should build the .apk

Environment (please complete the following information):

  • platform: Android
  • OS and version: Just a build
  • dev environment: MacOS
  • In-App Payments Plugin version: 1.7.1

In addition: Run react-native info in your terminal and copy the results here:
System:
OS: macOS 13.0
CPU: (8) arm64 Apple M1
Memory: 142.48 MB / 8.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 14.18.2 - ~/.nvm/versions/node/v14.18.2/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 6.14.15 - ~/.nvm/versions/node/v14.18.2/bin/npm
Watchman: 2022.10.24.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
Android SDK: Not Found
IDEs:
Android Studio: 2021.3 AI-213.7172.25.2113.9123335
Xcode: 14.2/14C18 - /usr/bin/xcodebuild
Languages:
Java: 19.0.1 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.1.0 => 18.1.0
react-native: 0.70.5 => 0.70.5
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

@mootrichard can you take a look, please? thanks!

any update on this @cicatrizdev @mootrichard ?

It looks like Android POM file is down and we cannot build for android anymore. Help?

Running into a similar issue here

`Could not resolve com.squareup.sdk.in-app-payments:buyer-verification:1.5.6.
Required by:
project :react-native-square-in-app-payments

Could not resolve com.squareup.sdk.in-app-payments:buyer-verification:1.5.6.
> Could not get resource 'https://sdk.squareup.com/public/android/com/squareup/sdk/in-app-payments/buyer-verification/1.5.6/buyer-verification-1.5.6.pom'.
> Could not GET 'https://sdk.squareup.com/public/android/com/squareup/sdk/in-app-payments/buyer-verification/1.5.6/buyer-verification-1.5.6.pom'.
> The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.3.3/userguide/build_environment.html#gradle_system_properties
> Remote host terminated the handshake
> SSL peer shut down incorrectly`

ZSeba commented

Running into a similar issue here

`Could not resolve com.squareup.sdk.in-app-payments:buyer-verification:1.5.6. Required by: project :react-native-square-in-app-payments

Could not resolve com.squareup.sdk.in-app-payments:buyer-verification:1.5.6.

Could not get resource 'https://sdk.squareup.com/public/android/com/squareup/sdk/in-app-payments/buyer-verification/1.5.6/buyer-verification-1.5.6.pom'.
Could not GET 'https://sdk.squareup.com/public/android/com/squareup/sdk/in-app-payments/buyer-verification/1.5.6/buyer-verification-1.5.6.pom'.
The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.3.3/userguide/build_environment.html#gradle_system_properties
Remote host terminated the handshake
SSL peer shut down incorrectly`

I'm running into the same issue :(

Hello @dutradotdev @cicatrizdev @ganoro @ezchen @ZSeba ,
I understand your issue but plugin support react-native and flutter but we don’t support Expo so I'm closing this issue.
Thank you !!

@CharmisG lol it does not make any sense...
the app is using ejected expo, so it is supposed to work and have support

yes @cicatrizdev

i fixed it by upgrading the upgrading compileSDK and targetSDK

you can check it here @CharmisG: dutradotdev@573d3b2