OverdoseB12
OverdoseB12

Reputation: 1153

Flutter Run Failure [INSTALL_FAILED_OLDER_SDK] Requires newer sdk version #31 (current version is #30)

When I try flutter run the following error occurs:

Error: ADB exited with exit code 1
Performing Streamed Install

adb: failed to install C:\Flutter\appname\build\app\outputs\flutter-apk\app.apk: Failure [INSTALL_FAILED_OLDER_SDK: Failed parse during installPackageLI: /data/app/vmdl1847062534.tmp/base.apk (at Binary XML file line #7):    
Requires newer sdk version #31 (current version is #30)]
Error launching application on SM A127F.

Here is part of my build.gradle file

defaultConfig {
        applicationId "de.domain.appname"
        minSdkVersion 31
        multiDexEnabled true
        targetSdkVersion 31
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

Upvotes: 6

Views: 16173

Answers (3)

Maruf Hassan
Maruf Hassan

Reputation: 1238

We recieved an email that the apps should have minimum support of API 34 in playstore by 31st Aug 2024. So we updated it to minSdkVersion 34.

enter image description here

ERROR: Then after running the app we got this error.

enter image description here

ISSUE : We were trying to run the updated app in a emulator which supported upto API 33.

SOLUTION : Create a new simulator which supports above API 34, I installed one which supported upto API 35. The app started working after this.

enter image description here

Upvotes: -1

Usaid Asif
Usaid Asif

Reputation: 601

I encountered the same issue myself. Simply ensure that you update your Android Studio to the latest version, then proceed to update the SDK. Afterward, utilize the most recent version of the Android Emulator along with the latest Android operating system version available. This should effectively resolve the problem you're experiencing.

Upvotes: 0

Sisir
Sisir

Reputation: 5388

The problem is due to android SDK version mismatch between your app and the target device (i.e. real phone or emulator).

From your case it seems like your app is built with SDK version 31 and you are trying to run it on a device which supports version 30 resulting in the issue. TO fix this either downgrade the your app's SDK need to 30 or run it on a newer device that supports SDK 31.

Upvotes: 12

Related Questions