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?
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.3
distributionUrl=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 version
classpath '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 in project repositories list as well as in buildScript 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 to 27
Remove instrumentTest.setRoot('tests') from sourceSets inside android build.gradle file
replace all compile with implementation inside root build.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.
Suggestion from Jetty Plugin team is to switch to gretty
Please check this
Error while replacing jetty plugin to gretty plugin gradle
Related
after adding react-native-vision-camera and 2 other packages, I got this error
The Android Gradle plugin supports only kotlin-android-extensions Gradle plugin version 1.6.20 and higher.
The following dependencies do not satisfy the required version:
project ':react-native-gesture-handler' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.20
I know that I need to add kotlin_version = '1.6.20' but I have to do it only at the android folder of the react-native-vision-camera package. It solves the probleme but everytime I run ./gradlew clean I have to reset it !
how can I set the kotlin_version = '1.6.20' globally for 'all' node_module's packages ?
I am trying to setup Android Studio For Offline builds, using latest gradle.
System - Windows 10 64 Bit.
What i have done so far?
Downloaded and Installed Android Studio 4.0.1 Windows 64 Bit from official website. Android SDK and AVD also selected during installation. (Internet Install)
Downloaded Offline components.
Android Gradle Plugin.
Google Maven Dependencies.
From -https://developer.android.com/studio#downloads
And setup according to docs for offline setup.
Downloaded Latest Complete Gradle zip file from :
https://gradle.org/releases.
Gradle version 6.5.1 (gradle-6.5.1-all.zip)
Pasted Gradle zip into .gradle/wrapper/dists/
And extracted it their.
And changed the path From File-> Settings->Build Tools->Gradle to above extracted folder.
When i tried to build, i got following errors:
Could not find com.android.tools.build:gradle:4.0.1 Searched in the following locations: - file:/C:/Users/Xevns/.android/manual-offline-m2/gmaven_stable/.../gradle-4.0.1.pom
Once inspected the offline components achieve, i think it uses Old Android Gradle plugin v3.5.0 beta and Old maven dependecy. But in project its using Gradle plugin 4.0.1 and Gradle 6.5.1.
Please help, where find it latest and setup.
The so called: latest versions of the Android Gradle plugin link does not contain the latest version. You have to select one that is in that package:
Grandle Scripts -> build.grandle :
classpath 'com.android.tools.build:gradle:3.4.0'
The Android Grandle Plugin package does not contain library versions that are needed for that "tools.build:grandle" version - (download manualy from repos?)
Other dependencies (appcompat,constraint-layout, ...) the same problem, requested versions are not included in downloaded Google Maven package.
Could not determine the dependencies of task ':app:lintVitalRelease'.
Could not resolve all task dependencies for configuration ':app:lintClassPath'.
Could not resolve com.android.tools.lint:lint-gradle:26.6.1.
Required by:
project :app
No cached version of com.android.tools.lint:lint-gradle:26.6.1 available for offline mode.
No cached version of com.android.tools.lint:lint-gradle:26.6.1 available for offline mode.
Maybe you can try to add this code in your module.
lintOptions {
checkReleaseBuilds false
abortOnError false
}
What worked for me was the following; If you are using Android Studio 3.6.1 downgrade gradle to version 3.5.3:
classpath 'com.android.tools.build:gradle:3.5.3'
Then clean the project: Build > Clean Project.
Now I was able to run the project again. But if I rebuild the project, I got the same errors. I think there are some problems with the new Gradle offline mode integration in the new Android Studio version.
****While configuring
ChatCamp
SDK with my project with compileSdkVersion 25 I get sync error****
Error:(33, 0) Gradle DSL method not found: 'implementation()'
Possible causes:The project 'ChatCamp' may be using a version of the Android Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0).
Upgrade plugin to version 2.3.1 and sync projectThe project 'ChatCamp' may be using a version of Gradle that does not contain the method.
Open Gradle wrapper fileThe build file may be missing a Gradle plugin.
Apply Gradle plugin
with compile sdk 26
Error:(33, 0) Gradle DSL method not found: 'implementation()'
Possible causes:The project 'ChatCamp' may be using a version of the Android Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0).
Upgrade plugin to version 2.3.1 and sync projectThe project 'ChatCamp' may be using a version of Gradle that does not contain the method.
Open Gradle wrapper fileThe build file may be missing a Gradle plugin.
Apply Gradle plugin
***When import
Sample Project*** in
Android Studio 2.3.1
sample project gradle version 4.1
Android Plugin |Version 3.0.1
Error:This Gradle plugin requires a newer IDE able to request IDE model level 3. For Android Studio this means version 3.0+
If changes > Sample App
gradle version 4.1 to 3.4.1 and android plugin version 3.0.1 to 2.3.1
then I get-
Error:(6, 0) Gradle DSL method not found: 'google()'
Possible causes:The project 'ChatCamp-Android-Example-master' may be using a version of the Android Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0).
Upgrade plugin to version 2.3.1 and sync projectThe project 'ChatCamp-Android-Example-master' may be using a version of Gradle that does not contain the method.
Open Gradle wrapper fileThe build file may be missing a Gradle plugin.
Apply Gradle plugin
You are facing this problem because the sample https://github.com/ChatCamp/ChatCamp-Android-Example is using gradle version greater than 3.0.0. There were some breaking changes in Gradle 3.0.0. You can take a look at how to migrate to new version of gradle here .
If you want to run this sample in older version of gradle you just need to replace implementation with compile, testImplementation with testCompile and androidTestImplementation with androidTestCompile.
After the update of Android Studio to version 2.3.1, Android Studio displayed an alert recommending an upgrade of Gradle from 2.3.1 to 3.3. I clicked 'yes' and it launched a Synch process.
But surprisingly, the Gradle version mentioned in the Gradle file did not change. In my Gradle file, I still have:
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
}
But I have got in the File > Project Structure > Project menu in Android Studio:
Why do I have a Gradle version of 3.3 in this window and 2.3.1 in my Gradle file ?
I also see in this window that the 'Android Plugin Version' is '2.3.1'. Is there any link between this 'Android Plugin Version' and com.android.tools.build:gradle version which is also 2.3.1 ?
Should I set 3.3 for these three fields ? ( 1: Gradle Version (setup window), 2: Android Plugin Version (setup window), 3: com.android.tools.build:gradle (Gradle file))
Thanks for your explanations!
Android Plugin Version (setup window) and com.android.tools.build:gradle (Gradle file) are same thing and Gradle version mentioned in the
Project/gradle/wrapper/graddle-wrapper.properties
file as
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip