gpt4 book ai didi

android - Visual Studio 不会在 Android 模拟器上部署项目

转载 作者:行者123 更新时间:2023-11-29 01:09:03 25 4
gpt4 key购买 nike

我刚刚安装了 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 ==========

这就是模拟器的样子,它就在那里,而不是显示上面构建/部署的应用程序。

enter image description here

最佳答案

在主解决方案文件的“配置属性”中,检查“部署功能”是否已启用。

关于android - Visual Studio 不会在 Android 模拟器上部署项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44580352/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com