uPhyca / gradle-android-aspectj-plugin

A Gradle plugin which enables AspectJ for Android builds.
Apache License 2.0
279 stars 55 forks source link

Java 8 not supported #6

Closed fschoellhammer closed 10 years ago

fschoellhammer commented 10 years ago

I have a simple project using retrolambda, but after I integrate aspectJ, it fails with:

Error:Execution failed for task ':app:compileDebugAspectj'.

The type java.lang.invoke.MethodHandles cannot be resolved. It is indirectly referenced from required .class files

My gradle build file:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'me.tatarka:gradle-retrolambda:2.3.1'
        classpath 'com.uphyca.gradle:gradle-android-aspectj-plugin:0.9.7'
    }
}

apply plugin: 'com.android.application'

android {
    compileSdkVersion 20
    buildToolsVersion "20.0.0"

    defaultConfig {
        applicationId "user.com.myapplication"
        minSdkVersion 15
        targetSdkVersion 20
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    compileOptions {
        sourceCompatibility org.gradle.api.JavaVersion.VERSION_1_8
        targetCompatibility org.gradle.api.JavaVersion.VERSION_1_8
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
}

apply plugin: 'retrolambda'

retrolambda {
    jdk System.getenv("JAVA8_HOME")
    oldJdk System.getenv("JAVA7_HOME")
}

apply plugin: 'android-aspectj'

I tried to set it up manually, using the gradle script in http://fernandocejas.com/2014/08/03/aspect-oriented-programming-in-android/ and that seems to work.

esmasui commented 10 years ago

We don't support Java 8 at this time.