当我在Xamarin / Visual Studio 2017中构建和部署我的应用程序时,构建输出会输出以下内容:
Restoring NuGet packages...
To prevent NuGet from restoring packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages during build.'
1>------ Build started: Project: MedicineApp.Droid, Configuration: Debug Any CPU ------
1> MedicineApp.Droid -> C:\Users\Jon Ravn Nielsen\Source\Repos\MedicineApp_2.0\MedicineApp.Droid\bin\Debug\MedicineApp.Droid.dll
2>Starting deploy Android_Accelerated_Nougat ...
2>Starting emulator Android_Accelerated_Nougat ...
2>C:\PROGRA~2\Android\ANDROI~1\tools\emulator.EXE -partition-size 512 -no-boot-anim -avd Android_Accelerated_Nougat -prop monodroid.avdname=Android_Accelerated_Nougat
2>emulator: ERROR: cmd_camera_device_start_capturing: Unable to set video format: 0
2>Hax is enabled
2>Hax ram_size 0x40000000
2>HAX is working and emulator runs in fast virt mode.
2>emulator: Listening for console connections on port: 5554
2>emulator: Serial number of this emulator (for ADB): emulator-5554
2>Emulator Android_Accelerated_Nougat is running.
2>Waiting for emulator to be ready...
2>Deploying Android_Accelerated_Nougat ...
2>Build started.
2>Project "MedicineApp.Droid.csproj" (Install target(s)):
2>C:\Program Files\Java\jdk1.8.0_144\\bin\keytool.exe -list -alias androiddebugkey -storepass android -keypass android -keystore "C:\Users\Jon Ravn Nielsen\AppData\Local\Xamarin\Mono for Android\debug.keystore"
2>C:\Program Files\Java\jdk1.8.0_144\\bin\jarsigner.exe -keystore "C:\Users\Jon Ravn Nielsen\AppData\Local\Xamarin\Mono for Android\debug.keystore" -storepass android -keypass android -digestalg SHA1 -sigalg md5withRSA -signedjar bin\Debug\\com.xamarin.MedicineApp-Signed-Unaligned.apk "C:\Users\Jon Ravn Nielsen\Source\Repos\MedicineApp_2.0\MedicineApp.Droid\obj\Debug\android\bin\com.xamarin.MedicineApp.apk" androiddebugkey
2>No -tsa or -tsacert is provided and this jar is not timestamped. Without a timestamp, users may not be able to validate this jar after the signer certificate's expiration date (2047-11-05) or after any future revocation date.
2>C:\Program Files (x86)\Android\android-sdk\build-tools\25.0.3\zipalign.exe 4 "C:\Users\Jon Ravn Nielsen\Source\Repos\MedicineApp_2.0\MedicineApp.Droid\bin\Debug\com.xamarin.MedicineApp-Signed-Unaligned.apk" "bin\Debug\\com.xamarin.MedicineApp-Signed.apk"
2>Done building project "MedicineApp.Droid.csproj".
2>Build succeeded.
2>Deploy successfully on Android_Accelerated_Nougat
========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========
该应用程序似乎是成功构建和部署,但该应用程序永远不会出现在Android模拟器上的任何地方?
当我第一次创建.Driod项目时,我可以正常运行Hello World-app。
答案 0 :(得分:1)
我刚才通过转到Android选项,选择高级属性并将x86添加到支持的体系结构来修复此问题。然后从AVD Android Emulator Manager启动模拟器。启动后,调试应用程序。祝好运。