繁体   English   中英

在物理设备崩溃 android 工作室 flutter 上构建 Apk

[英]build Apk on physical device crash android studio flutter

当我在模拟器(android 11 API 30)上构建我的应用程序时,它工作正常,但是当我尝试在我的旧物理设备(Android Kitkat API 19)上构建它时它崩溃了。

编辑:是的开发人员选项已启用

但是当我运行终端flutter build apk --split-per-abiflutter run --release它工作我可以在物理设备上运行它

我知道我需要 armeabi v7 才能让它在我的手机上工作,但是每次我想构建时都必须使用控制台很烦人

除非我做错了,否则我如何在 IDE 上构建它

编辑 2:这是我的 appbuild

minSdkVersion 19

buildTypes {
customDebugType {
        debuggable true
    }

    release {
        minifyEnabled true
        signingConfig signingConfigs.debug
    }

    debug {
        minifyEnabled true
        applicationIdSuffix ".debug"
        debuggable true
    }
    staging {
        initWith debug
        applicationIdSuffix ".debugStaging"
    }

您可以添加自定义运行配置来执行任何 shell 脚本。

为此,请在 Android Studio、go 中运行 -> 编辑配置...

Android Studio 编辑配置... 选项

在配置 window 中,单击 + 图标和 select Shell 脚本

Android Studio 中的配置选项菜单

Once it's added, you can give the script a name and for the "Script Path" select the flutter executable (This can be found inside the flutter SDK folder specifically inside a bin folder). 对于“脚本选项”,您可以添加您希望 Flutter 执行的选项,例如build apk --split-per-abirun --release

Android Studio Shell 脚本选项

此时,您可以单击应用并确定。 您现在应该在下拉菜单中看到这个自定义运行器,您可以在其中运行不同的任务。

Android Studio 运行选项下拉

暂无
暂无

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

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