Skip to content

When using FastDeployment get error message XA0136: The 'run-as' command failed with 'run-as: Package 'packagename' has corrupt installation #7821

Description

@jlinker7

Android application type

Classic Xamarin.Android (MonoAndroid12.0, etc.)

Affected platform version

Windows VS 2020 Latest release (including Beta version), Android 7.1.1 Custom Device

Description

While trying the work around for issue #7521 (comment), which involves using Fast Deployment, I encounter the error

XA0136: The 'run-as' command failed with 'run-as: Package 'packagename' has corrupt installation'.
The currently installation of the package in corrupt. Please manually uninstall the
package from all the users on device and try again. If that does not work you can disable Fast Deployment.
Fast Deployment can be disabled in the Visual Studio project property pages or edit the project file in a text editor and set the 'EmbedAssembliesIntoApk' MSBuild property to 'true'.

msbuild.zip

Steps to Reproduce

  1. Xamarin.Android project running on custom device, Android 7.1.1, armv7 chip
  2. Visual Studio 2022 17.5.0 Preview 6.0 (but also experienced in on previous versions)
  3. Currently there is a bug that is preventing from running with debugger (mscorblib cannot load) that has a fix that isn't released yet, the work around is to use Fast Deployment
  4. Run with debug and Fast Deployment enabled
  5. Observe error about run-as command failed due to corrupt installation
  6. Without Fast Deployment, the app will start then crash due to the mscorlib error, but then you can relaunch the app without debugger and it runs fine
  7. With fast deployment, even after the initial attempt at it running, trying to run it again will result in an immediate crash

Did you find any workaround?

No

Relevant log output

XA0136: The 'run-as'command failed with 'run-as: Package 'packagename' has corrupt installation'.
The currently installation of the package in corrupt. Please manually uninstall the package from all the users on device and try again. If that does not work you can disable Fast Deployment.
Fast Deployment can be disabled in the Visual Studio project property pages or edit the project file in a text editor and set the 'EmbedAssembliesIntoApk' MSBuild property to 'true'.
Also attached msbuild.binlog.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Area: App+Library BuildIssues when building Library projects or Application projects.possibly-staleIssues that are potentially no longer relevant.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions