Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In order to compile Java 9+ source, please set compileSdkVersion to 30 or above #58

Open
rakibhssn opened this issue Oct 18, 2023 · 4 comments

Comments

@rakibhssn
Copy link

Getting this error to build app and also shows below error

GooglePay.setEnvironment(GooglePay.ENVIRONMENT_TEST)

this one shows Cannot read property setEnvironment of null

@adukugideon
Copy link

Same issue I am facing

@dryusha
Copy link

dryusha commented Mar 11, 2024

Had the same issue, my fix was to change build configs for Android inside of node_modules/react-native-google-pay/android /build.gradle . It depends on your SDK version.
for example for latest version

` android {
compileSdkVersion 34
buildToolsVersion = "34.0.0"

  defaultConfig {
      minSdkVersion 21
      targetSdkVersion 34
      versionCode 1
      versionName "1.0"
  }
  lintOptions {
      abortOnError false
  }

}`

Don't forget you should do it each time then you decide to delete the node_modules. It's annoying, but u can create the patch with patch-package :)

@Npervic
Copy link

Npervic commented Apr 4, 2024

Had the same issue, my fix was to change build configs for Android inside of node_modules/react-native-google-pay/android /build.gradle . It depends on your SDK version. for example for latest version

fixed the formatting:

android {
    compileSdkVersion 34
    buildToolsVersion = "34.0.0"

    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 34
        versionCode 1
        versionName "1.0"
    }
    lintOptions {
        abortOnError false
    }
}

@rahimlisarkhan
Copy link

rahimlisarkhan commented Aug 18, 2024

Step 1 fork this repo
Step 2 convert to android json in build.gradle file

android {
compileSdkVersion 34
buildToolsVersion = "34.0.0"

defaultConfig {
    minSdkVersion 21
    targetSdkVersion 34
    versionCode 1
    versionName "1.0"
}
lintOptions {
    abortOnError false
}

}

Step 3
copy in your project repo

"react-native-google-pay": "[email protected]:yourusername/react-native-google-pay.git",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants