There are several questions with solutions to this, but I'm not getting any luck with them.
I'm using IntelliJ (rather than the raw Android Studio). As far as I can tell I have the latest version of Gradle. I've never used Gradle before, so I'm not totally sure.
Error running app: This version of Android Studio is incompatible with the Gradle Plugin used. Try disabling Instant Run (or updating either the IDE or the Gradle plugin to the latest version)
It might be that Gladle is indeed out of date. How can I check and confirm or fix this?
If it's not that, what else can it be?
(I'm using the latest version of IntelliJ (2016.2.5) RUNNING ON Windows 10)
P.S. I have tried disabling Instant Run, with no effect.
You need to find out your gradle plugin version and check the compatibility with your IDE here. And here you can find which code base of Intellij Idea used in specific Android Studio version.
But I suggest that you should use Android Studio. GL
Related
Updated Android studio.
Downloaded Gradle. Changed Gradle folder in PC's environmental settings.
In computer, gradle -version returns Gradle 4.4.1.
In Android Studio, returns Gradle 3.5
Smart Android IDE refuses to recognise gradle and I can't compile.
It even gives the wrong error message
Minimum supported Gradle version is 4.1. Current version is 3.5. If using the gradle wrapper, try editing the distributionUrl in C:\xxxxxx\gradle\wrapper\gradle-wrapper.properties to gradle-4.1-all.zip
I have tried restarting, invalidate and restart. Nothing works.
How to fix it?
You need to go to
File->Settings->Build,Execution,Deployment->Gradle
Then tick User local gradle distribution and set the path to your local gradle
Fixed it by restarting the computer.
Restarting the IDE is not good enough. After restarting computer and going into Android Studio's terminal, typing in gradle -version shows the correct version. That's when I know it'd work. Sure enough, gradle commands now work.
Answered this just to show how genius the IDE written by geniuses is.
I check android studio offical web, android studio IDE now support version just to gradle-4.1.
I think you can go to gradle-wrapper.properties, and change to distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
or
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-all.zip
, maybe it can solve the problem.
Reference site:
https://developer.android.com/studio/releases/gradle-plugin.html
I faced this problem and i had fixed it. first goto https://services.gradle.org/distributions/gradle-4.10.1-all.zip and download it locally. Goto File->Settings->Build,Execution,Deployment->Gradle and select "Use local gradle" and set local gradle path that you downloaded just.
gradle path
I just updated to Android Studio 2.2.1 for Mac. Then I updated the JDK to version 8. Tried to start a new project and run it. I got the following error:
Error:(1, 1) A problem occurred evaluating project ':app'.
java.lang.UnsupportedClassVersionError: com/android/build/gradle/AppPlugin : Unsupported major.minor version 52.0
I also tried going back to JDK version 7 as it says on google site that JDK 8 is unstable for Mac. still got the same error.
Check your android build tools dependencies. In your build.gradle if its something like:
classpath "com.android.tools.build:gradle:+"
It has likely downloaded the alpha of 2.2 and that can cause the error you are seeing.
Try
classpath "com.android.tools.build:gradle:2.1.0"
If you are already using the right build tools version but keep getting this error, maybe one of the third party Android libraries you are using is causing the problem due to the same reason. You can force the dependency version to be used (including transitive) by changing
classpath "com.android.tools.build:gradle:2.1.0"
to
classpath('com.android.tools.build:gradle:2.1.0') {
force = true
}
Documentation: gist and official gradle docs.
I was also facing same problem. I upgraded Android Studio and as it forced to But we need to configure same in App Settings as well.
You can try to update JAVA_HOME to point to JDK 8 location.
In my case, I've updated Android studio project's SDK settings, changed java version in my PATH env variable, but still this error occured. Only updating JAVA_HOME helped me.
I was also facing the same problem. I upgraded Android Studio and as it forced to install JDK 8, downloaded and installed this as well. But we need to configure same in App Settings as well.
Select Project [Right click on the app module] -> Open Module Settings -> Select SDK Location from Left Menu - > Configured correct JDK Version i.e removed the old version and updated path of JDK. Save.
Sync Project.
Problem solved!
EDIT: Elaborated Project word.
If you are on Jenkins, check Java version in Jenkins->Manage Jenkins->Global Tool Configuration->JDK
I had to update mine to JDK 8.
I had same error in 2.3 beta 1 ,
Fixed as follow :
Download latest java jdk
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
In Android Studio , go to File > Project Structure > SDK Location > select JDK Location path to point to the new jdk installed (Ex: C:\Program Files\Java\jdk1.8.0_111 )
Done !
Ufff, I changed like everything I was able to find to jdk 8 and still no result but then I found Gradle settings in Intellij (preferences > gradle > GradleJVM) and it was ofc wrong, changed that and woala.
I meet the problem too, but I have changed nothing before it's happening. I think google is purposely. Google is trying to use openJDK instead of JDK because of the lawsuit between google and oracle. So, in the new version 2.2.0 of android, we found that there are some new files in the installed folder:
android studio 2.1 files
android studio 2.2 files
Then, I think we have two method to fix it:
Change the JDK environment variable of your OS.
Just click menu File --> Project Structure, choose Use embedded JDK (recommended). I chose this way and it work.
Good luck...
I had a same problem what is work for me is that .
Go
*File>Settings>(on the panel left)Build,Execution,Deployment . then click on Gradle
There is option to Update Gradle. Click on that it will time 3 to 4min and after that error gone.
The simplest way is to update Android Studio to v2.2.3, it includes a fix of JDK8:
Bug fix for a JDK8/Kotlin compiler + dx issue (issue 227729)
It's solved my problem.
I am having an immensely frustrating issue with Eclipse and the ADT after updating all the SDK's, API's and Support Libraries for Android this week.
Ever since updating everything I am unable to properly create an Android Project in Eclipse. It does not generate the MainActivity.java or the main_layout.xml files at all. I have read through most of the other posts regarding this and the fixes they suggest don't seem to work. I have tried looking for the updated software by going to:
Help --> Check for updates (Everything is up-to-date).
I have also tried the manual way by going to:
Help --> Install New Software and inputting https://dl-ssl.google.com/android/eclipse/
It still says I have the latest version of the ADT.
I have also tried reinstalling the ADT plugin as well, but to not avail.
Trying to create an Activity after project creation also does not work.
Versions of software that I am running:
Android SDK Tools 24.0.1
Android API 1.5 up to and including API 5.0.1
Eclipse: Luna Service Release 1(4.4.1)
ADT Plugin Not sure
Thank you for taking the time to read this.
The ADT and SDK Tools must be compatible. The latest ADT version is "ADT 23.0.4". And the corresponding SDK Tools version is 23.0.5. You have updated your SDK Tools version to 24.0.1, but there are no ADT version can support. So you should roolback to the SDK Tool version 23.0.5.
Here is the link:
https://dl-ssl.google.com/android/repository/tools_r23.0.5-windows.zip
Add an Empty Activity, instead of Blank Activity. This will generate MainActivity.java
What is your Java version? You didn't mention about it. Please check it, it should be Java 7 for Android 5.0. If you have Java 7 then check eclipse.ini file. If it refers to Java 6 then change here also to Java 7.
Google fixed this issue and below link may help you.
https://code.google.com/p/android/issues/detail?id=82393
I'm using Eclipse to program Android applications, and when I opened the program yesterday, it popped up an error saying I need to install JRE - I've downloaded the JRE and installed it - when during the installation I got a message saying that the JAVA version I have on the computer (Version 7) is too old for the JRE (Version 8), and that I need to update the JAVA also.
I did so, and then opened up the Eclipse again - And all of the projects,that before worked great, are now full with errors.
I tried installing all of the SDK updates - didn't work, also tried uninstalling Eclipse and re-install it - also didn't work.
The errors I get are: "XXX cannot be resolved to a type" - in amost every single line in the project.
How do I fix it??
Thank you!!
android development tool(adt) are install.. and all update SDK and then import an old program.. Ithink then work.
I would suggest to check that your java build path is functioning properly. This kind of error for me usually means that eclipse cannot find the JRE installation.
Form eclipse you can go to Project->Properties and check for any errors there. Any inconsistency there would cause all your projects to fail.
First of all, you need the JDK installation, not JRE. Second, Android currently supports up to Java v7, which means you'll need to get JDK v7 from here. Make sure you download the correct 32-bit or 64-bit JDK version for your operating system.
Also, ensure your Android SDK and Android Development Tools (ADT) are on the same released version. Different versions of Android SDK and ADT can lead to many unforseen problems.
I receive errors when trying to import my Cordova based, eclipse exported "build.gradle" file, when importing into Android Studio:
"Gradle version 1.6 is required. Current version is 1.9"
However, upon changing the version using a local gradle distribution I receive the following:
"You are using an old, unsupported version of Gradle. Please use version 1.8 or greater."
Anyone have any ideas how to resolve this?
Stumbled upon the same issue, you should check this link where everything is pretty well explained:
http://rexstjohn.com/exporting-android-project-eclipse-android-studio-0-4-0/