Closed CaptnBlubber closed 7 years ago
That's because with Jack, there are no intermediary .class
files for Javassist to do its bytecode manipulation magic on, so it's expected that it would fail.
There is an open bug on b.android.com
here for making it possible for Realm and Jack to work together: https://code.google.com/p/android/issues/detail?id=210730&q=Jack%20transform&colspec=ID%20Status%20Priority%20Owner%20Summary%20Stars%20Reporter%20Opened
But as @Zhuinden says, right now that isn't possible.
Dear sir, i also used gradle to enable Jack build on Jdk8 and with a condition that need to prepend a framework.jar into the classpaht, so i configured tasks.withType(JavaCompile){...} to use options.compilerArgs.add(...), but it seems could not work when use Jack compile, do you have any idea how to fix it? please connect with me: cwvinus@163.com
@cw1427 as comment https://github.com/realm/realm-java/issues/3038#issuecomment-227413435 said, we cannot support Jack simply because of google doesn't support transformer for Jack... At this moment, there is quite little thing we can do.
Jack can now
annotationProcessor 'com.google.dagger:dagger-compiler:2.0'
to use the dagger. The same reasoning is supported by realm
see http://tools.android.com/tech-docs/jackandjill#TOC-Compilation-support
@henjue Realm doesn't only require the annotation processor but also the byte code manipulation (transform API) which is not supported by JACK yet AFAIK. We did reported an issue to google, see https://github.com/realm/realm-java/issues/3038#issuecomment-227413435
@henjue Realm requires the Transform API to allow you to use custom methods (and interface implementations) in RealmObject classes, and allow field access rather than mandatory getters/setters.
The transform API manipulates the bytecode in generated .class
files. Jack does not create .class
files, and Jack doesn't provide a hook for anything similar.
Damm! I would love to use Jack and Java 8 How can we build pressure on your feature request to get it implemented?
Does anybody know a guy of the android tool dev team?
I get
Error:Could not get unknown property 'classpath' for task ':app:transformJackWithJackForDebug' of type com.android.build.gradle.internal.pipeline.TransformTask.
while trying to add apply plugin: 'realm-android'
with classpath 'io.realm:realm-gradle-plugin:1.2.0', classpath 'com.android.tools.build:gradle:2.2.0' and the jack compiler
Jack does not support the Transform API yet.
Realm uses the Transform API, so Jack doesn't work with Realm yet.
The same problem. Does Realm has any other method to resolve it?
No, we need to transform the intermediate code for our approach to work
The same issue I faced recently, I read all your comments, sad.
@WaylanPunch I have a workaround. See this #2630 Hope it helps
@kirsting Thanks, I would like to try your solution tonight.
It is doable
Retrolambda works without problems in the meantime.
There seems to be some kind of advance in this on regards of Google: https://android.googlesource.com/toolchain/jack/+/ub-jack/jack-samples/jack-transform-plugin/
https://android-developers.googleblog.com/2017/03/future-of-java-8-language-feature.html
Google decided to deprecate the Jack tool chain. So there is no point for Realm to support it.
Goal
Enable Jack Compilation + Java 1.8 Compatibility.
Expected Results
Successful Builds
Actual Results
Steps & Code to Reproduce
Other Libraries using Annotation Processing Like Dagger2 do work using
annotationProcessor
Code Sample
Version of Realm and tooling
Realm version(s): 1.0.0 & 1.0.1 Tested
Android Studio version: 2.2 Preview 3