parceler icon indicating copy to clipboard operation
parceler copied to clipboard

Annotation Processor -source '1.8' causes Execution failure

Open dgngulcan opened this issue 8 years ago • 5 comments

When annotationProcessor 'org.parceler:parceler:1.1.8' line added to gradle file, I get the error below. Without it, build is successful.

Warning:Supported source version 'RELEASE_7' from annotation processor 'android.arch.lifecycle.LifecycleProcessor' less than -source '1.8' Error:Execution failed for task ':app:compileDebugJavaWithJavac'. java.lang.NullPointerException

App level gradle file


android {

    compileSdkVersion 25
    buildToolsVersion "25.0.3"

    defaultConfig {
        applicationId "com.package"
        minSdkVersion 21
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true

    }

    buildTypes {
        debug {
            applicationIdSuffix ".debug"
            buildConfigField "Boolean", "DEBUG_MODE", "true"
        }
        release {
            minifyEnabled false
            buildConfigField "Boolean", "DEBUG_MODE", "false"
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    dexOptions {
        javaMaxHeapSize "2g"
    }

    dataBinding {
        enabled = true
    }

    compileOptions {
        targetCompatibility 1.8
        sourceCompatibility 1.8
    }

}

ext {
    supportLibVersion = '25.3.1'
    playServicesVersion = '10.2.6'
    archLifecycleVersion = '1.0.0-alpha1'
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:multidex:1.0.1'
    compile "com.android.support:design:${supportLibVersion}"
    compile "com.android.support:cardview-v7:${supportLibVersion}"
    compile "com.android.support:customtabs:${supportLibVersion}"
    compile "com.android.support:appcompat-v7:${supportLibVersion}"
    compile 'com.android.support.constraint:constraint-layout:1.0.2'

    compile "com.google.firebase:firebase-core:${playServicesVersion}"
    compile "com.google.firebase:firebase-crash:${playServicesVersion}"
    compile "com.google.firebase:firebase-perf:${playServicesVersion}"
    compile "com.google.firebase:firebase-messaging:${playServicesVersion}"

    compile "com.google.android.gms:play-services-maps:${playServicesVersion}"
    compile "com.google.android.gms:play-services-location:${playServicesVersion}"

    compile "android.arch.lifecycle:runtime:${archLifecycleVersion}"
    compile "android.arch.lifecycle:extensions:${archLifecycleVersion}"
    annotationProcessor "android.arch.lifecycle:compiler:${archLifecycleVersion}"

    compile 'org.parceler:parceler-api:1.1.8'
    annotationProcessor 'org.parceler:parceler:1.1.8'


    compile 'com.squareup.retrofit2:retrofit:2.3.0'
    compile 'com.squareup.retrofit2:converter-gson:2.3.0'
    compile 'com.squareup.okhttp3:okhttp:3.8.0'
    compile 'com.squareup.okhttp3:logging-interceptor:3.8.0'

    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'com.afollestad.material-dialogs:core:0.9.4.4'
    compile 'com.github.safetysystemtechnology:android-shake-detector:v1.2'
    compile 'javax.annotation:javax.annotation-api:1.3'

    compile('com.github.hotchemi:permissionsdispatcher:2.4.0') {
        // if you don't use android.app.Fragment you can exclude support for them
//        exclude module: "support-v13"
    }
    annotationProcessor 'com.github.hotchemi:permissionsdispatcher-processor:2.4.0'
}

apply plugin: 'com.google.gms.google-services'

Project level gradle file

    repositories {
        jcenter()
        mavenCentral()
        maven { url "https://maven.google.com" }

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0-alpha2'
        classpath 'com.google.gms:google-services:3.1.0'
    }
}

allprojects {
    repositories {
        jcenter()
        mavenCentral()
        maven { url 'https://jitpack.io' }
        maven { url "https://maven.google.com" }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

dgngulcan avatar May 28 '17 15:05 dgngulcan

Strange, since Parceler should support Java 1.8 (Or "latestSupported") Any clue what the system property java.specification.version value is?

johncarl81 avatar May 28 '17 22:05 johncarl81

Also, can you provide an example of this issue so I can diagnose and fix?

johncarl81 avatar May 28 '17 22:05 johncarl81

I am using Android Studio 3.0 preview with the embedded JDK comes in it. Tried with Oracle JDK but didn't make difference.

The build is successful when I remove the line annotationProcessor 'org.parceler:parceler:1.1.8'

But with it, it gives the error

Warning:Supported source version 'RELEASE_7' from annotation processor 'android.arch.lifecycle.LifecycleProcessor' less than -source '1.8'

dgngulcan avatar May 29 '17 06:05 dgngulcan

When I change the source compatibility I get a slew of errors from Android. I don't believe Android is compatible with Java 1.8, isn't that correct?

johncarl81 avatar Dec 31 '17 17:12 johncarl81

It is not fully compatible but some functions can be used as written https://developer.android.com

dgngulcan avatar Jan 02 '18 16:01 dgngulcan