Hi everyone, Can anyone help me to solve this erro...
# community-support
h
Hi everyone, Can anyone help me to solve this error? Could not determine the dependencies of task 'react native google paybundleLibCompileToJarRelease'. > Could not create task 'react native google paycompileReleaseJavaWithJavac'. > In order to compile Java 9+ source, please set compileSdkVersion to 30 or above In my android/build.gradle,i have: buildscript { ext { buildToolsVersion = "34.0.0" minSdkVersion = 23 compileSdkVersion = 34 targetSdkVersion = 34 ndkVersion = "26.1.10909125" kotlinVersion = "1.9.22" } repositories { google() mavenCentral() } dependencies { classpath("com.android.tools.buildG8.2.1") // classpath("com.android.tools.build:gradle") classpath("com.facebook.react:react-native-gradle-plugin") classpath("org.jetbrains.kotlin:kotlin-gradle-plugin") } } apply plugin: "com.facebook.react.rootproject"
v
Well, the error sounds quite concrete. Are you sure some plugin is reading those bad-practice
ext
properties? You probably should instead ask in some react native community.
a
Yeah, Vampire is right, the
react-native-google-pay
is hard coded to compile against sdk 28 The "fix", as RN copies the entire source into your project, will be to tweak the copied version of the
build.gradle
for the added module. Normally I wouldn't recommend doing things like that as you run the risk of incompatibility with updates. I think that's the least of your worries since this plugin looks dead though.
Are you sure some plugin is reading those bad-practice
ext
properties?
I've (thankfully) not had to touch much react native in about 2.5 years so things might be better now, but there's a lot in React Native for Android that looks like bad practice from the Gradle perspective that is "best" practice from the RN perspective due to the poorly designed plugin / native module architecture. `ext`ing properties like that being one of the milder instances.