Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Deploy / Launch from VS to Android Emulator or Device Fails

$
0
0

Please forgive me, I'm a total noob as of this week with Xamarin. I've started off by reading Microsoft's Xamarin Get Started tutorial, and I followed creating this application step-by-step: "Create a Single Page Xamarin.Forms Application" where it walks the reader through creating a simple "Notes" application (sorry since I'm new here I can't post a link).

I am using Visual Studio 2019 Community Edition on Windows 10 professional. I have tried on two different computer, and have the same issue with both.

It compiles fine, but deploying to a device doesn't seem to work. I've tried two cases and wind up with the same result.
1) I used Android Device Manager to create a Pixel 2 Pie 9.0 x86 emulator, and the emulator successfully starts and boots up.
2) I enabled developer mode on my Galaxy S8 and connected it to the PC via USB.
In both of the cases above, the expected device shows up in the drop down next to the Start Debugging arrow. I choose the device, and press Start Debugging. After the application successfully compiles the output window says that Deployment was successful. However, the application never starts on the emulated device or the physical device. After a handful of seconds the Start Debugging arrow changes back to green and the IDE is no longer in debug mode. However, I get no error messages of any sort, and the output window just says Start debugging Android application ...

Is there something that I need to do to tell the device to launch the deployed application?

Here's the output from VS when I attempt to run:
1>------ Build started: Project: Notes.Android, Configuration: Debug Any CPU ------
1> Notes.Android -> C:\Users\ryan1\Documents\Visual Studio 2019\Learning\Notes\Notes.Android\bin\Debug\Notes.Android.dll
1> No way to resolve conflict between "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e". Choosing "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" arbitrarily.
2>Starting deployment to pixel_2_pie_9_0_-api_28 ...
2>Deploying to pixel_2_pie_9_0
-_api_28 ...
Build started.
Project "Notes.Android.csproj" (Install target(s)):
Found Java SDK version 1.8.0.
Found Java SDK version 1.8.0.
Dex Fast Deployment Enabled: False
MonoAndroid Tools: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\
Android Platform API level: 28
TargetFrameworkVersion: v9.0
Android NDK:
Android SDK: C:\Program Files (x86)\Android\android-sdk\
Android SDK Build Tools: C:\Program Files (x86)\Android\android-sdk\build-tools\28.0.3\
Java SDK: C:\Program Files\Android\Jdk\microsoft_dist_openjdk_1.8.0.25\
Application Java class: android.app.Application
Project "Notes.csproj" (GetTargetFrameworks target(s)):
Done building project "Notes.csproj".
Project "Notes.csproj" (GetTargetPath target(s)):
Done building project "Notes.csproj".
Skipping target "_VerifyXamarinAndroidSupportVersions" because all output files are up-to-date with respect to the input files.
PackageName: com.companyname.notes
Skipping target "_ResolveLibraryProjectImports" because all output files are up-to-date with respect to the input files.
Skipping target "_BuildLibraryImportsCache" because all output files are up-to-date with respect to the input files.
Skipping target "_GenerateAndroidResourceDir" because all output files are up-to-date with respect to the input files.
Skipping target "_GenerateLayoutBindings" because it has no outputs.
Skipping target "_ConvertLibraryResourcesCases" because all output files are up-to-date with respect to the input files.
Skipping target "_CompileAndroidLibraryResources" because all output files are up-to-date with respect to the input files.
Skipping target "_ConvertResourcesCases" because all output files are up-to-date with respect to the input files.
Skipping target "_CompileResources" because all output files are up-to-date with respect to the input files.
Skipping target "_PrepareUpdateAndroidResgen" because all output files are up-to-date with respect to the input files.
Checking Android SDK Build-tools version...
Selected Android SDK Build Tools Path: C:\Program Files (x86)\Android\android-sdk\build-tools\28.0.3\
Selected Android SDK Build Tools Version: 28.0.3
Android SDK Build Tools Version: 28.0.3 meets minimum requirements for Vector Drawables. OK.
Finished Checking Android SDK Build-tools version.
Skipping target "_UpdateAndroidResgen" because all output files are up-to-date with respect to the input files.
Adding assembly reference for Notes.Android, recursively...
Adding assembly reference for FormsViewGroup, recursively...
Adding assembly reference for Java.Interop, recursively...
Adding assembly reference for Mono.Android, recursively...
Adding assembly reference for System.Net.Http, recursively...
Adding assembly reference for System.Drawing.Common, recursively...
Adding assembly reference for System.Runtime.Serialization, recursively...
Adding assembly reference for System.ServiceModel.Internals, recursively...
Adding assembly reference for mscorlib, recursively...
Adding assembly reference for Notes, recursively...
Adding assembly reference for netstandard, recursively...
Adding assembly reference for System.Data, recursively...
Adding assembly reference for System.Transactions, recursively...
Adding assembly reference for System.Data.DataSetExtensions, recursively...
Adding assembly reference for System.IO.Compression, recursively...
Adding assembly reference for System.IO.Compression.FileSystem, recursively...
Adding assembly reference for System.ComponentModel.Composition, recursively...
Adding assembly reference for System.Web.Services, recursively...
Adding assembly reference for System.Core, recursively...
Adding assembly reference for System, recursively...
Adding assembly reference for Mono.Security, recursively...
Adding assembly reference for System.Numerics, recursively...
Adding assembly reference for System.Numerics.Vectors, recursively...
Adding assembly reference for System.Runtime, recursively...
Adding assembly reference for System.Xml, recursively...
Adding assembly reference for System.Xml.Linq, recursively...
Adding assembly reference for Xamarin.Android.Arch.Core.Common, recursively...
Adding assembly reference for Xamarin.Android.Arch.Core.Runtime, recursively...
Adding assembly reference for Xamarin.Android.Arch.Lifecycle.Common, recursively...
Adding assembly reference for Xamarin.Android.Arch.Lifecycle.LiveData.Core, recursively...
Adding assembly reference for Xamarin.Android.Arch.Lifecycle.LiveData, recursively...
Adding assembly reference for Xamarin.Android.Arch.Lifecycle.Runtime, recursively...
Adding assembly reference for Xamarin.Android.Arch.Lifecycle.ViewModel, recursively...
Adding assembly reference for Xamarin.Android.Support.Animated.Vector.Drawable, recursively...
Adding assembly reference for Xamarin.Android.Support.Annotations, recursively...
Adding assembly reference for Xamarin.Android.Support.AsyncLayoutInflater, recursively...
Adding assembly reference for Xamarin.Android.Support.Collections, recursively...
Adding assembly reference for Xamarin.Android.Support.Compat, recursively...
Adding assembly reference for Xamarin.Android.Support.CoordinaterLayout, recursively...
Adding assembly reference for Xamarin.Android.Support.Core.UI, recursively...
Adding assembly reference for Xamarin.Android.Support.Core.Utils, recursively...
Adding assembly reference for Xamarin.Android.Support.CursorAdapter, recursively...
Adding assembly reference for Xamarin.Android.Support.CustomTabs, recursively...
Adding assembly reference for Xamarin.Android.Support.CustomView, recursively...
Adding assembly reference for Xamarin.Android.Support.Design, recursively...
Adding assembly reference for Xamarin.Android.Support.DocumentFile, recursively...
Adding assembly reference for Xamarin.Android.Support.DrawerLayout, recursively...
Adding assembly reference for Xamarin.Android.Support.Fragment, recursively...
Adding assembly reference for Xamarin.Android.Support.Interpolator, recursively...
Adding assembly reference for Xamarin.Android.Support.Loader, recursively...
Adding assembly reference for Xamarin.Android.Support.LocalBroadcastManager, recursively...
Adding assembly reference for Xamarin.Android.Support.Media.Compat, recursively...
Adding assembly reference for Xamarin.Android.Support.Print, recursively...
Adding assembly reference for Xamarin.Android.Support.SlidingPaneLayout, recursively...
Adding assembly reference for Xamarin.Android.Support.SwipeRefreshLayout, recursively...
Adding assembly reference for Xamarin.Android.Support.Transition, recursively...
Adding assembly reference for Xamarin.Android.Support.v4, recursively...
Adding assembly reference for Xamarin.Android.Support.v7.AppCompat, recursively...
Adding assembly reference for Xamarin.Android.Support.v7.CardView, recursively...
Adding assembly reference for Xamarin.Android.Support.v7.RecyclerView, recursively...
Adding assembly reference for Xamarin.Android.Support.Vector.Drawable, recursively...
Adding assembly reference for Xamarin.Android.Support.VersionedParcelable, recursively...
Adding assembly reference for Xamarin.Android.Support.ViewPager, recursively...
Adding assembly reference for Xamarin.Essentials, recursively...
Adding assembly reference for Xamarin.Forms.Core, recursively...
Adding assembly reference for Xamarin.Forms.Platform.Android, recursively...
Adding assembly reference for Xamarin.Forms.Platform, recursively...
Adding assembly reference for Xamarin.Forms.Xaml, recursively...
No way to resolve conflict between "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e". Choosing "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" arbitrarily.
Skipping target "_CopyConfigFiles" because it has no inputs.
Skipping target "_ConvertPdbFiles" because it has no outputs.
Skipping target "_LinkAssembliesNoShrink" because all output files are up-to-date with respect to the input files.
Skipping target "_CopyConfigFiles" because it has no inputs.
Skipping target "_ConvertPdbFiles" because it has no outputs.
Skipping target "_GenerateJavaStubs" because all output files are up-to-date with respect to the input files.
Skipping target "_ConvertCustomView" because all output files are up-to-date with respect to the input files.
Skipping target "_AddStaticResources" because all output files are up-to-date with respect to the input files.
Skipping target "_GeneratePackageManagerJava" because all output files are up-to-date with respect to the input files.
Skipping target "_GenerateAndroidAssetsDir" because it has no outputs.
Skipping target "_PrepareCreateBaseApk" because all output files are up-to-date with respect to the input files.
Skipping target "_CreateBaseApk" because all output files are up-to-date with respect to the input files.
Skipping target "_CompileJava" because all output files are up-to-date with respect to the input files.
Skipping target "_CompileNativeAssemblySources" because all output files are up-to-date with respect to the input files.
Skipping target "_CreateApplicationSharedLibraries" because all output files are up-to-date with respect to the input files.
Skipping target "_CompileToDalvikWithD8" because all output files are up-to-date with respect to the input files.
Deleting file "bin\Debug\com.companyname.notes.apk".
Copying file from "C:\Users\ryan1\Documents\Visual Studio 2019\Learning\Notes\Notes.Android\obj\Debug\90\android\bin\com.companyname.notes.apk" to "C:\Users\ryan1\Documents\Visual Studio 2019\Learning\Notes\Notes.Android\bin\Debug\com.companyname.notes.apk".
Touching "obj\Debug\90\android_debug_keystore.flag".
C:\Program Files\Android\Jdk\microsoft_dist_openjdk_1.8.0.25\bin\keytool.exe -list -alias androiddebugkey -storepass android -keypass android -keystore "C:\Users\ryan1\AppData\Local\Xamarin\Mono for Android\debug.keystore"
Deleting file "C:\Users\ryan1\Documents\Visual Studio 2019\Learning\Notes\Notes.Android\bin\Debug\com.companyname.notes-Signed.apk".
C:\Program Files (x86)\Android\android-sdk\build-tools\28.0.3\zipalign.exe -p 4 "C:\Users\ryan1\Documents\Visual Studio 2019\Learning\Notes\Notes.Android\obj\Debug\90\android\bin\com.companyname.notes.apk" "bin\Debug\com.companyname.notes-Signed.apk"
C:\Program Files\Android\Jdk\microsoft_dist_openjdk_1.8.0.25\bin\java.exe -jar "C:\Program Files (x86)\Android\android-sdk\build-tools\28.0.3\lib\apksigner.jar" sign --ks "C:\Users\ryan1\AppData\Local\Xamarin\Mono for Android\debug.keystore" --ks-pass pass:android --ks-key-alias androiddebugkey --key-pass pass:android --min-sdk-version 21 --max-sdk-version 28 "C:\Users\ryan1\Documents\Visual Studio 2019\Learning\Notes\Notes.Android\bin\Debug\com.companyname.notes-Signed.apk"
Signed android package 'bin\Debug\com.companyname.notes-Signed.apk'
Deleting file "obj\Debug\90\upload.flag".
Removing previous version of application...
Copying application to device...
20% ... 1728kb of 8599kb copied
30% ... 2624kb of 8599kb copied
40% ... 3456kb of 8599kb copied
60% ... 5184kb of 8599kb copied
70% ... 6080kb of 8599kb copied
80% ... 6912kb of 8599kb copied
90% ... 7744kb of 8599kb copied
100% ... 8599kb of 8599kb copied
Getting installation path...
Using cached value for installation path: /storage/emulated/0/Android/data/com.companyname.notes/files/.override
Using cached value for package remote path: /data/app/com.companyname.notes-4-_nVbTm81xn0i6PrOl_nw==/base.apk

Using fast dev path: /storage/emulated/0/Android/data/com.companyname.notes/files/.__override__
Synchronizing assemblies...
0% ... 64kb of 12394kb copied
10% ... 1302kb of 12394kb copied
20% ... 2518kb of 12394kb copied
30% ... 3719kb of 12394kb copied
40% ... 4997kb of 12394kb copied
50% ... 6226kb of 12394kb copied
60% ... 7468kb of 12394kb copied
70% ... 8684kb of 12394kb copied
80% ... 9935kb of 12394kb copied
90% ... 11210kb of 12394kb copied
100% ... 12394kb of 12394kb copied
Skipping native libs, not configured...
Skipping dexes, not configured...
Skipping resources, not configured...
Skipping typemaps, not configured...
Creating "obj\Debug\90\upload.flag" because "AlwaysCreate" was specified.
Done building project "Notes.Android.csproj".
Build succeeded.
2>Deployment was successful to pixel_2_pie_9_0_-_api_28.
========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========

Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>