deploying error

1>------ Deploy started: Project: TipCalculator, Configuration: Debug Any CPU ------
1>Error: Cancelled
========== Build: 0 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========

on visual studio 2017

Posts

  • kentuckerkentucker USMember ✭✭✭✭✭

    What are you deploying to?

  • nbinbi Member ✭✭

    Same problem here. Regarding your question - I don't know. In fact I don't even understand why 'deploy' is shown in the right-click menu for an android app. The apk is generated via 'archive'. So what is the intent/purpose behind 'deploy' for an android project? Is it a necessary step prior to generating the apk? If so, then why not automate it? If not, then why is it shown? We know what the pieces are, we know what the end result needs to be, so why can't the entire process of apk generation be automated?

  • JamesLaveryJamesLavery GBBeta, University ✭✭✭✭✭

    @nbi - Deploy is for building the apk, signing it so it can be debugged, and deploying it to a physical device or emulator. This is separate from creating an archive/apk for distribution.

  • nbinbi Member ✭✭

    I actually did RTFM for deploy, but it didn't mention android. So if I understand your comment correctly in the case of android the target of deploy is implicit (emulator) as opposed to non-android projects for which 'publish' specifies the deploy destination. And since it signs the apk it is a necessary step. Thanks for the clarification. I actually got it to work on the emulator although it's awfully slow. Can I assume that since it works on the emulator the same apk is suitable for installation on my android phone? I ask because prior phone installation attempts with an apk generated by 'archive' failed due to a parsing error. Is that because it wasn't signed? I have yet to try installing the properly deployed apk.

  • JamesLaveryJamesLavery GBBeta, University ✭✭✭✭✭

    The android emulators are indeed painfully slow.

    If you have a phone connected via USB, and developer options and debugging enabled on the phone, then you should see the phone available as a deploy destination - and should just be able to run the app on the phone. This will:

    • Build the app
    • Sign it
    • Deploy it to the phone
    • Run it
  • nbinbi Member ✭✭
    edited January 31

    The parse error was indeed due to the apk not being signed. The signed apk installed just fine on my phone. But it won't run there ("Unfortunately App1.Android has stopped"). Sigh. Why does it run on the emulator but not on the phone?

    The bug report seems to suggest an answer that doesn't make any sense:

    01-31 10:07:56.664 32388 32388 E AndroidRuntime: Process: com.companyname.App1.Android, PID: 32388
    01-31 10:07:56.664 32388 32388 E AndroidRuntime: java.lang.RuntimeException: Unable to get provider mono.MonoRuntimeProvider: java.lang.RuntimeException: Unable to find application Mono.Android.Platform.ApiLevel_27 or Xamarin.Android.Platform!

    What??? Is VS 2017 not honoring the minimum target framework (which is set to v6.0)?

  • nbinbi Member ✭✭

    This problem went away after doing a VS 2017 "repair" installation and replacing Nuget packages one-by-one for each project in the solution. So the minimum target framework is honored after all. All this still begs the question why this couldn't work right on the first pass. I wrestled with this for 3 days just to get an app on my phone display "Welcome to Xamarin.Forms!". It shouldn't be this difficult.

    Now if I can only get a faster emulator hooked up with VS 2017.

Sign In or Register to comment.