Gradle throws an error "Could not create a plugin like" AppPlugin ""

I am trying to create a simple Android project with gradle. I work on a computer with Debian GNU / Linux 7 "wheezy".

I followed the recommendations in the Gradle Plugin User Guide - Android Tools Project Site , but it gives an error message:

FAILURE: Build failed with an exception. * Where: Build file '/home/alex/Proyectos/MyLogin/build.gradle' line: 11 * What went wrong: A problem occurred evaluating root project 'MyLogin'. > Could not create plugin of type 'AppPlugin'. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED Total time: 4.817 secs 

I followed the specs:

  • Gradle 1.9
  • Plugin 0.7
  • SDK 17+ (actually 19)

I also ran the project again, and the results that I showed were issued by the gradle tasks command, as shown in the documentation.

I also tried gradle 1.10, but the result is the same.

Even this question was not useful, as it solved with the upgrade to gradle 1.6 (I understand that plugin 0.7 requires at least gradle 1.9).

I tried this after an error with the same error in Android Studio and IntelliJ Idea .

EDIT: I also tried with new projects in both IDEs and got the same problem. But what surprises me most is that both IDEs use gradle 1.8 in their wrapped form. I tried to configure both of them to use a local gradle installation, but still the same question.

What am I doing wrong? This is mistake? How can I avoid the problem?

Please help me.

EDIT: Here is my build.gradle

 buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.7.+' } } apply plugin: 'android' repositories { mavenCentral() } android { compileSdkVersion 14 buildToolsVersion '19.0.1' defaultConfig { minSdkVersion 14 targetSdkVersion 19 } } sourceCompatibility = 1.6 version = '0.1' dependencies { compile 'com.android.support:support-v4:18.0.0' //compile project(':core') } 
+74
android gradle
Dec 28 '13 at 5:53 on
source share
10 answers

Google made a mistake with version 0.7.2 of the Gradle plugin:

Note: 0.7.2 requires Java7. This is mistake. Use 0.7.3 instead.

Version 0.7.3 includes Java6 support again. Declaring Gradle 0.7.3 in my build files really resolves this for me.

Nobody is perfect:)

http://tools.android.com/tech-docs/new-build-system

+26
Jan 08 '14 at 2:22
source share

Use Gradle 1.9 instead of Gradle 1.10. There is a problem since 1.10: https://code.google.com/p/android/issues/detail?id=63822

Also answered here:

Cannot find org.gradle.api.artifacts.result.ResolvedModuleVersionResult when applying Android plugin in Gradle

+22
Dec 28 '13 at 18:14
source share

I worked using Gradle 1.10 with the Gradle 0.8.0 plugin.

 // /build.gradle // Top-level build file where you can add configuration // options common to all sub-projects/modules. buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.8.+' } } 

...

 # /gradle/wrapper/gradle-wrapper.properties. #Sat Feb 01 20:41:29 CET 2014 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-bin.zip 
+19
Feb 01 '14 at 21:26
source share

If you use the command line to create a project as follows:

 android create project -g -v 1.2.2 --target 1 --name rtest --path rtest --activity MainActivity --package com.mydomain.rtest 

The project was created to use version 1.2.2 for android-gradle-plugin, but the project is initialized with gradle 1.12, which is incompatible .

To fix this, follow these steps:

  • Open rtest/gradle/wrapper/gradle-wrapper.properties and set distributionUrl to the version you need; for example: http\://services.gradle.org/distributions/gradle-2.2.1-all.zip (do not forget to leave the colon - yes, this also makes me smile);
  • Open build.gradle and change runProguard false to minifyEnabled false ;
  • ./gradlew clean && ./gradlew assembleDebug
  • I also delete the hidden .gradle folder, but I'm not sure if this is necessary

And it all works again.

+6
Jun 10 '15 at 13:06
source share

If you are trying to upgrade your Gradle 1.9 project to Gradle 1.10 using

 task wrapper(type: Wrapper) { gradleVersion = '1.10' } 

and the ./gradlew wrapper command you get the same error as above.

The solution is to install Gradle 1.10 on your computer and update the project without using the shell

gradle wrapper

+1
Jan 24 '14 at 9:30
source share

You may also get this error if you upgrade your gradle system and run the Android Studio gradle home update.

+1
Mar 07 '14 at 4:16
source share

For those using the 2.1 studio version, replace classpath 'com.android.tools.build: gradle: 2.1.0-rc1' with classpath 'com.android.tools.build:gradle:2.1 +0.0'. This solved my problem.

+1
Jul 29 '16 at 7:28
source share

I got this today when running gradle assembleRelease. I installed Ubuntu by default gradle -1.4. This did not work, so I tried the latest version of gradle -1.12 and got the same problem.

Downloading and using gradle -1.10 (and matching my gradle -wrapper.properties file with this version) resolved the issue.

This is with Android Studio 0.5.8.

0
May 27 '14 at 22:05
source share

Ok, I think android studio has an answer to this question in order to get this error using the GUI,

I had such a mistake ... enter image description here

after updating the plugins, I ran into other problems when building,

enter image description here

therefore changes the gradle setting to the default value as shown in the image, enter image description here

After that, the assembly was successful.

0
Jan 21 '16 at 6:51
source share

Go into the dependencies and just change the path of the dependency class to classpath 'com.android.tools.build:gradle:2.0.0-beta6' Rest Gradle will take care. Happy coding :)

0
Mar 17 '16 at 5:14
source share



All Articles