Android emulator does not run but Gradle builds successfully - android

I am new to Android Studio and I am facing this weird kind of behavior.
I have built a raw project in Android Studio and I have configured Andriod AVD.
Gradle builds successfully though. It shows waiting for the device to come online.
I am using a Mac.

You can run on real device to check what happen of you can down load genymotion and run your application on that virutal machine

Related

Android Studio refuses to build and install any app on my phones

Since the time I have updated android studio to 3.5, I have been unable to run any app on multiple of my physical phones (Redmi Note 4 and OnePlus6). The app isn't installing on any of them. But it is installing on the emulated devices of the same respective versions (Android 24 and Android 28), so it is not an issue with the code.
Moreover, I tried to build the previous versions of my app stored on Git, and now Android Studio does not build the app showing - "linking error". While that same code version was working fine a few months ago (prior to the android studio update). Which is why I think the problem is somehow with the Android Studio and not the code...
Things I have tried
Disable instant Run (Not an option anymore in Android Studio >=3.5.1)
Enable USB debugging, connect using the device using "Transfer Files" mode and not "Charging Device" Mode
Turn off MIUI Optimization and Reboot
Uninstall App and re install
Build the apk, transfer the apk to the device and then try the install (This works on OnePlus 6 but not on Redmi Note 4)
The apps I have tried target Sdk >=27, and use androidx. However, I tried to go back to a previous version of the app, which didn't use androidx (and used the legacy support libraries), but still got the same error.
My system is Ubuntu 18.04, and current Android studio version is 3.5.3
Errors I have been getting include:
INSTALL_FAILED_USER_RESTRICTED
Device Not Found
UPDATE:
- Just tried to install on OnePlus6, doesn't install there as well. Earlier I had tested only for Redmi Note 4.
- Tried uninstalling and reinstalling the app, building the apk and
transferring on the phone then manually installing.
- This is happening across projects, at least for Redmi Note 4. I tried this with one of my course projects, same/similar problems.
My guess is problems with Android Studio update and the recent migration to androidx from the "legacy" support libraries
How I solved it:
Disable "Use libusb backend" in the Settings -> Build, Execution and Deployment -> Debugger
Sorry Android Studio 3.5 for the curses
How I found the solution:
I checked the logs of android studio by going to Help -> Compress Logs and Show in Files. In the folder which opened, I saw the logs by the name adb.1000.log (because adb - android debug bridge, handles the communication with the device). In the last few lines I saw - "read transfer failed: LIBUSB_TRANSFER_CANCELLED". I read here about the option of libusb
Did you try to clean/rebuild... under /Build/Clean Project, after that /Build/Rebuild Project and after cleaning and rebuilding you can try under /File/Invalidate caches

freshly installed Android Emulator keeps saying settings, google has stopped working in Parallel Desktop

I am using windows in Mac Pro. In Windows Parallel Desktop I am keep on getting error message in Android Emulator like:
Google has stooped working
Settings has stopped working.
Pixel Launcher has stopped working.
Getting error message in freshly installed Xamarin tools in Visual Studio.
Googling suggested to clear the cache or force stop it, but nothing is working
For now I installed Android Studio on Mac and running project on Windows. By Following below link I ran few commands and Windows able to communicate with MAC
https://learn.microsoft.com/en-us/xamarin/android/troubleshooting/questions/connect-android-emulator-mac-windows
Not sure if this is right way. But running virtual device inside virtual machine is giving some problem.
Above thing is working fine. Let me know if there is any other best solution for this.

Android Studio Shows No Connected Device When I try to run my app on a real device

I am trying to run an android app i just created using Android Studio IDE. I am using a MTK device, i have downloaded and installed so many adbs but still can't solve the problem. My Laptop is running Windows 7(32Bits).
Use external android emulators like Leapdroid, GenyMotion, etc. I suggest you to install Leapdroid. It is very easy to use.
[U can download Leapdroid by the following link][1]
![1]: https://leapdroid.en.softonic.com/download

How to run Android project?

I'm new to Android programming. I have installed Android SDK and the Android Studio IDE. I have started by reading this. I copied this code in eclipse and then run my code as Android application. The problem is that when the emulator appears I can't unlock the phone! Also it is too slow and I can't do anything. What are the other options to run Android app?
If you run Windows or Mac and your hardware is not enough to use emulator, you may check BlueStacks (http://www.bluestacks.com). It's like a Android player for PC.

Deploy on several emulators in android studio

I want to deploy on several emulator devices in android studio.
Just for testing it on different devices.
Is it possible?
Yes, it is possible.
Start a few emulators.
Create run configuration that shows chooser dialog (target device).
Run configuration.
Select all running emulators when Android Studio asks.
This will work only for non debug Android Application configuration, it will not work for Android Tests or debug configurations.
You can also run Gradle command connectedCheck to run tests on all devices outside of Android Studio.

Categories

Resources