1

Anyone know what I'm missing? My program worked 5 minutes ago and know I have this strange error:

17:16:38 UnsupportedMethodException
         Unsupported method: AndroidArtifactOutput.getOutputFile().
         The version of Gradle you connect to does not support that method.
         To resolve the problem you can change/upgrade the target version of Gradle you connect to.
         Alternatively, you can ignore this exception and read other information from the model.: Unsupported method: AndroidArtifactOutput.getOutputFile().
         The version of Gradle you connect to does not support that method.
         To resolve the problem you can change/upgrade the target version of Gradle you connect to.
         Alternatively, you can ignore this exception and read other information from the model.

I can't ignore it because I can not run it anymore on my android device, anyone?

Build.gradle file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "20.0.0"

    defaultConfig {
        applicationId "com.example.test.google_maps_task_1"
        minSdkVersion 11
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile 'com.google.android.gms:play-services:4.2.42'
    compile 'com.android.support:appcompat-v7:21.+'
    compile 'org.apache.httpcomponents:httpclient-android:4.3.5.1'

}
Theo Jansen
  • 81
  • 1
  • 4
  • 11

1 Answers1

1

As I thought, there are many out of date plugins/tools here. Please try this fixed and updated build.gradle:

Also, make sure you are using the latest build plugin: com.android.tools.build:gradle:1.1.3.

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22 // <-- was 21
    buildToolsVersion "22.0.1" // <-- was 20.0.0

    defaultConfig {
        applicationId "com.example.test.google_maps_task_1"
        minSdkVersion 11
        targetSdkVersion 22 // <-- was 21
        versionCode 1
        versionName "1.0"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile 'com.google.android.gms:play-services:6.5.87' // <-- was 4.2.42
    compile 'com.android.support:appcompat-v7:22.0.0' // <-- was 21.+
    compile 'org.apache.httpcomponents:httpclient-android:4.3.5.1' // (the only up to date plugin you had)
}
Jared Burrows
  • 54,294
  • 25
  • 151
  • 185
  • I'm using the locationclient in an activity, but these lines are still red? How can I fix that? – Theo Jansen Mar 25 '15 at 17:32
  • @TheoJansen What are "these lines are still red"? When is the last time you updated your sdk with your sdks manager? – Jared Burrows Mar 25 '15 at 17:46
  • I installed the now android studio couple minutes ago, ye the red lines i mean with that that he cannot find the LocationClient – Theo Jansen Mar 25 '15 at 17:47
  • Are you using a deprecated version? You are now changing your question. Look here: http://stackoverflow.com/a/25173057/950427 – Jared Burrows Mar 25 '15 at 17:48