How to see what version of JDK you are using - android-studio

How do i see what JDK version i am using in android studio? It says to do ctrl-shift-alt-s but all im seeing is sdk

Go to File -> Settings -> Build, Execution, Deployment -> Build Tools -> Gradle

Related

The specified Gradle installation directory does not exist error after Android Studio update 2021 1 1 patch2

After updating Android studio, my project now throws error The specified Gradle installation directory 'C:\Program Files\Android\Android Studio\gradle\gradle-2.14.1' does not exist.
When checking that installation path, there is no gradle folder.
I also tested a sample project, and that seems to be working.
Update: found the solution in this comment: How to update gradle in android studio?
I have solved like this:
You'll:
In Android Studio -> File -> Settings -> Build, Execution, Deployment -> Build Tools -> Gradle
In "Use Gradle from" you choose 'gradle-wrapper.properties' file. And in Gradle JDK you choose what you need.

Android studio 3.6 issue : ApkProvisionException: No outputs for the main artifact of variant: debug

Unable to determine application id: com.android.tools.idea.run.ApkProvisionException: No outputs for the main artifact of variant: debug
when update to android studio 3.6 version, this issue come out, but 3.5 is ok at the same project.
And I can find the apk in the outputs/apk folder.
I have the same issue with a Cordova Project after I updated Android Studio to 3.6.1
As a workaround (at least for the first installation of the app) I use installDebug Gradle Task from Gradle Tab View -> Tasks -> Install
I also have issues with Build -> Build Apks so I use assembleRelease Gradle Task from Tasks -> build

Gradle Sync Failed in Android Studio 3.6 Cause invalid type code :85

I just update my Android Studio from version 3.5.3 to 3.6, now I open any project I see this error and gradle doesn't sync
I was having the same issue. I solved it by changing the JDK version I was using which was JDK 13.
Go to File -> Project Structure.
On the left side, click on SDK Location and go to JDK Location.
Change it to the Embedded JDK that comes with Android Studio.
Click on OK.
I found out that some people might use Android 4.0 with Java 14 and Gradle 6.1.1 like me. And they are not supported for each other, so just update Gradle to 6.5.1; it will solve the problem. To update Gradle, click in the Android Studio tab: File -> Project Structure -> Project. Then, change the Gradle version to 6.5.1.
Thanks, it was very helpfull!
Here's what I did to solve the issue with JDK 11 + Android 4.0.
Follow Tran's answer (https://stackoverflow.com/a/62967378/5359328) and upgrade to Gradle 6.5.1.
Build project. It still shows the same error.
Change JDK to 8 in Project Structure, build. It's successful.
Change JDK back to 11 in Project Structure, build. It's successful again.

How do I install gradle offline on android studio?

The gradle version under project structure is 4.1 so I tried to direct the IDE to the directory where I had extracted the .zip file.
1.Download the gradle-4.1-bin.zip.
2.Now extract and paste it in the C:\Users\username.gradle directory.
3.Enable offline work in (Preferences -> Gradle -> Global Gradle Settings -> Offline work)

This version of android studio is incompatible with the gradle version used.Try disabling the instant run

I am able to build the app properly, but when I run it I get this error:
This version of android studio is incompatible with the gradle version used.Try disabling the instant run
You can use normal build run rather than instant run.
Check first
Go to Settings/Preferences > Build, Execution, Deployment option > Instant Run and uncheck all the three boxes.
Upgrading Gradle services URL:
Project > Gradle > Wrapper > gradle-wrapper.properties
Change URL from
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
to
distributionUrl=https\://services.gradle.org/distributions/gradle-2.11-all.zip
(Find latest distributionUrl gradle plugin version Here: http://services.gradle.org/distributions
**Make sure to use gradle-x.xx-all.zip
)
Delete your build folder
When you run project, build folder will be created automatically
Go to BUILD option in menu > Clean the project, Build the project
It should work without instant run.
I had easy steps & correct way also
1 - In Settings -> Build, Execution, Deployment option -> Instant Run
2 - Clear Enable instant run to hot swap code
3 - Clean project
p/s : It should totally work.
The Gradle Plugin used is typically the same as the version of Android studio you are using.
Check the Android Studio version
Help → About
and the version will read
Android Studio Version X.Y.Z
Then, go to
Project → Gradle Scripts → build.gradle(Project)
and under dependencies change the classpath to
classpath 'com.android.tools.build:gradle:X.Y.Z'
and rebuild/sync the project.
You can disable instant run by follow these steps in Android Studio:
File → Settings → Preferences dialog → Build → Execution → Deployment
→ Instant Run → Update Project
This feature introduced in Android Studio 2. however, when you disable it, next time when you try to push new app to your emulator is running much slower.
In my case I just update Android Studio to the latest build from canary channel and it's works without disable this feature.
Hope it's help
As commented by sjd: Just cleaning the project and build again might help if you, just like me, have used the automatic update applied by android studio.
I just did a Build > Clean project and then reRun app!
I wanted to run the app in debug mode and got the same message, so I tried:
File > Invalidate caches and restart...
Clean project
Build project
Nothing worked...
Then, I just clicked on the green arrow to run the project without debugging...
Worked!
So then I just added a debugging session with the option left of the stop button in Android Studio.
I did fix by this way.
Update your classpath to classpath 'com.android.tools.build:gradle:2.0.0' in your top level build.gradle file.
Done
I just Deleted the Build Folder and Clean project.It worked for me...!!!
In Android Studio 2.3.3
File -> Settings -> Build, Execution, Deployment -> Instant Run -> Unable Instant Run to hot swap code (Uncheck it)
Now, you have disable Instant Run...
It will solve Instant Run issue.

Resources