Android Device Manage throws error in Visual Studio 2017 - visual-studio

Whenever I try to create a new virtual device in Android Device Manager from Visual Studio, I get the following error:
AVD CREATION ERROR: AVD failed to create with error : AVD Manager has returned non-zero exit code: 1. Please check logs for more information.
From logs, I found the following snippet which is probably the error:
[18-05-12 10:45:44.76] [AvdManager.CreateAvd] AVD Manager has returned non-zero exit code: 1
Command: C:\Program Files (x86)\Android\android-sdk\tools\bin\avdmanager.batcreate avd -n my_device -k system-images;android-25;google_apis_playstore;x86 --tag google_apis_playstore --abi x86 -d Nexus 5X --sdcard 100M
Details: Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
at com.android.sdklib.tool.AvdManagerCli.run(AvdManagerCli.java:213)
at com.android.sdklib.tool.AvdManagerCli.main(AvdManagerCli.java:200)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
... 5 more
It happens no matter whatever configuration or version of Android I use.
Details:
OS: Windows 10 Professional x64
Processor: Ryzen 1700

Uninstalling all other versions of JAVA SDK except SDK 8 done the work for me.
My current JAVA SDK's:

Related

Cannot start emulator with Android 11

My environment is
Windows 10 Home Single Language 21H1
VS2019 Community 16.11.7
Android Emulator 30.1.5
HAXM 7.5.6
I can run Android 9.0 (API 28) in Android Emulator.
But I can't run Android 10.0 (API 29) and Android 11.0 (API 30) in Android Emulator. The emulator will start then stop by itself, no error message.
Following is my Android 11.0 (API 30), others are set as default.
Base Device: Pixel 2 (+ Store)
Processor: x86
OS: R 11.0 - API 30
I need to test in Android 11.0. What cause the error and how to fix it?
Update 2021-12-01
I've try following steps.
Change from fastboot.forceFastBoot to fastboot.forceColdBoot. Not working.
Reduce hw.cpu.ncore from 4 to 1. Not working.
Reduce hw.ramSize from 1536 to *768. Not working.
I've try start the emulator from command, and here is what I got:
"C:\Program Files (x86)\Android\android-sdk\emulator\emulator.EXE" -partition-size 512 -no-boot-anim -feature WindowsHypervisorPlatform -avd pixel_2_r_11_0_-_api_30 -prop monodroid.avdname=pixel_2_r_11_0_-_api_30
emulator: WARNING: Crash service did not start
Active code page: 65001
WARNING: unexpected '-prop' value ('monodroid.avdname=pixel_2_r_11_0_-_api_30'), only 'qemu.*' properties are supported
Failed to open /qemu.conf, err: 2
HAX is working and emulator runs in fast virt mode.
Active code page: 65001
C:\Program Files (x86)\Android\android-sdk\emulator\qemu\windows-x86_64\qemu-system-x86_64.exe: error while loading state for instance 0x0 of device 'goldfish_pipe'
deleteSnapshot: for default_boot
VCPU shutdown request
emulator: Saving state on exit with session uptime 255 ms
Thanks

Xamarin Android Native/Forms build success but deployment failed on both emulator/device in Windows 10

I tired xamarin native android and forms but both does seems to work. Both gives errors.
Tried creating blank xamarin android app without any code written in it, tired with xamarin forms app. Did a build, rebuild, clean, restarted system, restarted visual studio, running vs as admin all possible things but nothing worked out.
Below is the Device Log Information
Time Device Name Type PID Tag Message
10-13 23:18:30.003 Motorola XT1068 Error 19565 AndroidRuntime java.lang.RuntimeException: Unable to get provider mono.MonoRuntimeProvider: java.lang.RuntimeException: Unable to find application Mono.Android.DebugRuntime!
at android.app.ActivityThread.installProvider(ActivityThread.java:5177)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4769)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4709)
at android.app.ActivityThread.-wrap1(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1415)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5443)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
Time Device Name Type PID Tag Message
10-13 23:18:30.003 Motorola XT1068 Error 19565 AndroidRuntime Caused by: android.content.pm.PackageManager$NameNotFoundException: Mono.Android.DebugRuntime
at android.app.ApplicationPackageManager.getApplicationInfo(ApplicationPackageManager.java:304)
at mono.MonoRuntimeProvider.attachInfo(MonoRuntimeProvider.java:41)
... 11 more
Time Device Name Type PID Tag Message
10-13 23:18:30.003 Motorola XT1068 Error 19565 AndroidRuntime Caused by: java.lang.RuntimeException: Unable to find application Mono.Android.DebugRuntime!
at mono.MonoRuntimeProvider.attachInfo(MonoRuntimeProvider.java:47)
at android.app.ActivityThread.installProvider(ActivityThread.java:5174)
... 10 more
Below is the Output information
2>An existing connection was forcibly closed by the remote host
2>Done building project "demoapp.csproj".
2>Build succeeded.
2>An existing connection was forcibly closed by the remote host
2>
2>Deploy failed on Motorola XT1068
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
System Information:
Windows 10 Operating System
Microsoft Visual Studio Enterprise 2017
Version 15.4.0
VisualStudio.15.Release/15.4.0+27004.2002
Microsoft .NET Framework
Version 4.7.02046
Xamarin 4.7.10.22
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin.Android SDK 8.0.0.33
Xamarin.Android Reference Assemblies and MSBuild support.
Xamarin.iOS and Xamarin.Mac SDK 11.2.0.8
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
After changing to x86 and to release mode, now able to run in emulator. Below is the image.
But still not able to run on Android Devices
Edited
Android csproj file contents
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SelectedDevice>Motorola XT1068</SelectedDevice>
<DefaultDevice>5" KitKat %284.4%29 XXHDPI Phone</DefaultDevice>
<AndroidDesignerPreferredDevice>Nexus 4</AndroidDesignerPreferredDevice>
</PropertyGroup>
</Project>
Android Project Properties

Visual studio installer doesn't start correctly

I just had to change my HDD. So I installed a version of Windows 10 Education on my computer, and now I'm trying to install Visual studio 2017 community/enterprise ( tried both ). After running the installer which was downloaded from the official website it doesn't start the installation, I just see for a tiny amount of time a small window pop but then it instantly shuts. What could be the reason for this behavior and how to fix this problem?
Edit: I can install other software, I managed to install a few other programs without a problem, I notice this behavior only with Visual studio and additionally .NET Framework installer.
Edit2:
I found this in my temp folder :
[4/20/2017, 11:30:37] === Logging started: 2017/04/20 11:30:37 ===
[4/20/2017, 11:30:37] [4/20/2017, 11:30:38] --- logging level: standard ---
[4/20/2017, 11:30:38] Directory 'C:\Users\2D94~1\AppData\Local\Temp\931f7233a5c56697278d79b1\' has been selected for file extraction
[4/20/2017, 11:30:38] Extracting files to: C:\Users\2D94~1\AppData\Local\Temp\931f7233a5c56697278d79b1\
[4/20/2017, 11:30:38] Error 0x8007002a: Failed to extract all files out of box container #0.
[4/20/2017, 11:30:38] Error 0x8007002a: Failed to extract
[4/20/2017, 11:30:38] Error 0x8007013d: Failed to get error string from error: 0x8007002a
[4/20/2017, 11:30:38] The entire Box execution exiting with result code: 0x8007002a
[4/20/2017, 11:30:38] Launched extracted application exiting with result code: 0x0
[4/20/2017, 11:30:38] === Logging stopped: 2017/04/20 11:30:38 ===
Edit 3: THANKS MICROSOFT you really screwed me up huh.
Edit 4: After full Windows reinstall with the latest version still getting this error.
Edit 5: Changed windows version from education to professional and it works!
Had the same issue. I was running installer from my /Download folder.
Try move the installer to D: drive, it helped me.
Regards

cannot deploy app to windows phone 8.1 device

When trying to deploy (any) windows phone 8.1 error I get the following error in VS2013:
Error 3 Error : DEP6100 : The following unexpected error occurred during boostrapping stage 'Downloading package 'FF63DEA8-0A0C-4E52-B20F-84F390C30F32'': DirectoryNotFoundException - The system cannot find the path specified.
And in VS2015:
Show Details Severity Code Description Project File Line Error Error : DEP6100 : The following unexpected error occurred during bootstrapping stage 'Downloading package 'EB22551A-7F66-465F-B53F-E5ABA0C0574E (NativeMsVsMon)'': DirectoryNotFoundException - The system cannot find the path specified.
I can deploy app in visual studio 2012 , but in my case this is not an option because vs2012 does not support universal apps, so i cant open my project.
Phone is recognized by computer, it is unlocked, I've tried resetting import export settings, nothing works...
I have vs2013 update 4.

cannot deploy app to windows phone 8.1 device

When I'm trying to deploy (any) Windows Phone 8.1 error I get the following error in VS2013:
Error 3 Error : DEP6100 : The following unexpected error occurred during boostrapping stage 'Downloading package 'FF63DEA8-0A0C-4E52-B20F-84F390C30F32'':
DirectoryNotFoundException - The system cannot find the path specified.
And in VS2015:
Show Details Severity Code Description Project File Line
Error Error : DEP6100 : The following unexpected error occurred during bootstrapping stage 'Downloading package 'EB22551A-7F66-465F-B53F-E5ABA0C0574E (NativeMsVsMon)'':
DirectoryNotFoundException - The system cannot find the path specified.
I can deploy the app in Visual Studio 2013 , but in my case this is not an option because VS2013 does not support universal applicationss, so I can't open my project.
Phone is recognized by my computer, it is unlocked, I've tried resetting import export settings.
I have VS2013 update 4.
I was facing the same issue. Don't know if this is related to your issue but I've discovered that all the mess was generated by a failed attempt to update the device OS.
In short, i was unable to update my device to the last OS version. This blocked appx installations and also VS deploys.
For reference
http://www.ibtimes.co.uk/lumia-denim-update-installation-error-8018830f-developer-preview-devices-how-resolve-1482757
The only soultion I've found is to reset the device via the recovery tool mentioned in the above link
good luck

Resources