我刚刚安装了VS2017并创建了一个vanilla项目,看看我能不能在Android模拟器上运行它。项目构建,模拟器启动并运行,但我的应用程序无法在模拟器中启动。在构建或部署项目时,我没有遇到任何错误。你能不能给我一个关于我在哪里开始解决这个问题的想法。
安迪
1>------ Build started: Project: MyFirstApp.Android, Configuration: Debug Any CPU ------
1> MyFirstApp.Android -> c:\users\family\documents\visual studio 2017\Projects\MyFirstApp\MyFirstApp\MyFirstApp.Android\bin\Debug\MyFirstApp.Android.dll
1>c:\users\family\documents\visual studio 2017\Projects\MyFirstApp\MyFirstApp\MyFirstApp.Android\MyFirstApp.Android.csproj : warning XA0105: The $(TargetFrameworkVersion) for FormsViewGroup.dll (v7.1) is greater than the $(TargetFrameworkVersion) for your project (v6.0). You need to increase the $(TargetFrameworkVersion) for your project.
1>c:\users\family\documents\visual studio 2017\Projects\MyFirstApp\MyFirstApp\MyFirstApp.Android\MyFirstApp.Android.csproj : warning XA0105: The $(TargetFrameworkVersion) for Xamarin.Forms.Platform.Android.dll (v7.1) is greater than the $(TargetFrameworkVersion) for your project (v6.0). You need to increase the $(TargetFrameworkVersion) for your project.
1>c:\users\family\documents\visual studio 2017\Projects\MyFirstApp\MyFirstApp\MyFirstApp.Android\MyFirstApp.Android.csproj : warning XA0105: The $(TargetFrameworkVersion) for Xamarin.Forms.Platform.dll (v7.1) is greater than the $(TargetFrameworkVersion) for your project (v6.0). You need to increase the $(TargetFrameworkVersion) for your project.
2>Starting deploy VisualStudio_android-23_x86_phone ...
2>Starting emulator VisualStudio_android-23_x86_phone ...
2>C:\PROGRA~2\Android\ANDROI~1\tools\emulator.EXE -partition-size 512 -no-boot-anim -avd VisualStudio_android-23_x86_phone -prop monodroid.avdname=VisualStudio_android-23_x86_phone
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: emulator window was out of view and was recentered
2>Emulator VisualStudio_android-23_x86_phone is running.
2>Waiting for emulator to be ready...
2>Deploying VisualStudio_android-23_x86_phone ...
2>Build started.
2>Project "MyFirstApp.Android.csproj" (Install target(s)):
2>Project "MyFirstApp.csproj" (GetTargetFrameworkProperties target(s)):
2>Done building project "MyFirstApp.csproj".
2>Project "MyFirstApp.csproj" (GetTargetPath target(s)):
2>Done building project "MyFirstApp.csproj".
2>Project "MyFirstApp.csproj" (GetNativeManifest target(s)):
2>Done building project "MyFirstApp.csproj".
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Roslyn\csc.exe /noconfig /nowarn:1701,1702,2008 /nostdlib+ /errorreport:prompt /warn:4 /define:DEBUG;TRACE;__XAMARIN_ANDROID_v1_0__;__MOBILE__;__ANDROID__;__ANDROID_1__;__ANDROID_2__;__ANDROID_3__;__ANDROID_4__;__ANDROID_5__;__ANDROID_6__;__ANDROID_7__;__ANDROID_8__;__ANDROID_9__;__ANDROID_10__;__ANDROID_11__;__ANDROID_12__;__ANDROID_13__;__ANDROID_14__;__ANDROID_15__;__ANDROID_16__;__ANDROID_17__;__ANDROID_18__;__ANDROID_19__;__ANDROID_20__;__ANDROID_21__;__ANDROID_22__;__ANDROID_23__ /errorendlocation /preferreduilang:en-US /reference:"c:\users\family\documents\visual studio 2017\Projects\MyFirstApp\packages\Xamarin.Forms.2.3.4.247\lib\MonoAndroid10\FormsViewGroup.dll" /reference:"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\Java.Interop.dll" /reference:"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v6.0\Mono.Android.dll" /reference:"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\mscorlib.dll" /reference:"c:\users\family\documents\visual studio 2017\Projects\MyFirstApp\MyFirstApp\MyFirstApp\bin\Debug\MyFirstApp.dll" /reference:"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Core.dll" /reference:"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\System.dll" /reference:"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Xml.dll" /reference:"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Xml.Linq.dll" /reference:"c:\users\family\documents\visual studio 2017\Projects\MyFirstApp\packages\Xamarin.Android.Support.Animated.Vector.Drawable.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.Animated.Vector.Drawable.dll" /reference:"c:\users\family\documents\visual studio 2017\Projects\MyFirstApp\packages\Xamarin.Android.Support.Design.23.3.0\lib\MonoAndroid43\Xamarin.Android.Support.Design.dll" /reference:"c:\users\family\documents\visual studio 2017\Projects\MyFirstApp\packages\Xamarin.Android.Support.v4.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v4.dll" /reference:"c:\users\family\documents\visual studio 2017\Projects\MyFirstApp\packages\Xamarin.Android.Support.v7.AppCompat.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.AppCompat.dll" /reference:"c:\users\family\documents\visual studio 2017\Projects\MyFirstApp\packages\Xamarin.Android.Support.v7.CardView.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.CardView.dll" /reference:"c:\users\family\documents\visual studio 2017\Projects\MyFirstApp\packages\Xamarin.Android.Support.v7.MediaRouter.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.MediaRouter.dll" /reference:"c:\users\family\documents\visual studio 2017\Projects\MyFirstApp\packages\Xamarin.Android.Support.v7.RecyclerView.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.RecyclerView.dll" /reference:"c:\users\family\documents\visual studio 2017\Projects\MyFirstApp\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.Vector.Drawable.dll" /reference:"c:\users\family\documents\visual studio 2017\Projects\MyFirstApp\packages\Xamarin.Forms.2.3.4.247\lib\MonoAndroid10\Xamarin.Forms.Core.dll" /reference:"c:\users\family\documents\visual studio 2017\Projects\MyFirstApp\packages\Xamarin.Forms.2.3.4.247\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll" /reference:"c:\users\family\documents\visual studio 2017\Projects\MyFirstApp\packages\Xamarin.Forms.2.3.4.247\lib\MonoAndroid10\Xamarin.Forms.Platform.dll" /reference:"c:\users\family\documents\visual studio 2017\Projects\MyFirstApp\packages\Xamarin.Forms.2.3.4.247\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll" /reference:"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\Facades\Microsoft.Win32.Primitives.dll" /reference:"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\Facades\Microsoft.Win32.Registry.AccessControl.dll" /reference:"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\Facades\Microsoft.Win32.Registry.dll" /reference:"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\Facades
...
2>Project "MyFirstApp.csproj" (GetCopyToOutputDirectoryItems target(s)):
2>Done building project "MyFirstApp.csproj".
2>MyFirstApp.Android -> c:\users\family\documents\visual studio 2017\Projects\MyFirstApp\MyFirstApp\MyFirstApp.Android\bin\Debug\MyFirstApp.Android.dll
2>The $(TargetFrameworkVersion) for FormsViewGroup.dll (v7.1) is greater than the $(TargetFrameworkVersion) for your project (v6.0). You need to increase the $(TargetFrameworkVersion) for your project.
2>The $(TargetFrameworkVersion) for Xamarin.Forms.Platform.Android.dll (v7.1) is greater than the $(TargetFrameworkVersion) for your project (v6.0). You need to increase the $(TargetFrameworkVersion) for your project.
2>The $(TargetFrameworkVersion) for Xamarin.Forms.Platform.dll (v7.1) is greater than the $(TargetFrameworkVersion) for your project (v6.0). You need to increase the $(TargetFrameworkVersion) for your project.
2> Processing: obj\Debug\res\layout\tabbar.xml
2> Processing: obj\Debug\res\layout\toolbar.xml
2> Processing: obj\Debug\res\values\styles.xml
2>C:\Program Files\Java\jdk1.8.0_131\\bin\keytool.exe -list -alias androiddebugkey -storepass android -keypass android -keystore "C:\Users\Family\AppData\Local\Xamarin\Mono for Android\debug.keystore"
2>C:\Program Files\Java\jdk1.8.0_131\\bin\jarsigner.exe -keystore "C:\Users\Family\AppData\Local\Xamarin\Mono for Android\debug.keystore" -storepass android -keypass android -digestalg SHA1 -sigalg md5withRSA -signedjar bin\Debug\\MyFirstApp.Android-Signed-Unaligned.apk "c:\users\family\documents\visual studio 2017\Projects\MyFirstApp\MyFirstApp\MyFirstApp.Android\obj\Debug\android\bin\MyFirstApp.Android.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-06-08) or after any future revocation date.
2>C:\Program Files (x86)\Android\android-sdk\build-tools\23.0.3\zipalign.exe 4 "c:\users\family\documents\visual studio 2017\Projects\MyFirstApp\MyFirstApp\MyFirstApp.Android\bin\Debug\MyFirstApp.Android-Signed-Unaligned.apk" "bin\Debug\\MyFirstApp.Android-Signed.apk"
2>Done building project "MyFirstApp.Android.csproj".
2>Build succeeded.
2>Deploy successfully on VisualStudio_android-23_x86_phone
========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========
这就是模拟器的样子,它只是坐在那里而不是显示上面构建/部署的应用程序。
答案 0 :(得分:1)
在主解决方案文件的“ 配置属性”中,检查是否已启用“ 部署功能”。