Gradle is issuing an error Could not create plugin of type 'AppPlugin'
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
Gradle wrapper gives error Could not create plugin of type 'AppPlugin'
I found out what caused this problem:
I was running the command with gradlew cC
instead of ./gradleW cC
, using the /Users/<username>/Library/Android/sdk/tools/templates/gradle/wrapper/gradlew
instead of the project's Gradle wrapper. Doh
Gradle: Could not create plugin of type AppPlugin
Ooops, appearently I was using the wrong version of Gradle. My bad!
This 2 lines could make it clear what version is used
println GradleVersion.current().prettyPrint()
assert gradle.gradleVersion >= "1.10" // android plugin 0.10 requires Gradle 1.10, 1.11, 1.12
Android Studio - Failed to apply plugin [id 'com.android.application']
Updated June 24, 2020
You need to update to the latest gradle
version to solve this issue.
Please make sure you are on the latest Android Studio
and then update your project level build.gradle
by updating this dependency
buildscript {
repositories {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
}
}
It might show a popup asking your permission to update gradle
, please update and it will download the latest distribution automatically and the issue will be resolved.
Or else you can
Get Latest Gradle 5.6.4 from here and Add it manually
If you don't want to download it manually:
Open YourProject > gradle > wrapper > gradle-wrapper.properties
and replace
distributionUrl=https\://services.gradle.org/distributions/gradle-version-number-all.zip
With
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
Rebuild the project or just run gradle sync again.
gradle build error Plugin with id 'com.android.application' not found
You are adding plugins in wrong place.
plugins are added inside build.gradle(app) and classpaths are added inside build.gradle(project).
for example, inside build.gradle(app)
apply plugin: 'com.android.application'
buildscript {
repositories {
mavenCentral()
}
dependencies { }
}
inside build.gradle(Project)
dependencies{
classpath 'com.android.tools.build:gradle:7.1'
}
Related Topics
Login Error: There Is an Error in Logging You into This Application. Please Try Again Later
Android and Setting Alpha for (Image) View Alpha
How to Use Isineditmode() to See Layout with Custom View in the Editor
Change Viewpager Animation Duration When Sliding Programmatically
How to Change the Toolbar Text Size
Difference Between Extending Lifecycleactivity,Activity,Actionbaractivity & Appcompactactivity
How to Keep Android Applications Always Be Logged in State
How to Add a Button to a Preferencescreen
How to Show Snackbar at Top of the Screen
Encoding H.264 from Camera with Android Mediacodec
How to Compile C into an Executable Binary File and Run It in Android from Android Shell
Retrofit Uploading Multiple Images to a Single Key
Alarmmanager Android Every Day
Android Spinner with Different Layouts for "Drop Down State" and "Closed State"
Illegalstateexception: Can't Change Container Id of Fragment