2016-07-14 89 views
-3

我開發了一款Android應用程序,該應用程序在棒棒糖設備中運行良好,但在KitKat設備中崩潰。請幫我找到解決方案。應用程序在棒棒糖中運行良好,但在KitKat中崩潰

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 19 
    buildToolsVersion '21.1.1' 
    defaultConfig { 
     applicationId "com.example.itsoft37.kitkat" 
     minSdkVersion 11 
     targetSdkVersion 19 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 
     } 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile 'com.android.support:appcompat-v7:19.1.0' 
} 

不幸在設備上停止顯示錯誤。

當我改變了API版本

回答

0

..

apply plugin: 'com.android.application' 

    android { 
     compileSdkVersion 19 
     buildToolsVersion '19.1.0' 

     defaultConfig { 
    applicationId "com.example.itsoft37.kitkat" 
    minSdkVersion 11 
    targetSdkVersion 19 
     } 

     buildTypes { 
    release { 
     minifyEnabled false 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 
      } 
     } 
    } 

    dependencies { 
     compile fileTree(dir: 'libs', include: ['*.jar']) 
     compile 'com.android.support:appcompat-v7:19.1.0' 
    } 

此錯誤將顯示.. 錯誤:執行失敗的任務 ':應用程序:transformClassesWithDexForDebug'。

com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Multi dex requires Build Tools 21.0.0/Current: 19.1

+0

附加multiDexEnabled在defaultconfig真實,並嘗試 – Karthik

+0

如果你仍然得到異常意味着改變buildToolsVersion到21.1.2 – Karthik

+0

我嘗試it..but仍然..顯示不幸停止.. –

0

應用插件: 'com.android.application'

android { 
    compileSdkVersion 19 
    buildToolsVersion '19.1.0' 

    defaultConfig { 
applicationId "com.example.itsoft37.kitkat" 
minSdkVersion 11 
targetSdkVersion 19 

**multiDexEnabled true** 
    } 

    buildTypes { 
release { 
    minifyEnabled false 
    proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 
     } 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile 'com.android.support:appcompat-v7:19.1.0' 


    **compile 'com.android.support:multidex:1.0.1'** 
} 
相關問題