9

--Android Studio 2.2.3 (Windows 10 64 bit)升級到最新的支持庫後,Android JACK編譯器錯誤

--Build Tools version 25

--Android Gradle Plugin Version 2.2.3

後升級到最新的支持庫(25.1.0從23.4.0)和(23 25)的編譯版本更改我得到這個錯誤:

Error:com.android.sched.util.config.PropertyIdException: Property 'jack.library.import' (in Options): element #7: The version of the library file '..\app\build\intermediates\transforms\preJackPackagedLibraries\debug\jars\8000\1f\classes-1b6639e8217419d056942b0dacd1542739f1709f.jar' is not supported anymore. Library version: 3.2 - Current version: 3.3 - Minimum compatible version: 3.3 ... BUILD FAILED

有沒有人有過這個問題?在提到的.jar文件中,我可以找到一些AnimatedVectorDrawble相關的文件。我的應用程序的build.gradle 的Android { compileSdkVersion 25 buildToolsVersion '25 .0.2'

defaultConfig { 
    applicationId "package" 
    minSdkVersion 14 
    targetSdkVersion 25 
    versionCode 111 
    versionName "1.1.1" 
} 

defaultConfig { 
    vectorDrawables.useSupportLibrary = true 
    jackOptions.enabled = true 
} 

compileOptions { 
    sourceCompatibility JavaVersion.VERSION_1_8 
    targetCompatibility JavaVersion.VERSION_1_8 
} 

dexOptions { 
    maxProcessCount 4 
    javaMaxHeapSize "2g" 
} 

buildTypes { 
    release { 
     minifyEnabled false 
     useProguard false 
     shrinkResources false 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
    } 
    debug { 
     minifyEnabled false 
     useProguard false 
     shrinkResources false 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     applicationIdSuffix ".dev" 
     versionNameSuffix "-DEV" 
     ext.enableCrashlytics = false 
    } 
} 

}

+2

您是否嘗試過清潔項目?也許傑克在嘗試使用新設置時不喜歡以前的版本(使用舊設置)? – CommonsWare

+0

@CommonsWare哦,謝謝!清理/構建後,我得到了一些關於棄用的其他錯誤,但它們很容易解決!非常感謝! –

回答

25

基於該錯誤消息,似乎使傑克版本不處理所有案件更新Gradle構建設置。傑克保留了預先編譯的內容(preJackPackagedLibraries)的緩存,並且您更改的內容導致Jack不喜歡該預編譯的內容。理想情況下,構建系統會檢測到這種情況並簡單地重新編譯它,但顯然它不會。

清理項目(Build> Clean Project)希望在所有情況下都能清除這個問題。

+0

謝謝,它運作良好。 –

+0

謝謝你,你是男人 – 7geeky

相關問題