Unable to instantiate application com.android.tools.fd.runtime.BootstrapApplication

Android Studio更新到最新的2.2.3 ,如果編譯工具的配置爲

android {
    useLibrary 'org.apache.http.legacy'
    compileSdkVersion 25
    buildToolsVersion '24.0.3'
    defaultConfig {
        applicationId "com.xxxx"
        minSdkVersion 16
        targetSdkVersion 23
        versionName "1.0.6"
        versionCode versionCodeThinkId

        ndk {
            // 設置支持的SO庫架構
            abiFilters 'armeabi', 'x86'//, 'armeabi-v7a', 'x86_64', 'arm64-v8a'
            //
        }
        vectorDrawables.useSupportLibrary = true
        multiDexEnabled true

    }

這種情況下會出現這個bug, app啓動直接閃退

修復方法:

更新至最新的build-tools

android {
    useLibrary 'org.apache.http.legacy'
    compileSdkVersion 25
    buildToolsVersion '25.0.2'
    defaultConfig {
        applicationId "com.xxxx"
        minSdkVersion 16
        targetSdkVersion 23
        versionName "1.0.6"
        versionCode versionCodeThinkId

        ndk {
            // 設置支持的SO庫架構
            abiFilters 'armeabi', 'x86'//, 'armeabi-v7a', 'x86_64', 'arm64-v8a'
            //
        }
        vectorDrawables.useSupportLibrary = true
        multiDexEnabled true

    }

保證 compileSdkVersion 和 buildToolsVersion 的大版本號統一 ,修改之後,不會再出現了

發佈了71 篇原創文章 · 獲贊 25 · 訪問量 37萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章