You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

调整Android SDK版本后出现INSTALL_FAILED_INVALID_APK错误求助

Flutter APK 安装报错求助

初始问题

遇到 firebase_auth 插件的版本要求错误:

The plugin firebase_auth requires a higher Android SDK version.
Fix this issue by adding the following to the file D:\flutter_learn\android\app\build.gradle:

android {
    defaultConfig {                                                                             
        minSdkVersion 23                                                                           
   }                                                                                           
}

修改配置后的情况

按照提示修改了 android/app/build.gradle 的配置:

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

编译成功,但安装APK时出现如下错误:

Launching lib\main.dart on sdk gphone16k x86 64 in debug mode...
√ Built build\app\outputs\flutter-apk\app-debug.apk
Error: ADB exited with exit code 1
Performing Streamed Install

adb: failed to install D:\flutter_learn\build\app\outputs\flutter-apk\app-debug.apk: Failure [INSTALL_FAILED_INVALID_APK: INSTALL_FAILED_INVALID_APK: Failed to extract native libraries, res=-2]
Error launching application on sdk gphone16k x86 64.

补充说明

已添加额外配置(附配置截图),但不清楚该错误产生的原因,寻求解决帮助。

内容的提问来源于stack exchange,提问作者Abhishek

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.22 08:06:01