问题
I am very new to Xamarin.Android. When I run a project in Visual Studio 2015 it produces this error:
1>qemu-system-i386.exe: -drive if=none,index=0,id=system,file=C:\PROGRA~2\Android\ANDROI~1/system-images\android-19\default\x86/system.img: could not open disk image C:\PROGRA~2\Android\ANDROI~1/system-images\android-19\default\x86/system.img: Could not open 'C:\PROGRA~2\Android\ANDROI~1/system-images\android-19\default\x86/system.img': Permission denied 1>Emulator AVD_for_Nexus_S cannot be started.
I thought it was HAXM, but that is installed. I feel it's something simple, but can't seem to find it.
Any ideas on how to fix?
回答1:
Just grant full access permission to appropriate system.img file for all (or required only) users.
回答2:
Run Visual Studio as Administrator. In fact, I'd update your Visual Studio shortcut to always run Visual Studio as Administrator because this isn't the only case where you need Admin rights.
- Right click on the shortcut and go to properties.
- Click Advanced.
- Click Run as administrator.
- Click OK and OK.
回答3:
For not obvious reasons the Android emulator requests write-permissions to the system images. The emulator can't get these permissions without administrator rights because the image-files are located under C:\Program Files.
Move the SDK folder to a location where everyone has full access to (you can change the path Xamarin used in the options-dialog).
来源:https://stackoverflow.com/questions/39704098/xamarin-android-permission-denied-emulator-cannot-be-started