Android studio could not build and run in my windows 7 OS - android

I am newbie for android development :)
Install android studio from https://developer.android.com/studio/index.html.
After install i start develop sample application which is available in android studio website, after complete that sample project i try to build and run app. It ask to run a simulator for android phone, i select API27 - Nexus 7.
I am not able to process further it thrown error, after simulator getting crashed. below mentioned that issue.
My PC Intel core 3, is there any configuration is need for boot config itself.
daemon started successfull
Executing tasks:[:app:assembleDebug]
Gradle build finished in 12s 793ms
Emulator: Warning: Quick Boot / Snapshots not supported on this machine.
A CPU with EPT + UG features is currently needed. We will address this in
a future release.
Emulator: WARNING: init: Missing WGL extension WGL_ARB_create_context
Emulator: glTextImage2D: got err pre:(0x506 internal 0x1908 format 0x1908 type 0x1401

Try to update my drivers. Update Intel drivers with help of.
Intel® Driver & Support Assistant
https://www.intel.com/content/www/us/en/support/detect.html,
First time android simulator loaded slowly after that it loaded properly and faster.

Related

How to debug Visual Studio 2019 not connecting to Android x86 AVD

I'm trying to debug a NativeActivity C++ Android application from Visual Studio 2019, using the Visual Studio Android tools.
My system uses Windows 10 Pro, with Hyper-V enabled, running a number of other Hyper-V images (this cannot be turned off for reasons,) but the development Windows install is the "main" (host) OS.
I can build the sample application, and I can attempt to connect it to the VisualStudio_android-25_arm_phone AVD. However, one of two things happen:
If I just run out of Visual Studio, I get the error:
Severity Code Description Project File Line Suppression State
Error Error installing the package. The device 'VisualStudio_android-25_x86_phone' is invalid or not running. Please switch to another device, or use the Android Virtual Device (AVD) Manager to start a compatible emulator, or connect a compatible Android device. XMCRemote3.Packaging 0
If I start the appropriate x86 AVD inside the AVD manager, the device actually starts up. If I then try to run in Visual Studio, I get an error dialog from the AVD Manager that the device and the host have different versions of ADB.
Device error: adb server version (39) doesn't match this client (41); killing...
* daemon started successfully
adb.exe: device offline
This is the Visual Studio log when that happens:
1>Failed to start emulator.
1>emulator: Requested console port 5556: Inferring adb port 5557.
1>emulator: ERROR: x86 emulation currently requires hardware acceleration!
1>Please ensure Intel HAXM is properly installed and usable.
1>CPU acceleration status: Android Emulator requires an Intel processor with VT-x and NX support. Your CPU: 'AuthenticAMD'
1>Error installing the package. The device 'VisualStudio_android-25_x86_phone' is invalid or not running. Please switch to another device, or use the Android Virtual Device (AVD) Manager to start a compatible emulator, or connect a compatible Android device.
1>The device is invalid or is not running.
I don't think I have the "x86 device doesn't work on AMD" problem, as I'm using Hyper-V, and the device starts up and is interactive when I launch it manually.
Sometimes, I think I might have a "ADB port number" issue, because the error message in the log sometimes talks about ports 5556 and 5557, and sometimes about 5553 and 5554. However, I wouldn't know at all where that's coming from, or what to do with it.
And, like in case 2 above, sometimes it just claims ADB is mis-matched.
What can I do about this? Do I need to update the device image, or the local tools? Both were very recently downloaded/installed.
I'm targeting SDK version 21 for both minimum and target versions.
The SDK Tools version is 30.0.4, and the emulator is 30.1.5.
The Platforms installed are 8.0/26 and 7.1/25 (the list only goes up to 8.1/27)
Interestingly, there's no "NDK" version listed in the SDKs and Tools android settings app, even though Visual Studio compiles and links it just fine.
I wonder if the Visual Studio package is installing something on the side? If so, is there another tool to manage what this is than the "Android" sub-menu in the Visual Studio "Tools" menu?

Cannot run non-x86 arch in Android Studio emulator

First of all, my bug is similar with this one: Where to get this missing file - Android Studio , Emulator
While for all, I installed the latest sdk info in android studio:
The thing is I can only run x86/x86_64 image AVD in my computer. These images works well. But when I try to use other, take arm for example, things don't work out, the AVD just hang there and command output
上午11:33 Emulator: statvfs('/home/f0rm2l1n/.android/avd/Pixel_aarch.avd/snapshots/default_boot/ram.img') failed: No such file or directory
上午11:33 Emulator: Warning: QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled ((null):0, (null))
上午11:33 Emulator: queryCoreProfileSupport: swap interval not found
I tried with choosing Cold Boot and Raising RAM & Storage. But it is not solved.
Any suggestions will help? I just want to run a AArch64 AVD for homework XD

Running android emulator with Azure windows 10

I am trying to run an android emulator on an azure VM running windows, Windows 10 Pro version 1809 - But I am getting the following error message running the android emulator:
C:\Program Files (x86)\Android\android-sdk\emulator>emulator -AVD androidemulatorapi28
emulator: ERROR: x86 emulation currently requires hardware acceleration!
Please ensure the Windows Hypervisor Platform (WHPX) is properly installed and usable.
CPU acceleration status: HAXM is not installed on this machine
The hyper-v is enabled:
And Windows Hypervisor Platform as well:
The size of the VM is D2_v3 and Dv3 - series is supposed to support Nested Virtualization. Here, here and here are claims about it being so and that android emulator functions. And as I far as I have understood:
...is part of Dv3 series.
What could be the problem?
I am able to run an Ubuntu VM in Hyper-V of the Azure Windows VM.
Disabling Hyper-V and Windows Hypervisor Platform, installing HAXM and running I get this error:
According to the writer of this medium article and this StackOverflow discussion - A special custom implementation of OpenGL is necessary - because the particular azure VM size doesn't come with a GPU. However, following the steps of the article I get another type of crash - when using the Mesa3D+LLvmpip version of opengl32.dll from the authors Github repo, replacing the OpenGL file in system32 and running the android emulator:
I found there was a gihub repo - distributing Mesa3D and LLvmpip - downloading mesa3d-19.1.3-release-mingw.exe and running the cmd file:
There is the following message in cmd:
This deployment utility targets systems without working GPUs and any use case
where hardware-accelerated OpenGL is not available. This mainly covers
virtual machines in cloud environments and RDP connections. It can be
used to replace Microsoft Windows inbox OpenGL 1.1 software render
driver with Mesa3D soft pipe, llvmpipe or SWR driver.
...which seems to be a fit for the driver rendering problem.
I was able to git rid of all cmd warnings and error by-avd myandroidemulatorapi28, and any with of following two flags -gpu angle_indirect or -gpu swiftshader_indirect. And set QEMU_AUDIO_DRV=none before running it. The GUI message about the driving issue still comes up and there is a black screen.
According to the owner of the mesa-dist-win GitHub repo - he could reproduce the GUI message diver complaint and still run the emulator successfully - when imitating the state of a VM with his machine.
Note: This is not a solution, this is for sharing details of what I learned after trying out around 10-20 ways:
To enable virtualization in azure VDI, you need to enable Hyper-V feature.
After that you can see in your task manager->Performance that the virtualization is set to true.
If not, try enabling it from command prompt.
bcdedit /set hypervisorlaunchtype auto
After that virtualization is enabled.
Now, you won't be able to install Intel HAXM, as there is a race condition between Hyper-V and Intel HAXM for virtualization.
So, Without Intel HAXM, AVD won't run.
Without Enabling Virtualization with Hyper-V, there will be just black screen in AVD, and it won't boot.
So, I believe there is no solution to this problem until now, I have search everything on google, stackoverflow. If someone finds a solution, please post it over here.
Im facing the same issue with you using Win10 or Windows Server 2019 for DV3 and EV3 series. But I got it working on ubuntu if you are open for that option. No hyper v or haxm required, it is using KVM
Just go to the link "https://github.com/intel/haxm".
Scroll down to find "Downloads".
Download the "haxm-windows_v7_7_1.zip" for windows & haxm-macosx_v7_7_1.zip for macoxs.
Install the package and it will solve the issue.
They is another android emulator that is working
https://www.sanganakauthority.com/2020/04/run-android-emulator-and-android-studio.html

Emulator: emulator: ERROR: x86_64 emulation currently requires hardware acceleration

When I try to run my Hello application , the emulator gives this message. What is the sulotion?
This is the emulator view unfortunately.
Error
31/08/2018
16:32 Gradle sync started
16:32 Project setup started
16:32 Gradle sync finished in 3s 187ms (from cached state)
16:34 IDE and Plugin Updates: Android Studio is ready to update.
16:35 * daemon not running; starting now at tcp:5037
16:35 * daemon started successfully
16:35 Executing tasks: [:app:assembleDebug]
16:35 Emulator: emulator: ERROR: x86_64 emulation currently requires
hardware acceleration!
16:35 Emulator: Process finished with exit code 1
16:35 Gradle build finished in 27s 847ms
Boot into bios and enable VTX. This allows the emulator to use hardware virtualization.
As can be seen in your error-output, running an emulator x86_64 emulation currently requires hardware acceleration!.
What does this error mean/where does it come from?
Emulations run in a virtualized thread of your CPU. A CPU normaly got several physical cores (e.g. in QuadCore CPUs there are 4 physical cores). Virtualization furthermore subdivides these cores into multiple "virtual" cores, meaning it simulates more phyisical cores. You can read more information elsewhere on the internet. Here an extract from geek-university which sums it up pretty short to the point:
CPU virtualization involves a single CPU acting as if it were multiple
separate CPUs. The most common reason for doing this is to run multiple different operating systems on one machine. CPU
virtualization emphasizes performance and runs directly on the
available CPUs whenever possible. The underlying physical resources
are used whenever possible and the virtualization layer runs
instructions only as needed to make virtual machines operate as if
they were running directly on a physical machine.
When many virtual machines are running [...], those [...]
might compete for CPU resources. [...].
Emulators need this environment due to the highlighted reason: Its emulating an entire other system - In your case an Android smartphone.
Solution
Regarding you have an Intel-CPU (AMD should be somehow analog), this should solve your problem.
As general note (this seems to be solved in OPs question since its not in the error log): Make sure Intel x86 Emulator Accelerator (HAXM installer) is installed in your Android SDK (check under Settings -> Appearance & Behavior -> System Settings -> Android SDK -> SDK Tools)
Also as note if somebody wants to check if he has OPs problem coming from a more generic error: Run this command in the command line (needs Android SDK Command-line Tools (latest) to be installed in your SDK):
C:\Android\YourApp> C:\Users\{Username}\AppData\Local\Android\Sdk\emulator\emulator.exe -avd YourAVDName -netspeed full -netdelay none
# The First is your path to your SDKs emulator.exe; use the path you installed the SDK in
# -avd needs a name of an existing AVD you set up in the AVD Manager in Android Studio.
The possible outcome is (if HAXM is already installed and hardware acceleration is your poblem):
emulator: Android emulator version 30.5.3.0 (build_id 7196367)
(CL:N/A) handleCpuAcceleration: feature check for hvf emulator: ERROR:
x86_64 emulation currently requires hardware acceleration! CPU
acceleration status: VT feature disabled in BIOS/UEFI More info on
configuring VM acceleration on Windows:
https://developer.android.com/studio/run/emulator-acceleration#vm-windows
General information on acceleration:
https://developer.android.com/studio/run/emulator-acceleration.
Note that I used an AVD with x86_64 here.
To solve the error you have to restart your PC and enter your BIOS. Search for you CPU-preferences (can often be found in an Advanced-options tab). Somewhere there you'll find a setting called Intel Virtualization Technology which presumably is disabled. enable and restart your computer.
Now your AVD should work fine.

Emulator not working: "CPU with EPT + UG needed"

I'm new to Android Studio, this is my first attempt at running an app. My computer is relatively slow and can't run HAXM so I'm using the ARM instead of the x86 build for the emulator. When I try running it, I get this error:
21:31 Gradle build finished in 15s 887ms
21:31 Emulator: WARNING: init: Missing WGL extension WGL_ARB_create_context
21:31 Emulator: Warning: Quick Boot / Snapshots not supported on this machine. A CPU with EPT + UG features is currently needed. We will address this in a future release.
21:31 Emulator: emulator: WARNING: UpdateCheck: Failure: Error
21:32 Emulator: Process finished with exit code -1073741819 (0xC0000005)
I've tried following instructions from multiple questions on this site, but nothing has worked for me so far. Is there a way to run the emulator or is it just not compatible with my computer? Thanks.
The issues have to do with the specific device you're trying to emulate and the processor you have (intel core 2 or older)
To solve it:
Create a new emulator
Select the device you would like to emulate.
On the next page with the header "System Image" select the tab "other images"
Download and select an image that is listed as armeabi-v7a under the ABI column.
That image should run successfully with your processor.

Categories

Resources