How to set gradle home while importing existing project in Android studio

The gradle plugin (which contains a bundled version of gradle) should be already installed in where/you/installed/android-studio/plugins/gradle so you shouldn’t need to manually download it. Depending on the version of Android Studio, that last directory may be where/you/installed/android-studio/gradle/gradle-x.y.z (x.y.z is the version, so check your filesystem for the exact path). If you intend on doing gradle … Read more

Gradle tasks are not showing in the gradle tool window in Android Studio 4.2

OK, I found why I got this behaviour in android studio 4.2. It is intended behaviour. I found the answer in this post: https://issuetracker.google.com/issues/185420705. Gradle task list is large and slow to populate in Android projects. This feature by default is disabled for performance reasons. You can re-enable it in: Settings | Experimental | Do … Read more

buildTypes cannot be applied to groovy.lang.Closure

For me the problem was not solved by applying the above solution. Instead I had to go to the settings within Android Studio and select “Use gradle wrapper”: In Android Studio select: File\Settings\Build, Execution, Deployment\Build tools\Gradle (Mac Users: Android Studio\Preferences…\Build, Execution, Deployment\Build tools\Gradle ) Mark: Use default gradle wrapper (default) This removed all ‘cannot be … Read more

Taking screenshot on Emulator from Android Studio

Starting with Android Studio 2.0 you can do it with the new emulator: Just click 3 “Take Screenshot”. Standard location is the desktop. Or Select “More” Under “Settings”, specify the location for your screenshot Take your screenshot UPDATE 22/07/2020 If you use the emulator inside Android Studio which is possible since Android Studio 4.1 click … Read more

Could not find or load main class org.gradle.wrapper.GradleWrapperMain

In addition to @RaGe’s answer may be the situation I faced where i had a global git ignore that was ignoring .jar files and so the gradle wrapper jar was never being committed. Thus I was getting that error on the Jenkins server after an attempted /var/lib/jenkins/my_project/gradlew build. I had to explicitly force an add … Read more

How to check if Gradle dependency has new version?

UPDATE (05/23/18): The newer version of Android Studio does not show version updates in the Project Structure dialog. Instead, Adam-s answer is the correct one for Android Studio 3+ Analyze > “Run Inspection By Name” Then search for “Newer Library Versions Available“ PREVIOUS WAY: As of Android Studio 2.2, a new Project Structure dialog shows … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)