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

后端 未结 10 729
北荒
北荒 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: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.

提交回复
热议问题