Closed MichalSznajder closed 5 years ago
@michalsznajder looks like a permissions issue
TASK: GetPackages cat /data/system/packages.xml completed?:cat: /data/system/packages.xml: Permission denied
(TaskId:597)
DEBUG RunShellCommand LCL0218730001137 cat /dbdata/system/packages.xml (TaskId:597)
TASK: GetPackages cat /dbdata/system/packages.xml completed?:cat: /dbdata/system/packages.xml: No such file or directory
(TaskId:597)
do either of those files exist on the device?
@dellis1972 it's not a permissions problem. AFAIK, none of the stock Android devices have this file user-readable.
I have the same issue, I think the problem is that the "am broadcast" command is considering that Mono runtime packages are not installed. The mechanism to detect if the runtime packages are installed is failing.
Device: OnePlus, stock Android 9.0. Not ocurring on simulators. Visual Studio Enterprise 16.3.2 Xamarin 16.3.0.274 Xamarin Android SDK 10.0.0.43
I'm attaching here the text and binary log
msbuild ImageTestXamarin.Android.csproj /t:SignAndroidPackage;Install /bl /v:diag > output.txt
XamForms-3091-text-and-binary-log.zip
Each time you debug and deploy the app to a device, it keeps constantly reinstalling Mono Runtime and API 28 plaform runtime
EDIT: Added a video, showing that behavior (phone plugged, and every time I deploy, it reinstall the shared runtime), The video shows Visual Studio info, and adb shell command output. https://www.youtube.com/watch?v=Fb7wLoMHV-c
Command:
adb shell am broadcast -a "mono.android.intent.action.PACKAGE_VERSIONS" -e "packages" "Mono.Android.DebugRuntime,Mono.Android.Platform.ApiLevel_28,com.companyname.imagetestxamarin" -n "Mono.Android.DebugRuntime/com.xamarin.mono.android.PackageVersions"
Output:
Broadcasting: Intent { act=mono.android.intent.action.PACKAGE_VERSIONS cmp=Mono.Android.DebugRuntime/com.xamarin.mono.android.PackageVersions (has extras) } , data="Mono.Android.DebugRuntime=1565368993,Mono.Android.Platform.ApiLevel_28=1570442517,com.companyname.imagetestxamarin=1"
Binary log video: https://www.youtube.com/watch?v=BCNkgAvS-nM
@pulimento thanks for the data. I'll ask our team to see if we have a OnePlus with stock 9.0 on it, hopefully we can repo.
@dellis1972 just updated my original comment. I've recorded a screen record with the phone plugged in. Just checked on android simulators and works as expected, so it's a device only issue.
@pulimento cool. Thanks for the info. Looking at the logs it does seem to have trouble uninstalling the previous version of the Shared Runtime. Do you still get the issue if you manually uninstall the version that is on the phone?
@dellis1972 problem happens because is trying to uninstall it twice (really, the runtime, already installed, is installed again, and, at the end, it gets installed again)
Please see this video, walking the binary log of my original comment: https://www.youtube.com/watch?v=BCNkgAvS-nM
@pulimento I understand what the issue is. I was just wondering what happened if you manually uninstall the Shared Runtime? It could be its just a bad install or the package is in a state that adb cannot uninstall it (that does happen from time to time)
@dellis1972 I can uninstall it just fine:
Hmm, ok thanks for testing.
@pulimento hi, it looks like we have managed to reproduce the issue on a OnePlus device. Our team is now investigating.
Oh nice! Please let me know if I can help. Thanks
El mar., 8 oct. 2019 18:40, Dean Ellis notifications@github.com escribió:
@pulimento https://github.com/pulimento hi, it looks like we have managed to reproduce the issue on a OnePlus device. Our team is now investigating.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/xamarin/xamarin-android/issues/3091?email_source=notifications&email_token=AAD24ENBSRBVKKHRBULAFJDQNSZXHA5CNFSM4HMNFZB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAU2FXQ#issuecomment-539599582, or mute the thread https://github.com/notifications/unsubscribe-auth/AAD24EIL7QNZUQKX6BLPHM3QNSZXHANCNFSM4HMNFZBQ .
Sorry @dellis1972 why are you closing this? Any news?
@pulimento GitHub auto closes issues when are PR which fixes that issue is merged. My colleague @pjcollins found the issue and has submitted a fix. We will work to get this into the next available preview as soon as well can.
It turns out that not all android devices respond to a broadcast in the same manner. We were expecting something like "Broadcast completed: result=0" but were getting results like "data=\"\" completed: result=0" one certain devices. So we needed to update our code to handle these different results.
fantastic! so it will ship with the next VS preview release?
We missed the code checkin deadline for d16-4 Preview 2 :(, but we will make sure this gets into Preview 3.
I just noticed that you are working on it.
In my case I solved this by disabling aggressive power management available on my phone (Huawei P20 Pro). On my phone those broadcasts seen in my log returned nothing. Once I allowed background work on Xamarin packages in settings it was all OK. I think it was "Mono Shared Runtime" that was involved.
Release status update
A new Preview version has now been published that includes the candidate improvement for this item for the cases where devices return different text in the broadcast reply than was previously expected. This improvement will not yet help for situations where the device is set to prevent background work by the Mono Shared Runtime package.
The fix is not yet included in a Release version. I will update this item again when a Release version is available that includes the fix.
Fix included in Xamarin.Android 10.1.0.29.
Fix included on Windows in Visual Studio 2019 version 16.4 Preview 3. To try the Preview version that includes the fix, check for the latest updates in Visual Studio Preview.
Fix included on macOS in Visual Studio 2019 for Mac version 8.4 Preview 2. To try the Preview version that includes the fix, check for the latest updates on the Preview updater channel.
Release status update
A new Release version has now been published on Windows that includes the fix for this item. The fix is not yet published in a Release version on macOS. I will update this item again when a Release version is available on macOS that includes the fix.
Fix included in Xamarin.Android 10.1.0.30.
Fix included on Windows in Visual Studio 2019 version 16.4. To get the new version that includes the fix, check for the latest updates or install the latest version from https://visualstudio.microsoft.com/downloads/.
(Fix also included on macOS in Visual Studio 2019 for Mac version 8.4 Preview 2.1 and higher. To try the Preview version that includes the fix, check for the latest updates on the Preview updater channel.)
I have VS 16.4.1 on Windows with Xamarin.Android SDK 10.1.1.0 (d16-4/f2c9364) Xamarin.Android Reference Assemblies and MSBuild support. Mono: bef1e63 Java.Interop: xamarin/java.interop/d16-4@c4e569f ProGuard: xamarin/proguard/master@905836d SQLite: xamarin/sqlite/3.28.0@46204c4 Xamarin.Android Tools: xamarin/xamarin-android-tools/master@9f4ed4b
It still does the same every time I deploy.
I can't debug/deploy one app!
The same everytime, hangs hangs and hangs...
PLEASE Fix
@andycted, @angusbreno, thanks for the new information! When you get a chance, if you could submit new issues with the descriptions of what you're seeing so the team can take a look, that would be perfect.
What I’m seeing is exactly the same issue described in this thread. So why should I open a new one ? I can only tell you that your fix didn’t work at all.
@andycted, I'd recommend a new issue mostly just to help ensure your symptom gets the proper visibility with the team for further investigation, and to make sure it's clearly distinguished from the first fix that was added around shared runtime redeployments on this issue (for OnePlus devices).
If you like, I can open a new issue for you and copy and paste over your comment as a starting place. In that case, as a first little question, I'd be curious to know if you see the same behavior as michalsznajder mentioned.
That is, are you seeing the problem on a device where aggressive power management options are available and enabled? Thanks in advance!
michalsznajder commented on Oct 10 https://github.com/xamarin/xamarin-android/issues/3091#issuecomment-540913097
In my case I solved this by disabling aggressive power management available on my phone (Huawei P20 Pro). On my phone those broadcasts seen in my log returned nothing. Once I allowed background work on Xamarin packages in settings it was all OK.
I have VS 16.4.1 on Windows with Xamarin.Android SDK 10.1.1.0 (d16-4/f2c9364) Xamarin.Android Reference Assemblies and MSBuild support. Mono: bef1e63 Java.Interop: xamarin/java.interop@c4e569f ProGuard: xamarin/proguard@905836d SQLite: xamarin/sqlite@46204c4 Xamarin.Android Tools: xamarin/xamarin-android-tools@9f4ed4b
It still does the same every time I deploy.
Same thing here, there is no related power options, cause i'm running on my galaxy s9+ with full processor power...
It hangs, on deploy. Simple as that.
I will open a new issue tomorrow with diagnostics, but please take a look, too many people with the same problem. In the previus VS version didnt happen this.
I'm responsible for +20 apps and i can't run debug anymore, it's despair.
@brendanzagaeski please do open a new issue.
I don't have power management issues or configurations. I do have the problem mentioned in the title. It sometimes hangs on deploy, but mostly, it takes forever to deploy the shared runtime each time.
The os version is on 4.4, it's a huawei y635-l21 I can give you more info if needed.
Release status update
A new Release version has now been published on macOS that includes the fix for this item.
Fix included in Xamarin.Android 10.1.1.0.
Fix included on macOS in Visual Studio 2019 for Mac version 8.4. To get the new version that includes the fix, check for the latest updates on the Stable updater channel.
(Fix also included on Windows in Visual Studio 2019 version 16.4 and higher. To get the new version that includes the fix, check for the latest updates or install the latest version from https://visualstudio.microsoft.com/downloads/.)
When I run my application in Debug shared runtime is constantly deployed to my target device. Application is actually Xamarin.Forms but I think it does not matter here.
I did run msbuild in verbose mode and below is interesting part. It look like build process is not able to veryfiy that shared runtime is installed and redeploys shared runtime every time.
I use Huavei P20 Pro with Oreo on board. Other software versions below.