简体   繁体   English

Flutter 运行失败 [INSTALL_FAILED_OLDER_SDK] 需要更新的 sdk 版本 #31(当前版本为 #30)

[英]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:当我尝试flutter run时,出现以下错误:

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这是我的 build.gradle 文件的一部分

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

The problem is due to android SDK version mismatch between your app and the target device (ie real phone or emulator).问题是由于您的应用程序与目标设备(即真实手机或模拟器)之间的 android SDK 版本不匹配。

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.从你的情况来看,你的应用程序似乎是用 SDK 版本 31 构建的,你试图在支持版本 30 的设备上运行它导致了这个问题。 TO fix this either downgrade the your app's SDK need to 30 or run it on a newer device that supports SDK 31.要解决此问题,请将您的应用程序的 SDK 降级到 30,或者在支持 SDK 31 的较新设备上运行它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM