Head towards j8 and Jack. Gradle Sync Error

Hi guys, I want to use the lamba functions available in Java8, so I had to use the new Jack toolchain. Unfortunately, when I made an unexpected error. Namely:

Failed to get unknown property 'classpath' for task ': app: transformJackWithJackForProdDebug' like com.android.build.gradle.internal.pipeline.TransformTask. I use in my project library for example

In the project, I use lib as:

  • Dagger
  • Rxjava

I know that the dagger causes an error, however, since July dagger2 became available for use.

I use

  • Android Studio 2.1.2
  • Gradle Version 2.14.1
  • Android Plugin Version 2.2.0-alpha7

Look at my gradle

Project /buidl.gradle

buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.2.0-alpha7' // classpath 'com.android.tools.build:gradle:2.2.0-alpha3' classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { jcenter() } } task clean(type: Delete) { delete rootProject.buildDir } 

application /build.gradle

 apply plugin: 'com.android.application' apply plugin: 'com.neenbedankt.android-apt' android { compileSdkVersion 24 buildToolsVersion '24.0.0' defaultConfig { applicationId "XXX" minSdkVersion 19 targetSdkVersion 21 versionCode 1 versionName "1.0" jackOptions{ enabled true } } buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } debug { minifyEnabled false versionNameSuffix "_debug" } } productFlavors{ dev{ minSdkVersion 21 } prod { minSdkVersion 19 } } compileOptions{ sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } } ext { JUNIT_VERSION = '4.12' DAGGER_VERSION = '2.4' } dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') testCompile "junit:junit:$JUNIT_VERSION" compile project(path: ':android_mvp') // dependency injection apt 'com.google.dagger:dagger-compiler:2.0' // 2.5 causes error compile 'com.google.dagger:dagger:2.0' provided 'javax.annotation:jsr250-api:1.0' annotationProcessor 'com.google.dagger:dagger-compiler:2.0' // for new Jack and Jill gradle 2.2.+ // rx java compile 'io.reactivex:rxjava:1.1.6' compile 'io.reactivex:rxandroid:1.2.1' // RxAndroid providing Android Scheduler compile 'io.reactivex:rxjava-joins:0.22.0' // view compile 'com.android.support:appcompat-v7:24.1.1' compile 'com.android.support:design:24.1.1' compile 'com.android.support:recyclerview-v7:24.1.1' compile 'com.android.support:cardview-v7:24.1.1' // rest / stream compile 'com.squareup.retrofit2:retrofit:2.0.0-beta4' compile 'com.squareup.retrofit2:adapter-rxjava:2.0.0-beta4' compile 'com.squareup.retrofit2:converter-gson:2.0.0-beta4' compile 'com.squareup.okhttp3:logging-interceptor:3.2.0' compile 'com.squareup.okhttp3:okhttp:3.2.0' compile 'com.neovisionaries:nv-websocket-client:1.29' // time compile 'net.danlew:android.joda:2.9.3' } 

EDITED

  • Good, since I read Lambdas which are not supported in a project module, since you want to use lambdas in project modules - just forget it.
  • So, I deleted my own module and copied all the code into the main module of the application.
  • I ended up successfully creating gradle by removing the following lines of code from the /build.gradle application

apply plugin: 'com.neenbedankt.android-apt' ... dependency{ apt 'com.google.dagger:dagger-compiler:2.0' // 2.5 causes error }

  1. However, the error associated with the dagger remains, its value means that sometimes the project could be rebuilt, sometimes it was written by a very long stacktrace.

Conclusion

2.5 years after the first release of j8, the lazy Android team cannot integrate it. 2.5 years in IT is a lot, so my software skills are slowly becoming obsolete! I hope they run out before j9 release!

+5
source share
1 answer

There was the same problem. Solved using the built-in "annotationProcessor" instead of the "apt" plugin

fooobar.com/questions/220551 / ...

delete:

 classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' apply plugin: 'com.neenbedankt.android-apt' apt 'com.google.dagger:dagger-compiler:2.0' 

and you already have

 dependencies { annotationProcessor 'com.google.dagger:dagger-compiler:2.0' } 

It does the same as the apt plugin.

+18
source

All Articles