sorokin0andrey / react-native-google-pay

React Native bridge for Google Pay
102 stars 54 forks source link

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

Open rakibhssn opened 1 year ago

rakibhssn commented 1 year ago

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 commented 1 year ago

Same issue I am facing

dryusha commented 8 months ago

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 commented 8 months ago

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 commented 3 months ago

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": "git@github.com:yourusername/react-native-google-pay.git",