簡體   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