proyecto26 / react-native-inappbrowser

📱InAppBrowser for React Native (Android & iOS) 🤘
https://www.npmjs.com/package/react-native-inappbrowser-reborn
MIT License
1.31k stars 223 forks source link

The minCompileSdk (31) specified in a dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties) is greater than this module's compileSdkVersion (android-30) #327

Closed HarshMB closed 2 years ago

HarshMB commented 2 years ago

After adding into latest version of react native project (v0.66.4), i am getting below errors :-

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.9/userguide/command_line_interface.html#sec:command_line_warnings 53 actionable tasks: 53 executed FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:checkDebugAarMetadata'. A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction The minCompileSdk (31) specified in a dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties) is greater than this module's compileSdkVersion (android-30). Dependency: androidx.browser:browser:1.4.0. AAR metadata file: /Users/kyatch/.gradle/caches/transforms-3/2ef96b051884931cf6729be3fe4ad115/transformed/browser-1.4.0/META-INF/com/android/build/gradle/aar-metadata.properties.

My react-native-inappbrowser-reborn version is 3.6.3

My other configurations :-

buildToolsVersion = "30.0.3" minSdkVersion = 21 compileSdkVersion = 30 targetSdkVersion = 30 ndkVersion = "21.4.7075529"

sebcam commented 2 years ago

you need to set compileSdkVersion = 31

Ronaldvdh-ISAAC commented 2 years ago

Changing to compileSdkVersion=31 will throw the error:

Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details

The androidmanifest of this library should add the exported property on the activity so we can compile for sdk 31.

jdnichollsc commented 2 years ago

Hello folks, any pull request is welcome! <3

BodaThomas commented 2 years ago

I had the same issue with one of my project. For my part, it was just because i didn't read the installation part of the README.md file. I forgot to configure the android/build.gradle file, according to the documentation of this repository. If we have the same issue, just read the README.md carrefully, and don't forget to do this step:

Modify your android/build.gradle configuration:

buildscript { ext { buildToolsVersion = "30.0.2" minSdkVersion = 21 compileSdkVersion = 30 targetSdkVersion = 30 ndkVersion = "21.4.7075529" // Remove 'supportLibVersion' property and put specific versions for AndroidX libraries androidXAnnotation = "1.2.0" androidXBrowser = "1.3.0" // Put here other AndroidX dependencies }

vincent-paing commented 2 years ago

@Ronaldvdh-ISAAC @jdnichollsc submitted a PR to make it compatible with sdk version 31.

vincent-paing commented 2 years ago

@jdnichollsc could you also make a new release on npm with this fix. We're upgrading to the RN 0.68 which now target sdk 31.

brunolcarlos commented 2 years ago

How can I set the minCompileSdk (31) with Expo ? I'm using expo 44

Thank you

1mehdifaraji commented 1 year ago

This is my build.gradle and the error still appears on my machine :

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

// // Remove 'supportLibVersion' property and put specific versions for AndroidX libraries
// androidXAnnotation = "1.2.0"
// androidXBrowser = "1.3.0"
// // Put here other AndroidX dependencies

    ext {
        // supportLibVersion = "28.0.0"
        androidXAnnotation = "1.2.0"
        androidXBrowser = "1.3.0"
        buildToolsVersion = "30.0.2"
        minSdkVersion = 21
        compileSdkVersion = 30
        targetSdkVersion = 30
        ndkVersion = "21.4.7075529"
    }
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:4.2.2")
        classpath('com.google.gms:google-services:4.3.3') // FCM
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenCentral()
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }

        // google()
        maven { url 'https://www.jitpack.io' }
        maven { 
            url 'https://maven.google.com/'
            name 'Google'
        } 
    }
}
fullsnack-DEV commented 1 year ago

I am also facing the same issue

ShevO27 commented 1 year ago

@1mehdifaraji @fullsnack-DEV check this out guys, might be related https://github.com/facebook/react-native/issues/35210

rakesho-firstlight commented 1 year ago

Try upgrading your current RN version to the latest version of same version you are using, there seems to be issue with RN since last Friday. For more details, pls check - https://github.com/facebook/react-native/issues/35210

POLO79160 commented 1 year ago

regardez plutôt cette vidéo (simple et efficace) et le problème est résolu, voici le lien

https://www.youtube.com/watch?v=4gUzUuk9X0k

ParmarJigarr commented 1 year ago

@fullsnack-DEV I am Also facing same issue any solution ?

1mehdifaraji commented 1 year ago

I solved the issue by adding this piece of code at the end of dependencies inside android/app/build.gradle :

android/app/build.gradle

dependencies {
    ....
    ....
    api(group: "androidx.work", name: "work-runtime") {
        version {
            strictly "2.7.0-alpha04"
        }
    }
}

And this is android/build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        buildToolsVersion = "30.0.2"
        minSdkVersion = 21
        compileSdkVersion = 30
        targetSdkVersion = 30
        ndkVersion = "21.4.7075529"
        androidXCore = "1.7.0" // <-- Add this. Check versions here: https://developer.android.com/jetpack/androidx/releases/core
    }
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:4.2.2")
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenCentral()
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }

        google()
        maven { url 'https://www.jitpack.io' }
    }
}
ParmarJigarr commented 1 year ago

@1mehdifaraji Thanks for response, i resolve this issue by change version from 30 to 31 and upgrade some npms !