简体   繁体   中英

build Apk on physical device crash android studio flutter

When I build my app on emulator (android 11 API 30) it's working fine, but when I try building on my old physical device (Android Kitkat API 19) It crash.

Edit: Yes developer options is enabled

But when I run terminal flutter build apk --split-per-abi or flutter run --release it works I can run it on physical device

I know I need armeabi v7 to make it work on my phone but its annoying to have to use console everytime I want to build

Unless I'm doing it wrong how do I build this on my IDE

Edit 2: Here's my 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"
    }

You can add a custom run configuration to execute any shell script.

To do so in Android Studio, go to Run -> Edit Configurations...

Android Studio 编辑配置... 选项

In the configurations window, click the + icon and select Shell Script

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). For the "Script options", you can add the options you would like Flutter to execute such as build apk --split-per-abi or run --release

Android Studio Shell 脚本选项

At this point, you can click apply and ok. You should now see this custom runner in the drop down menu where you can run different tasks.

Android Studio 运行选项下拉

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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