升级到最新支持库后出现Android JACK编译器错误 [英] Android JACK compiler error after upgrade to latest support library

查看:213
本文介绍了升级到最新支持库后出现Android JACK编译器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


- Android Studio 2.2.3(Windows 10 64位)
$ b - 构建工具版本25



- Android Gradle插件版本2.2.3


升级到最新的支持库之后(25.1。 0和23.4.0)以及编译版本的改变(25从23)我得到这个错误:


错误:com.android.sched .util.config.PropertyIdException:属性'jack.library.import'(在选项中):元素#7:库文件的版本'.. \app\build\intermediates\transforms\preJackPackagedLibraries\ debug'\\jars\8000\1f\classes-1b6639e8217419d056942b0dacd1542739f1709f.jar'不再受支持。 Library版本:3.2 - 当前版本:3.3 - 最低兼容版本:3.3
...
BUILD FAILED


有没有人有过这个问题?在提到的.jar文件中,我可以找到一些AnimatedVectorDrawble相关的文件。我的应用 build.gradle
android {
compileSdkVersion 25
buildToolsVersion '25 .0.2'

  defaultConfig {
applicationId包
minSdkVersion 14
targetSdkVersion 25
versionCode 111
versionName1.1.1
}

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

compileOptions {
sourceCompatibility JavaVersion .VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

dexOptions {
maxProcessCount 4
javaMaxHeapSize2g
}

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
}
}

}

解决方案

根据错误消息,似乎支持杰克的构建不会处理更新Gradle构建设置的所有情况。杰克保留了预先编译的内容( preJackPackagedLibraries )的缓存,并且更改了某些内容导致Jack不喜欢该预编译的内容。理想情况下,构建系统会检测到这种情况,只是重新编译它,但显然它不会。



清理项目(Build> Clean Project)希望清除这个在所有情况下都存在问题。


--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
    }
}

}

解决方案

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.

这篇关于升级到最新支持库后出现Android JACK编译器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆