1

I am new to using Realm database for Android.

I modified my gradle files to include the Jack toolchain so that I could use Java 8 language features. I also modified the gradle files to install the Realm plugin. When I synced the project gradle files, I received the following error: Error:Could not find property 'options' on task ':app:compileDebugJavaWithJack'. The two modifications work fine on their own, but for some reason I cannot have both at the same time.

I would very much appreciate help on this matter.

novice
  • 285
  • 1
  • 2
  • 9
  • 1
    http://stackoverflow.com/questions/23318109/is-it-possible-to-use-java-8-for-android-development check this answer? – Eenvincible Aug 01 '16 at 16:52

2 Answers2

7

It is not possible to use Jack compiler with Realm at the moment, because Jack does not support bytecode manipulation (Javassist / Transform API).

In order to use lambdas, it's easier for you to use Retrolambda instead for the time being.

buildscript {
     //...
     dependencies {
        classpath "io.realm:realm-gradle-plugin:1.1.0"
        classpath 'me.tatarka:gradle-retrolambda:3.2.5'
    }
}

And

apply plugin: 'me.tatarka.retrolambda'
apply plugin: 'realm-android'

android {
    ...

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
EpicPandaForce
  • 79,669
  • 27
  • 256
  • 428
3

Unfortunately Jack compiler and Realm can't play together right now. Please follow that topic. That one is also useful.

Divers
  • 9,531
  • 7
  • 45
  • 88