Bug 21402 - Losing Android Runtime after device provision
Summary: Losing Android Runtime after device provision
Alias: None
Product: Android
Classification: Xamarin
Component: Mono runtime / AOT Compiler ()
Version: 4.14.0
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Jonathan Pryor
Depends on:
Reported: 2014-07-17 15:23 UTC by Ben O'Halloran
Modified: 2017-06-29 15:44 UTC (History)
4 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Ben O'Halloran 2014-07-17 15:23:11 UTC
Porting the Android-L sample "BasicManagedProfile", the Android Runtime is lost partway through the app.
On device launch, the app runs correctly and eventually goes into Android-Defined activities to be provisioned for enterprise/personal account space. Once the Android activities have finished, a BroadcastReciever is meant to be called and instead the app crashes (see gist).
Talking to Jeremie, he seems to think that it might be caused by switching into the provisioned space so the runtime will not be present. However, the app also crashes in the same spot when in release mode.
Project Github: https://github.com/xamarin/monodroid-samples/tree/android-l/BasicManagedProfile
Debug, Release, Build, Install logs: https://gist.github.com/benohalloran/6a70d09a2418dc177c24
Sort-Form Debug & Release Gists: https://gist.github.com/benohalloran/6bab043dd7ba9913373e
Xamarin Studio
Version 5.3 (build 5)
Installation UUID: 073a0933-f9c4-4d05-9f30-7e63101ada6e
	Mono 3.6.0 ((no/5ff701f)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 306000037

Apple Developer Tools
Xcode 5.0.1 (3335.23)
Build 5A2053

Xamarin.Android Version: 4.15.0 (Trial Edition)

Operating System
Mac OS X 10.9.3
Darwin peter-imac.local 13.2.0 Darwin Kernel Version 13.2.0
    Thu Apr 17 23:03:13 PDT 2014
    root:xnu-2422.100.13~1/RELEASE_X86_64 x86_64
Comment 1 Jérémie Laval 2014-07-17 15:36:23 UTC
From the log we can see that libmonosgen is trying to be loaded from a user-specific /data entry:


If the directory was provisioned by the system by manually copying the APK content it could have skipped that content. It would also explain the same failure in debug mode because the runtime APK wouldn't be copied since the system has no knowledge it's a dependency.
Comment 2 Jonathan Pryor 2014-07-17 20:40:59 UTC
As per Comment #1, it sounds like this is basically a dupe of Bug #8470.
Comment 3 Ben O'Halloran 2014-07-23 11:03:42 UTC
This project has been moved from the original git repo to https://github.com/xamarin/private-samples/tree/master/android-l/BasicManagedProfile
Comment 4 Jon Douglas [MSFT] 2017-06-29 15:44:05 UTC
As per the most recent reproduction in https://bugzilla.xamarin.com/show_bug.cgi?id=21402#c3 I am unable to reproduce this issue. If this issue still happens and was not fixed as per the dupe of https://bugzilla.xamarin.com/show_bug.cgi?id=8470 please feel free to reopen this bug.