iHealthDeviceLabs / iHealth-React-Native-SDK

3 stars 11 forks source link

Android build error compileSdkVersion #9

Open razzfox opened 6 months ago

razzfox commented 6 months ago

Error when building for Android, package version @ihealth/ihealthlibrary-react-native: "1.7.0"


[RUN_GRADLEW] * What went wrong:
[RUN_GRADLEW] Could not determine the dependencies of task ':ihealth_ihealthlibrary-react-native:bundleLibCompileToJarDebug'.
[RUN_GRADLEW] > Could not create task ':ihealth_ihealthlibrary-react-native:compileDebugJavaWithJavac'.
[RUN_GRADLEW]    >
[RUN_GRADLEW] In order to compile Java 9+ source, please set compileSdkVersion to 30 or above```
Sriram-52 commented 3 months ago

For future reference, use the following snippet in your app/build.gradle if needed.


subprojects { subproject ->
  afterEvaluate{
    if((subproject.plugins.hasPlugin('android') || subproject.plugins.hasPlugin('android-library'))) {
        android {
            compileSdkVersion rootProject.ext.compileSdkVersion
            buildToolsVersion rootProject.ext.buildToolsVersion
        }
    }
  }
}