program tip

Gradle에서 ''AppPlugin '유형의 플러그인을 만들 수 없습니다.'라는 오류가 발생합니다.

radiobox 2020. 10. 15. 07:42
반응형

Gradle에서 ''AppPlugin '유형의 플러그인을 만들 수 없습니다.'라는 오류가 발생합니다.


gradle로 간단한 안드로이드 프로젝트를 만들려고합니다. 저는 Debian GNU / Linux 7 'wheezy'가 설치된 컴퓨터에서 작업합니다.

Gradle Plugin User Guide-Android Tools Project Site 의 권장 사항을 따랐 지만 오류가 발생합니다.

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

사양을 따랐습니다.

  • Gradle 1.9
  • 플러그인 0.7
  • SDK 17+ (실제로 19)

나는 또한 프로젝트를 새로 시작했고 내가 보여준 결과 gradle tasks는 문서에 표시된대로 명령에 의해 발행되었습니다 .

나는 또한 gradle 1.10을 시도했지만 결과는 동일합니다.

이 질문 조차도 쓸모가 없었습니다. 왜냐하면 그것은 gradle 1.6으로 '업그레이드'하여 해결 되었기 때문입니다 (플러그인 0.7은 최소한 gradle 1.9가 필요하다는 것을 이해합니다).

android-studioIntelliJ Idea 에서 동일한 오류로 실패한 후 이것을 시도했습니다 .

편집 : 또한 두 IDE에서 새로운 프로젝트를 시도했지만 동일한 문제가 발생했습니다. 하지만 가장 놀라운 점은 두 IDE 모두 래핑 된 형태로 gradle 1.8을 사용한다는 것입니다. 내 로컬 gradle 설치를 사용하도록 둘 다 cinfigure하려고했지만 여전히 동일한 문제입니다.

내가 도대체 ​​뭘 잘못하고있는 겁니까? 버그입니까? 문제를 어떻게 피할 수 있습니까?

제발 도와주세요.

편집 : 여기 내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')
}

Google은 Gradle 플러그인 버전 0.7.2에서 실수를했습니다 .

참고 : 0.7.2에는 Java7이 필요합니다. 이것은 실수입니다. 대신 0.7.3을 사용하십시오.

릴리스 0.7.3은 Java6 지원을 다시 활성화합니다. 내 빌드 파일에서 Gradle 0.7.3을 선언하면 실제로이 문제가 해결됩니다.

그 누구도 완벽하지는 않다 :)

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


Gradle 1.10 대신 Gradle 1.9를 사용하십시오. 1.10에 문제가 있습니다 : https://code.google.com/p/android/issues/detail?id=63822

여기에서도 대답했습니다.

Gradle에서 Android 플러그인을 적용 할 때 org.gradle.api.artifacts.result.ResolvedModuleVersionResult를 찾을 수 없습니다.


Gradle 플러그인 0.8.0과 함께 Gradle 1.10을 사용하여 작동했습니다.

// /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

명령 줄을 사용하여 다음과 같이 프로젝트를 만드는 경우 :

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

프로젝트는 android-gradle-plugin 버전 1.2.2를 사용하도록 생성되었지만 프로젝트는 호환되지 않는 gradle 1.12로 초기화되었습니다 .

이를 수정하려면 다음을 수행하십시오.

  1. 원하는 릴리스를 열고 rtest/gradle/wrapper/gradle-wrapper.properties설정 distributionUrl하십시오. 예를 들면 : http\://services.gradle.org/distributions/gradle-2.2.1-all.zip(콜론에서 벗어나는 것을 잊지 마세요-예, 저도 웃게 만듭니다);
  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.


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


You can also get this error if you update your system gradle and forget to update the Android Studio gradle home.


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.


I got this today when running gradle assembleRelease. I had installed the Ubuntu default of gradle-1.4. This didn't work, so I tried the latest gradle-1.12 and got the same issue.

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

This is with Android Studio 0.5.8.


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


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

I had this error like this... enter image description here

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

enter image description here

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

After this build was successful.

참고URL : https://stackoverflow.com/questions/20811514/gradle-is-issuing-an-error-could-not-create-plugin-of-type-appplugin

반응형