oblador / react-native-keychain

:key: Keychain Access for React Native
MIT License
3.12k stars 515 forks source link

Incompatible with Android SDK Version 30 #578

Open ShepSims opened 1 year ago

ShepSims commented 1 year ago

Following the Nov 5, 2022 RN update 0.71.0-rc.0 it appears that the following Build Failure is caused from react-native-keychain requiring Android SDK 31+

For people that must stay on V30 from other dependences this is a huge issue (especially as this is how we let our users log in...)

Note that when running the server locally it runs fine, but when building apk it causes crash.

Task :app:checkDevReleaseAarMetadata FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDevReleaseAarMetadata'.
> 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.appcompat:appcompat:1.4.2.
     AAR metadata file: /Users/shsims/.gradle/caches/transforms-3/10321df045a947658cd4cbc7702ffc98/transformed/appcompat-1.4.2/META-INF/com/android/build/gradle/aar-metadata.properties.
BraveEvidence commented 1 year ago

This will help https://www.youtube.com/watch?v=J0OSn7s9YiA&list=PLQhQEGkwKZUrempLnmxjt7ZCZJu1W3p2i&index=15

borgespro commented 9 months ago

The same problem here: #553.

You can try add:

dependencies {
    ...
    implementation ("androidx.appcompat:appcompat:1.3.1") {
        version {
            strictly '1.3.1'
        }
    }
    ...
}

That solution worked for me.