awslabs / aws-device-farm-gradle-plugin

Gradle plugin for AWS Device Farm.
Apache License 2.0
61 stars 32 forks source link

Issue using within Java 7 project #1

Closed awjones76 closed 8 years ago

awjones76 commented 8 years ago

This plugin is compiled using Java 8 which is causing issues within my Android project (using Java 7). I receive the following error within my Android project when trying to use this plugin: "Unsupported major.minor version 52.0".

If I change my Android project to use JDK 8, then the plugin works but I would rather not use JDK 8 within my project since it is not yet officially supported.

Is there something I am doing wrong, or is it possible to update this plugin so it is compatible with Java 7?

kkozmic-seek commented 8 years ago

I just hit the same problem (masked by very confusing java.lang.IllegalStateException: buildToolsVersion is not specified.)

Are there any plans to fix this?

michael-b-willingham commented 8 years ago

We are currently exploring making the plugin compatible with Java 7. In the meantime, the recommended course of action is to use the Java 8 SDK in Android Studios.

kkozmic-seek,

buildToolsVersion is not specified.

is typically thrown when the android gradle plugin is misconfigured.

Using the sample at http://developer.android.com/tools/building/configuring-gradle.html:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 19
    buildToolsVersion "19.0.0"

    defaultConfig {
        minSdkVersion 8
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile project(":lib")
    compile 'com.android.support:appcompat-v7:19.0.1'
    compile fileTree(dir: 'libs', include: ['*.jar'])
}

That error occurs when

buildToolsVersion "19.0.0"

is removed from the android gradle configuration.

kkozmic-seek commented 8 years ago

Hi @michael-b-willingham thanks for getting back to me.

Any ETA for when Java 7 support will go live?

As for the buildToolsVersion issue, I think it's a red herring. We most definitely have that configured in our build.gradle (set to buildToolsVersion "23.0.2" if that makes any difference to device farm plugin)

michael-b-willingham commented 8 years ago

We're actively working on the java 7 support for this plugin. You can expect to see a pull request soon.

awjones76 commented 8 years ago

Awesome... Looking forward to Java 7 support!

michael-b-willingham commented 8 years ago

Here's the pull request. Once it gets reviewed, I'll upload the artifacts to maven central as v1.2 and push the changes to the awslabs master repo.

https://github.com/awslabs/aws-device-farm-gradle-plugin/pull/8/files

kkozmic-seek commented 8 years ago

nicely done @michael-b-willingham

michael-b-willingham commented 8 years ago

The new artifacts were deployed to maven. You should be good to try it. Here's the new gradle dependency:

classpath 'com.amazonaws:aws-devicefarm-gradle-plugin:1.2'