-
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
Services with isolated processes and custom Application class fail to resolve overloads properly #1950
Comments
Is there any update on this? The bug is still present |
Bumped into this issue as well and can confirm the bug is still present. Any estimated fix? |
Any updates? |
The crash is also observed on a Service run in a separate process, which is not an isolated process.
This service does not have the |
@jonathanpeppers , can you please have a look into this, for us it is a blocker in production release. |
Jonathan Pryor describes what the problem here is:
Xamarin.Android bootstraps Mono by using an Android content provider: Content providers are called by Android before the first From this content provider written in Java, we can then call into native C/C++ to start Mono, then start managed C# code. This is fundamental to how Xamarin.Android currently works. It appears that content providers are not called by Android for out of process services. Right now, the problem is we don't know how to fix this. We need a Java callback before the out of process service starts, so if anyone has some ideas, we would like to know, thanks! |
Just a shot in the dark - The Magisk root managment tool uses ptrace and inotify events to listen for process forks. Can a similar method be used to detect the new process? Magisk runs its process monitor with root privileges to detect all child processes of zygote and unmount some partitions for some processes. But I think root privileges are not required for a process to detect its own child processes. I see one problem with this approach, even though the parent process can detect a child process, I am not sure if we can execute code in the child process to hook a Java callback. |
Can the bootstrapping be done in Application.onCreate() instead of in ContentProvider.attachinfo()? Or in the Xamarin Application onCreate() code that the Application.onCreate() extends from. Why can't it be done in the Application class lifecycle itself? I don't understand the bootstrapping mechanism, so I am not sure how big of a change this is. |
I think it’s because Mono bootstrap has to complete before ANY C# code can be run, that includes any But you’re also making a good point that maybe hacking I’m also not an expert on Android runtime so just saying. |
I think we need a callback inside the new process. I think this would be listening for new processes starting?
Do we know if the If so, it might be possible to create a Java You could add a I will put this on my list to try and see if I can get it to work. |
Basically if we have a Custom Application class + a service with IsolatedProcess = true, it crashes.
See more details about it on:
This issue was reported on 2017-01-29, confirmed by Xamarin Team, but no fix so far.
The text was updated successfully, but these errors were encountered: