app do not fit in avd window size - emulation

app do not fit in A.V.D. window size
When I started android virtual machine , fine. It worked, then the problem started, my app was loaded and was working properly but the only problem was that my app didn't fit in the android virtual machine window size, i tried too search over net but no proper solution was there , do i need to configure virtual machine or need to change its settings? Shall I re install the A.V.D. again? Tried to restart it but nothing happened.

Simply change your AVD's device size and use 'scale to real size' or similar option given when starting an emulator

Related

BlueScreen after Run emulator android studio

When im run android studio, or run emulator for android studio with manually or with cmd, always get bluescreen.
it say "your pc ran into problem and needs to restart. we're just collecting some error info, and then we'll restart for you"
Stop code: IRQL Not Less or Equal
how can i fix it ?
im trying download another emulator and following tutorial on youtube, but it didn't work
It depends on various factor,
I happened to get this issue because of my old PC with Lesser RAM size(4GB) and to rectify it, I connected my Android phone to PC for debugging/running apps from Android Studio.
You need to enable USB Debugging in your phone for that purpose.
NOTE:
You can view this blog post I made, which addresses the same issue.
https://whysurfswim.com/2015/07/11/sick-of-your-avd-theres-a-alternate-for-it/
I had almost same problem. When I tried to install my app in emulator(Ram 8gb), my emulator crashes but kept running in background. As a result, I was unable to shut down my pc and have to disconnect power for shutting down.
use your phone for debugging your app. you can connect your phone using wifi. link here
Sometimes it happens beacause of outdated drivers, try updating your drivers to latest version, and update the windows 10 to latest version. Also try by deleteing your current emulator device and create new device by enabling software renderer. For lower end pcs like yours I would recommend to use real device instead of emulators ans use ssds for better performances.

Android Studio emulator keeps freezing, crashing, and is not responding at all

I'm a starting Android development and have recently ran into some problems. I don't know whether it is my hardware or if it's Android Studio but the emulator keeps freezing or is not responding.
The first 2 days Android Studio was running fine. However, after that it cannot run my apps. I reinstalled Android Studio and it worked for one day, but now even if I reinstall it, it won't run any apps and even Android Studio itself would occasionally freeze and I will have to restart it.
The emulator either does this or does not even turn on:
it won't even respond when I click on anything on the emulator
Here is a break down of what's been happening.
Day 1: works fine.
Day 2: Android Studio freezes multiple times when I launch the emulator. Emulator unresponsive to clicks. I uninstall Android Studio thrn install it again. After reinstallation it works 100% again with the same app
Day 3: emulator unresponsive, freezes. Menu bottons such as rotate screen, back etc. unresponsive.
Day 4: same as day 3. Uninstall Android, reinstall. Unresponsive.
You can try changing this line of code System.out.println(userinput1); to Log.d(MainActivity.class.getSimpleName(), userinput1) because on emulator system.out.println() automatically redirects to logcat but sometimes not.
This problem may arise due to low ram size, android studio works fine with 8GB Ram.Or try to config emulator properly. Let me know if problem continues.
I would suggest that import just specific address of class not the whole package or as bundle.
With
import java.util.*;
all classes of java.util package is imported.
The problem might be that, your hardware might be overwhelmed.
I don't think anything is wrong with your code. What is your system configuration? Does other applications work on emulator work? Can you post you
post your logcat?
PS: I know it should have been a comment. But I don't have permissions, sorry.
Problem and solution
Same problem, unusable for serious testing, whole system locking up regularly (Linux Mint Vera | 16GB-RAM | Nvidia GP106 [GeForce GTX 1060 3GB] -- worked fine on Windows 7, exact same hardware (although hard drive config has changed slightly, might need to double-check the OS drive is connected port0 on motherboard in case of performance impact).
It's ironic that Android being Linux based, struggles to run in a Linux env xD.
Tried different:
Linux APIs
Emulator Phone Models
Phone RAM specs, processor specs, etc
( All different graphics modes (both in native A-Studio emulator and using the apt install-google-emulator option for vanilla standalone (old school) version. Old school version runs better (standalone version).
Checked all microcode updates and drivers are in order. (Using Nvidia GP106 [GeForce GTX 1060 3GB]
System is up to date (apt)
Found the best options:
Performance Better: Restart Android Emulated Device with 'Cold Boot' option specified
or
Use Diff Emulator: Virtual Machine Manager / Virsh (KVM-QEMU)
or
Use Physical Device: With Android 11+ you can wifi pair.
With devices APIs lower than 11, there is no Wi-Fi pair feature so I found solution was to install termux on the handset I wanted to use for app testing, which gave me a standardish shell with apt pkg manager -- then I could install sshd and connect to dev-PC with portforward i.e
$ SSH from Phone to PC with: ssh -R 4444:127.0.0.1:5555 ubuntu#192.168.1.20
$ SSH from PC to Phone with: ssh -L 4444:127.0.0.1:5555 ubuntu#192.168.1.20
(The exact command may vary, written from memory as quick guide to get you moving right direction thought ports are correct, syntax may need adjusting and of course, the username#hostIP needs setting to your you-login#your-computers--LAN-IP).
Once an SSH connection has been established, which you can check using something like
$ ss -tulpan | grep 4444
or
$ netstat -tulpan | grep 4444
Once confirmed established, you need to fire up adb to connect to the now available Android adb service that we forwarded from the handset into the dev-PC by running the command (also make sure you have USB debugging enabled on the handset before doing this);
On dev-PC run;
$ adb connect 127.0.0.1:4444
It should say 'CONNECTED'.
Then to double check, run:
$ adb devices
Emulator should show up in Android Studio Device Manager. Give it a few minutes and Android Studio will pick it up!
I can't remember the specific reason I needed to do it this way as opposed to just connecting with a USB cable. I think I was doing some mad routed setup. But there we have it!
I found using a physical device to be the ultimate performance solution but is of course a bulky arrangement.
Update
Increasing memory available to Android Studio and the VM made big difference (I have 16gb RAM).
Android Studio > Help > Change Memory Settings (2048 -> 4096)
Android Studio > Help > Edit Custom VM Options > add/replace-->
(-Xmx4096m
(-Xmx4096m
(Then finally added extra config to Gradle script to allow extra memory but I don't think that would have an impact on the slow running issue as was entire emulator crumbling not just the app.)
In gradle.properties, replace order.gradle.jvmargs.... (with)
org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
Finally, restart Android / Emulator and remember to do a COLD BOOT on your emulator device.

Process system isn't responding in android emulator

When I starts android emulator in android studio ; after boot completes this window opens :
and emulator hangs . How can I fix this problem ?
In my case, cold reboot resolves the issue on an OSX machine.
Close all open emulator first
Open android studio configure > avd manager
from the virtual device you are working on action > cold boot now
Hope the interface will be almost similar to Linux and Windows machine and the fix will workout there too.
I found some solutions in this page :
Error Message: emulator-arm.exe has stopped working
In this page suggests changing of resolution and RAM and you should decrease them.
When I decrease my resolution It fixes this problem .
Try to use a low-resolution device, when I selected Nexus 4 it kept running smoothly with me. If it doesn't work. try this:
If you want to have graphics acceleration enabled by default for this AVD, in the Hardware section of the AVD configuration, click New, select GPU emulation and set the value to Yes.
Beyond other possible solutions, what worked to me was to change the "Emulated performance" option to "Software".
I have tried changing the resolution, RAM size, Emulated performance graphic type, etc.. but none of them worked. Finally, I found that the android version image was my problem(Android P) so I downloaded a different version image and it worked fine
If the virtual device was previously working, try to wipe user data.
Go to the AVD manager, select the virtual device action and click on "Wipe data" (Wipe the user data of this AVD)
Here is how I fixed it:
In the AVD Manage-> Create Virtual Device... -> New Hardware Profile
Device Name: My Device
Resolution 800 x 600
RAM: 512 MB
Left other options as default -> Finish
Next -> Next (Or select API e.g R) -> Finish
That device never throws that error and works faster.
You can try doing cold reboot from Android Studio. It'll work normally then. I guess it usually happens when your PC/laptop goes into sleep mode, with emulator, debugger running in the background.
Solution 1:
Decrease API level resolves the issue on an Windows machine.
Solution 2:
Try to use a low-resolution device, If it doesn't work. try this:
If you want to have graphics acceleration enabled by default for this AVD, in the Hardware section of the AVD configuration, click New, select GPU emulation and set the value to Yes.
Solution 3:
Follow Steps:
Go to Device Manager
Select Wipe Data
Launch AVD again

AVD Emulator stuck on loading screen in Android Studio

I decided to try Android Studio 2.0 having used Eclipse in the past but I'm having considerable difficulty getting the AVD to load correctly. I've done quite a bit of googling and research into the problem, both here on SO and Google.So far nothing has worked.
The emulator simply hangs on the android load-up screen ever time I try to run it. I've seen it advised to use Genymotion but I would first prefer to resolve the issue natively in Android Studio to feel confident going forward using the IDE for building projects.
Here's what I've tried:
Complete reinstall of Android, SDK and SDK Tools
Install and configure of Intel x86 accelerator
Lowered the RAM amount to 512 in AVD settings
Multiple attempts at deleting and recreating AVD's
Tried creating different AVD phone models(Nexus One,Nexus 5x etc.)
Resetting ADB in AVD Monitor Tool
Starting ADB server from terminal
Restarting Android Studio multiple times after changes
Running SDK/SDK Tools updates several times
Made sure the SDK path is correct
These are the majority of the "solutions" I found either on other similar SO questions or by googling none of which has resolved the problem.
When I run the emulator currently it displays the following in the run window:
/Users/<username>/Library/Android/sdk/tools/emulator -netdelay none -netspeed full -avd Nexus_5X_API_23
Warning: requested ram_size 1024M too big, reduced to 512M
emulator: WARNING: Increasing RAM size to 1024MB
emulator: WARNING: VM heap size set below hardware specified minimum of 228MB
emulator: WARNING: Setting VM heap size to 256MB
Hax is enabled
Hax ram_size 0x20000000
HAX is working and emulator runs in fast virt mode.
console on port 5554, ADB on port 5555
The emulator shows up fine in the Android AVD Monitor devices pane and even appears to go through the entire booting process on the emulator screen itself but never gets to the Android home screen.
Also, Logcat seems to be looping continuously through dozens of errors and warnings, which don't offer any clear indication of what the issue might be or direction of how to resolve it.
I feel like I've exhausted every idea and not sure how to move forward.Just for the record, I am running El Capitan 10.9.2 with a 2.4gh Intel Core 2 Duo and 4gb ram.It's not the fastest machine for sure but should be capable of running Android Studio and the emulator.
Any help or guidance resolving this problem is gratefully appreciated!
For me this worked: in AVD(Tools->AVD) click on the small arrow for desired emulator then click on "Wipe data".
After that, it successfully started - passed the android logo screen - although a bit slowly.
You have two thing:
You should Increase your ADB emulator Heap to the minimum required.
in your case: 512M
into your AVD Manager:
Click Edit on your Emulator
"Show Advanced Settings" at the bottom
Go to: "Memory and Storage"
Edit the VM heap value to 512 MB
Finished
Image:
You can Wipe data to your Emulator. here is an exemple website
At one point my laptop hit a kernel panic and restarted while running an active AVD emulator session. When attempting to restart the emulator, the emulated device (Pixel 3) stayed stuck on the startup splash logo screen.
Fix steps:
Stop hung emulator session.
rm ~/.android/avd/name_of_emulated_device.avd/*.lock
rm ~/.android/avd/name_of_emulated_device.avd/*.qcow2
Restarting the emulated AVD should now be successful.
Windows equivalent for ~/.android should be C:\Users\.android, but I can't confirm this myself.
Note: You will likely lose any additionally installed apps and current work that was on the AVD.
Unfortunately, increasing the heap size didn't help in my case. The virtual device was actually running fine before with the previous amount of heap.
What I eventually ended up doing was just creating a new virtual device through the AVD manager leaving most of the fields the default value. The new device ran fine and booted up as expected and was able to run my app. It's possible something in my first virtual device became corrupted.
I had the same problem. I'm running El Capitan 10.11.5 with a 2.0GHz Intel Core 2 Duo and 8GB RAM, Android Studio 1.5.1.
After upgrading to Intel x86 Emulator Accelerator (HAXM Installer), rev 6.1.1 and deleting my API 14 SDK and related files, the newly installed API 23's Google APIs Intel x86 Atom System Image would not get past the Android logo screen.
After much trial & error, the Intel x86 Atom System Image (not Google APIs Intel x86 Atom System Image) for API 15 finally loaded the home screen on the emulator after ~ 8 min and one android system crash.
Will try the Intel x86 Atom System Image for API 23 later. Hope that helps.
I had the same problem and none of the steps listed here helped me, either.
But since the solution that worked for me was not mentioned here yet, I thought it might help you or one of the others finding this thread:
What did work for me was disabling certain settings in my Avast Antivirus as proposed by the Android studio troubleshooting page here.
My version of Avast did not have the setting "Use nested virtualization when available", however just turning off "Enable Hardware assisted virtualization" (note: restart is required for it to take effect) solved the problem just fine.
So if you are using Avast or another Antivirus which manipulates virtualization, be sure to look through the correspondent settings.
I had experienced same problem, What I did was, I clicked on the drop down in the actions column, then clicked on wipe Data, and that resolved it for me on ubuntu 20.04
I had this problem and running as admin fixed this (drove me crazy).
Hope this works for you too tried some many fixes.
What worked for me?
Create new project with same configs.
And start your old emulators in it.
What did not work?
Wiping data.
Increasing Heap size.
Creating new virtual device.
I also had the same problem with my AVD. After lots of trial and error I arrived at a solution for my problem. the problem was with the Heap size and the RAM size.
Initially the default heap size was 128 MB and RAM was 1563 , I just changed the heap size to 512 MB and reduced the RAM size( high RAM was making my pc run slow) also I enabled hardware acceleration. And Yipeee, it worked.
It's very easy to fix all you need to do is go in AVD Manager click on the small arrow on most right side of the screen beside the edit icon. Click that small arrow and select wipe data.
Now when you'll start your AVD it will restart and work properly.

Android layout issue on x86 VM

I'm trying to run my app on Android x86 in VirtualBox, and I've hit a small but annoying problem. I've not had this problem before, when I had the VM at the tablet resolution I was mimicking. However, I'm now running the VM at and writing the app for a smaller (phone) resolution. The problem is that the layout looks fine in eclipse and on the actual phone, but everything is shifted in the VM. The resolution and pixel density are supposed to be the same in all three cases, so I'm not sure what to do. The app still functions, but I would prefer the various views to be where they should and look correctly placed, instead of being shifted left and up. It's almost as if everything is drawn correctly in a subset of the screen. Thanks in advance for any help!

Resources