Android Studio : How to uninstall APK (or execute adb command) automatically before Run or Debug?

can be used to uninstall an app via your PC. If you want this to happen automatically every time you launch your app via Android Studio, you can do this: In Android Studio, click the drop down list to the left of Run button, and select Edit configurations… Click on app under Android Application, and … Read more

Error while waiting for device: Time out after 300seconds waiting for emulator to come online

I have been trying to use android studio 2.0 emulator but I can not run my App on the Emulator. When I Run my App it shows the emulator with following details: Hax is Enabled Hax ram_size 0x800000000 HAx is working and emulator runs in fast virt mode. console on port 5554, ADB on port … Read more

Android Studio AVD – Emulator: Process finished with exit code 1

These are known errors from libGL and libstdc++ You can quick fix this by change to use Software for Emulated Performance Graphics option, in the AVD settings. Or try to use the libstdc++.so.6 (which is available in your system) instead of the one bundled inside Android SDK. There are 2 ways to replace it: The emulator has a switch -use-system-libs. You can found it here: ~/Android/Sdk/tools/emulator … Read more

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

Your gradle wrapper is missing, broken or corrupted. What is gradle wrapper:gradlew is the gradle wrapper executable – batch script on windows and shell script elsewhere. The wrapper script when invoked, downloads the defined gradle version and executes it. By distributing the wrapper with your project, anyone can work with it without needing to install Gradle … Read more

Default Activity not found in Android Studio

In Android Studio, right click on the project and choose Open Module Settings. Then go to the Sources tab in your module, find the src folder, right click on it and mark it as Sources (blue color). EDIT: There is no sources tab in later versions of Android Studio, but you can edit the build.gradle file instead: https://stackoverflow.com/a/22028681/1101730 (thanks for comment Josh)