Hello
We opened a ticket on the Github repository, cross posting here as well:
Link to issue https://github.com/square/in-app-payments-react-native-plugin/issues/89
Describe the issue
After installing the library and linking the library via react-native link react-native-square-in-app-payments my android project no longer builds and throws the error: “error: package sqip.react does not exist”.
the error originates from the the MainApplication.java where the imports read as:
import sqip.react.SquareInAppPaymentsPackage;
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new SquareInAppPaymentsPackage(),
new StripeReactPackage(),
new VectorIconsPackage(),
new SafeAreaContextPackage(),
new ReactNativeFirebaseAppPackage(),
new ReactNativeFirebaseAuthPackage(),
new ReanimatedPackage(),
new RNGestureHandlerPackage(),
new RNGoogleSigninPackage(),
new RNScreensPackage(),
new SplashScreenReactPackage(),
new ModuleRegistryAdapter(mModuleRegistryProvider),
new RNCameraPackage(),
new SvgPackage(),
new ReactNativePushNotificationPackage(),
new ReactNativeExceptionHandlerPackage(),
new ARTPackage()
);
}
and the import in settings.gradle looks correct as well:
include ':react-native-square-in-app-payments'
project(':react-native-square-in-app-payments').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-square-in-app-payments/android')
One possible issue is that I had to manually add the sqipVersion to my build.gradle and now looks like this:
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 23
compileSdkVersion = 29
targetSdkVersion = 29
supportLibVersion = "28.0.0"
googlePlayServicesAuthVersion = "16.0.1"
googlePlayServicesVersion = "11.8.0"
androidMapsUtilsVersion = "0.5+"
firebaseMessagingVersion = "20.3.0"
sqipVersion = "1.4.0"
}
I get the feeling I missed a dependency somewhere during the installation and would appreciate any help.
To Reproduce
- In an existing repo run npm i react-native-square-in-app-payments
- run react-native link react-native-square-in-app-payments
- run react-native run-android
Expected behavior
I expected the app to start up.
Relevant Code
Full error message:
> Task :app:compileDebugJavaWithJavac FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.3/userguide/command_line_interface.html#sec:command_line_warnings
602 actionable tasks: 1 executed, 601 up-to-date
/${PROJECT_DIR}/android/app/src/main/java/com/project/project_name/MainApplication.java:6: error: package sqip.react does not exist
/${PROJECT_DIR}/android/app/src/main/java/com/project/project_name/MainApplication.java:61: error: cannot find symbol
new SquareInAppPaymentsPackage(),
^
symbol: class SquareInAppPaymentsPackage
2 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* 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 9s