Gradle is issuing an error “Could not create plugin of type 'AppPlugin'”

后端 未结 10 691
北荒
北荒 2020-11-29 04:46

I\'m trying to create a simple android project with gradle. I work in a computer with Debian GNU/Linux 7 \'wheezy\'.

I followed the recomendations in Gradle Plugin U

相关标签:
10条回答
  • 2020-11-29 05:20

    If you are attempting to update your Gradle 1.9 project to Gradle 1.10 using

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

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

    Solution is to install Gradle 1.10 onto your machine and upgrade your project not using the wrapper

    gradle wrapper

    0 讨论(0)
  • 2020-11-29 05:24

    Ok i guess android studio has answer for this to get this bug out using GUI,

    I had this error like this...

    after updating the plugins i was facing another issues while building,

    so changes the gradle setting to default as shown in the image,

    After this build was successful.

    0 讨论(0)
  • 2020-11-29 05:27

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

    0 讨论(0)
  • 2020-11-29 05:28

    If you're using the command line to create the project like so:

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

    The project is created to use version 1.2.2 of the android-gradle-plugin, but the project is initialised with gradle 1.12, which isn't compatible.

    To fix it, do the following:

    1. Open rtest/gradle/wrapper/gradle-wrapper.properties and set distributionUrl to the release you want; for example: http\://services.gradle.org/distributions/gradle-2.2.1-all.zip (don't forget to escape the colon - yes, that makes me smile too);
    2. Open build.gradle and change runProguard false to minifyEnabled false;
    3. ./gradlew clean && ./gradlew assembleDebug
    4. I also remove the hidden .gradle folder, but I'm not sure if it's necessary

    And it all works again.

    0 讨论(0)
  • 2020-11-29 05:31

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

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

    Release 0.7.3 re-enables Java6 support. Declaring Gradle 0.7.3 in my build files does indeed resolve this for me.

    No one is perfect :)

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

    0 讨论(0)
  • 2020-11-29 05:32

    I got it working using Gradle 1.10 with the Gradle plugin 0.8.0.

    // /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
    
    0 讨论(0)
提交回复
热议问题