Error:(2, 0) Plugin with id 'jetty' not found
Currently html module using deprecated jetty plugin
which is removed in Gradle 4.1 version.
Android Studio 3.0 using Gradle-4.1
and android-gradle-plugin:3.0.0
Gradle 4.1 is not supported yet in LibGDX, there is an issue for the same, which is now upgraded for Gradle 4.6
If you still want to use Android Studio 3.0
-
Downgrade Gradle to 3.3 from 4.1
Find gradle folder inside your project, Open
gradle-wrapper.properties
and change distributionUrl for 3.3distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
-
Downgrade Android-gradle-plugin to 2.3.3 from 3.0.0
Open root
build.gradle
file and find artifact and change versionclasspath 'com.android.tools.build:gradle:2.3.3'
Comment/delete
google()
from repo list
--------------------------------------------------------------------------------
EDIT : Update LibGDX project to Gradle 4.6 - AS USER
-
Upgrade Gradle to 4.6 :
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
-
Find root
build.gradle
file of your project and add Google's Maven repo inproject repositories list
as well as inbuildScript repo list
repositories { //.. google() jcenter() // Required for org.jetbrains.trove4j:trove4j library }
-
Update Android Gradle Plugin :
classpath 'com.android.tools.build:gradle:3.1.3'
Known issues with the Android Gradle Plugin
Configuration on demand with Gradle 4.6 and above:
If you're using Android Gradle Plugin 3.0.x or 3.1.x with Gradle 4.6 and above, you should disable configuration on demand to avoid some unpredictable build errors. (If you are using Android Gradle Plugin 3.2.0 or higher, you do not need to take any action to disable configuration on demand.)
Disable configuration on demand in your
gradle.properties
file as shown below:org.gradle.configureondemand=false
-
To disable configuration on demand in the Android Studio settings, choose File > Settings (Android Studio > Preferences on Mac), select the Compiler category in the left pane, and clear the Configure on demand checkbox.
In Android Studio 3.2 Beta 1 and higher, the options for enabling configuration on demand have been removed.
Update Android buildToolsVersion to
27.0.3
and SdkVersion to27
- Remove
instrumentTest.setRoot('tests')
fromsourceSets
inside androidbuild.gradle
file - replace all
compile
withimplementation
inside rootbuild.gradle
file - New
GWT Gradle Plugin
added in html module, check latest build.gradle of html module.
Run your project with Run Configuration
or On Terminal using gradle task
.
If you're going to create new project use gdx-setup.jar
of latest build.
![Admin](/assets/logo_square_200-5d0d61d6853298bd2a4fe063103715b4daf2819fc21225efa21dfb93e61952ea.png)
Admin
Updated on December 07, 2020Comments
-
Admin over 3 years
Yesterday I upgraded Android Studio to version 3.0, but I'm working with LibGdx and after the upgrade I cannot build my project.
When I'm try to build, it gives me an error:
Error:(2, 0) Plugin with id 'jetty' not found
How should I fix this?
-
MilanG over 6 yearsGreat, this helped! Is there a way to find out what update is safe to apply before it crashes your project?
-
Abhishek Aryan over 6 yearscrashes ?? If you're talking about desktop crash, you can use Terminal to run your desktop project.
-
MilanG over 6 yearsAfter the update I was not able to build the project at all. That's the crash I'm talking about. I would like to know what update is safe before I run it.
-
MilanG over 6 yearsI downgraded Gradle as you explained and it works well again. Error was the same as Eugenio explained at his question at top.
-
Julien over 6 yearsCan you run the Desktop module also with this fix?
-
Abhishek Aryan over 6 years@Julien yes, you can run desktop module
-
Taylor Liss over 6 yearsWorked for me! Thank you!
-
Diljeet over 6 yearsThanks worked for me too, just found the "gradle-wrapper.properties" inside folder "gradle/wrapper" and found both "com.android.tools.build:gradle:3.0.1" and "google()" in the "build.gradle" file. Hope this helps, because everyone is expected to come to this answer whose not familiar with gradle options. Good Day
-
Pimentoso over 6 yearsWorked for me too. If you get an error like "Error:(74, 0) Gradle DSL method not found: 'implementation()'" make sure to replace all the 'implementation' calls back to 'compile' in build.gradle projects dependencies.
-
MrStahlfelge over 5 yearsInstead of experimenting yourself, simply upgrade to to libGDX' changed Gradle 4.6 toolchain.