java - Android Studio build errors with jack enabled -


so switched android studio default jdk java 8, use lambda expressions. had enable jack let gradle build, when try rebuild applicaiton, getting 3 different errors seem coming jack. can't seem find root of of these problems, , stay building j8. insight or appreciated. here errors getting during build:

1)

error:library reading phase: type javax.inject.named file 'c:\users\nicholas\androidstudioprojects\baseintegrations\app\build\intermediates\jill\debug\packaged\javax.inject-2.4.0-b10-e2682135301b663484690f1d3a4a523bcea2a732.jar' has been imported file 'c:\users\nicholas\androidstudioprojects\baseintegrations\app\build\intermediates\jill\debug\packaged\javax.inject-1-4a242883e90a864db3b80da68e11a844f842d2df.jar', type 'javax.inject.named' (see property 'jack.import.type.policy' type collision policy)

2)

error:com.android.jack.jackabortexception: library reading phase: type javax.inject.named file 'c:\users\nicholas\androidstudioprojects\baseintegrations\app\build\intermediates\jill\debug\packaged\javax.inject-2.4.0-b10-e2682135301b663484690f1d3a4a523bcea2a732.jar' has been imported file 'c:\users\nicholas\androidstudioprojects\baseintegrations\app\build\intermediates\jill\debug\packaged\javax.inject-1-4a242883e90a864db3b80da68e11a844f842d2df.jar', type 'javax.inject.named' (see property 'jack.import.type.policy' type collision policy)

3)

error:com.android.jack.backend.jayce.typeimportconflictexception: type javax.inject.named file 'c:\users\nicholas\androidstudioprojects\baseintegrations\app\build\intermediates\jill\debug\packaged\javax.inject-2.4.0-b10-e2682135301b663484690f1d3a4a523bcea2a732.jar' has been imported file 'c:\users\nicholas\androidstudioprojects\baseintegrations\app\build\intermediates\jill\debug\packaged\javax.inject-1-4a242883e90a864db3b80da68e11a844f842d2df.jar', type 'javax.inject.named' (see property 'jack.import.type.policy' type collision policy)

4)

:app:compiledebugjavawithjack failed error:execution failed task ':app:compiledebugjavawithjack'. java.io.ioexception: com.android.jack.api.v01.compilationexception: library reading phase: type javax.inject.named file 'c:\users\nicholas\androidstudioprojects\baseintegrations\app\build\intermediates\jill\debug\packaged\javax.inject-2.4.0-b10-e2682135301b663484690f1d3a4a523bcea2a732.jar' has been imported file 'c:\users\nicholas\androidstudioprojects\baseintegrations\app\build\intermediates\jill\debug\packaged\javax.inject-1-4a242883e90a864db3b80da68e11a844f842d2df.jar', type 'javax.inject.named' (see property 'jack.import.type.policy' type collision policy)

here app level build.gradle:

android {     compilesdkversion 24     buildtoolsversion "24.0.1"      defaultconfig {         applicationid "com.nicholas.baseintegrations"         minsdkversion 16         targetsdkversion 24         versioncode 1         versionname "1.0"          jackoptions {             enabled true         }     }     buildtypes {         release {             minifyenabled false             proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro'         }     }     uselibrary  'org.apache.http.legacy'      compileoptions {         sourcecompatibility = javaversion.version_1_8         targetcompatibility = javaversion.version_1_8     } }  dependencies {     compile filetree(dir: 'libs', include: ['*.jar'])     testcompile 'junit:junit:4.12'     compile 'com.android.support:appcompat-v7:24.2.0'     compile 'com.google.android.gms:play-services-gcm:9.4.0'     compile project(path: ':backend', configuration: 'android-endpoints')     compile "com.getbase:basecrm-java:1.4.3"     compile 'com.android.support:recyclerview-v7:24.2.0'     compile 'com.android.support:palette-v7:24.2.0'     compile 'com.android.support:cardview-v7:24.2.0'     compile 'com.android.support:design:24.2.0'     compile group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.21'     compile group: 'org.glassfish.jersey.media', name: 'project', version: '2.23.2', ext: 'pom' } 

all appreciated, know new things, cannot seem find questions regarding jack/j8 build process. in advance.

we're looking this, think it's due different behavior of android gradle plugin jack , javac. workaround, can try in jackoptions

additionalparameters = [ "jack.import.type.policy" : "keep-first" ] 

but aware option, jack keep first definition of class encounters.

you can track our progress here: https://code.google.com/p/android/issues/detail?id=222273


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -