Android JACK compiler error after upgrade to latest support library

馋奶兔 提交于 2019-12-04 17:46:02

问题


--Android Studio 2.2.3 (Windows 10 64 bit)

--Build Tools version 25

--Android Gradle Plugin Version 2.2.3

After upgrade to latest support libraries (25.1.0 from 23.4.0) and change of compile version (25 from 23) I get this error:

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

Has anyone ever had this problem? In the mentioned .jar file I can find some AnimatedVectorDrawble related files. My app 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
    }
}

}


回答1:


Based on the error message, it appears that Jack-enabled builds do not handle all cases where you update Gradle build settings. Jack keeps a cache of pre-compiled stuff (preJackPackagedLibraries), and something that you changed caused Jack to not like that pre-compiled material. Ideally, the build system would detect this case and simply re-compile it, but apparently it does not.

Cleaning the project (Build > Clean Project) hopefully clears up this problem in all cases.



来源:https://stackoverflow.com/questions/41144329/android-jack-compiler-error-after-upgrade-to-latest-support-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!