skip to Main Content

I have an error after I added Firebase Auth plugin:

The plugin firebase_auth requires a higher Android SDK version.
Fix this issue by adding the following to the file C:UsersHPDesktopapptest_iandroidappbuild.gradle: │
android {
defaultConfig {
minSdkVersion 23
}
}
Following this change, your app will not be available to users running Android SDKs below 23. │
Consider searching for a version of this plugin that supports these lower versions of the Android SDK instead.

But when I went to build.gradle I found it like this:

defaultConfig {
        applicationId = "com.example.test_i"
        minSdk = flutter.minSdkVersion
        targetSdk = flutter.targetSdkVersion
        versionCode = flutterVersionCode.toInteger()
        versionName = flutterVersionName
    }

I;ve tried to replace flutter.minSdkVersion with 23, like this:

defaultConfig {
        applicationId = "com.example.test_i"
        minSdk =  23
        targetSdk = flutter.targetSdkVersion
        versionCode = flutterVersionCode.toInteger()
        versionName = flutterVersionName
    }

But it didn’t work either, and gave me another error:

Launching libmain.dart on sdk gphone x86 in debug mode…
Running Gradle task ‘assembleDebug’… 7.8s
√ Built buildappoutputsflutter-apkapp-debug.apk
Installing buildappoutputsflutter-apkapp-debug.apk… 1,870ms
Error: ADB exited with exit code 1
Performing Streamed Install
adb: failed to install C:UsersHPDesktopapptest_iibuildappoutputsflutter-apkapp-debug.apk: Failure
[INSTALL_FAILED_INSUFFICIENT_STORAGE] Error launching application on sdk gphone x86.

Any help, guys?

2

Answers


  1. Chosen as BEST ANSWER

    Finally, I found the solution:

    • 1st error: Change "minSdk = flutter.minSdkVersion" to "minSdk = 23". For me, it was 23, and it's the same SDK version given in the error.
    • 2nd error: Increase the internal storage of my emulator through AVD, from 6 to 10 GB.

    1. Try upgrading the firebase auth version in pubspec.yaml to the latest (or any)

    firebase_auth: ^5.1.4 or firebase_auth: any

    1. run flutter clean and then flutter pub get commands

    Update:
    Please update the minSdkVersion to 24 in build.gradle file

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search