-
Notifications
You must be signed in to change notification settings - Fork 528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When using FastDeployment get error message XA0136: The 'run-as' command failed with 'run-as: Package 'packagename' has corrupt installation #7821
Comments
Hi @jlinker7. We have added the "need-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
Thanks for opening the issue and the binlog.
|
My apologies, I thought I had it enabled before that run, but may have switched branches without realizing it. Let me know if this includes the information needed. I included both the binlog file and the output to the command prompt window when running the msbuild command. Thanks! |
can you try running the following command from the "Adb Command Prompt"
Note we are not using the |
@dellis1972 I ran that command to uninstall it, then tried again with Fast Deployment and still get the same error. To be honest, I cannot remember for sure if it ever worked, I don't think it has, but I have been working on this project for a few years now, and running it without Fast Deployment was working (until I switched to VS 2022) so that is what I have used, I think when I have tried Fast Deployment in "recent" memory it hasn't worked, but I cannot say for certain if it did or di not in the early days of the project. |
@dellis1972 For testing, I just created a brand new Xamarin.Android test app in visual studio 2022, with both the minimum and target android version set as 7.1, but the compile version set to Android 13.0 (same set up as the app I am working on), and get the same error. |
It might be that this means something about Unless there is a way to create an emulator image of that custom OS that you are using? All that said, I might be able to detect this error message and do something else. The problem is |
@dellis1972 Is the presumed issue to be file access? Or possibly missing directories? What folder structure is run-as needing access to? I can look and see if I can add directories as needed, or elevate permissions on directories if you think that would help? |
Logcat.txt |
I don't know enough about the internals of the Android OS to know what run-as it looking for or how it decides if something is corrupt. What we need to do I guess is somehow track down the code that your OS is using and take a look. |
Hi @jlinker7. We have added the "need-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
Do you have any details on the custom OS you are using? It would be nice to maybe try to create a VM or something which repo's the issue |
@dellis1972 Sadly, very little information. Its based of Stock Android 7.1 as far as I know. It does not include Google Play Services. They added a custom back button to the WiFi settings screen to return it to our app. They did the same for Ethernet Settings. They added a few intents we can push to enable or disable the navigation bar and a custom intent to trigger a reboot. They have never shared the repository with us though. I tried to look through the Android Source code to figure out what run-as relies on so I could check the device to see if something was missing, but the code base is so massive I was not able to find anything quickly. |
Looking back though the old source code we find this /* check that the data directory path is valid */
if (check_data_path(info.dataDir, userAppId) < 0) {
panic("Package '%s' has corrupt installation\n", pkgname);
} Which leads us to https://github.com/aosp-mirror/platform_system_core/blob/nougat-mr1-release/run-as/package.c#L217. Which suggests there is something wrong with the data directory |
@dellis1972 Thank you for pointing me in the direction of that code, next chance I have I will look through it and see if I can verify each of those checks on the device. A cursory glance looks like permissions/ownership issues, or the directory is a simlink instead of real. Does this mean that deploying without Fast Deploy does not do the same check, as it seems deploying with or without Fast Deploy shouldn't affect the directory permissions or structure. When I get a chance to look more closely I will comment back here with my findings. |
Normal installaton does not use run-as. For fast deployment we have to use A normal install the assemblies are packaged in the apk so it never hits this "path". But it does reduce development times since the apk has to be built and installed each time. With Fast dev we can just send the changed dll`s over and not touch the apk. |
@dellis1972 Ok, so since it doesn't use this directory when Fast Deployment is off, then it wouldn't run this check. Looking through the code I am leaning towards it being a permissions/ownership type issue. But have not quite figured out how to verify that. |
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
Did you find any workaround?
No
Relevant log output
The text was updated successfully, but these errors were encountered: