Bug 51940 - Services with isolated processes and custom Application class fail to resolve overloads properly
Summary: Services with isolated processes and custom Application class fail to resolve...
Status: CONFIRMED
Alias: None
Product: Android
Classification: Xamarin
Component: General (show other bugs)
Version: unspecified
Hardware: All Mac OS
: Highest critical
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
: 54420 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-01-29 20:04 UTC by Alexandre Rocha Lima e Marcondes
Modified: 2017-10-10 03:25 UTC (History)
11 users (show)

See Also:
Tags: xamexttriage,bb,xamextfollowed
Is this bug a regression?: ---
Last known good build:


Attachments

Description Alexandre Rocha Lima e Marcondes 2017-01-29 20:04:46 UTC
When I develop an Android Service and mark it as an isolated process on the ServiceAttribute, and if at the same time I have a custom Android.App.Application class on the project, it fails to start the Service process and crashes stating it cannot resolve overloads from Java.
 
[Service(Name = "br.com.alexandremarcondes.ContactSample.AuthenticationService",
             IsolatedProcess = true,
             Process = ":auth",
             Exported = true)]


Here is a sample of this https://github.com/arlm/SampleContacts

This project is a very simple Android Accounts service with Contacts synchronization. It comes from an Android sample and it works perfectly on commit 5e9f93d78e1ac82eef2348d4adce3f6e25a0df13 (https://github.com/arlm/SampleContacts/commit/5e9f93d78e1ac82eef2348d4adce3f6e25a0df13) (the sample project with added custom Android.App.Application class). You can see that when running on a device (or emulator) and then going to Settings->Accounts->Add and adding an account of this type.

On commit c8004f78331e853f1f7b007749cbf81855f2935a (https://github.com/arlm/SampleContacts/commit/c8004f78331e853f1f7b007749cbf81855f2935a) I introduced the above settings on the services to enable isolated processes and then, after that the app crashes when trying to add the account. This is the stacktrace form the logcat:

01-29 20:53:31.995  2345  3041 I ActivityManager: START u0 {act=android.settings.ADD_ACCOUNT_SETTINGS cmp=com.android.settings/.accounts.AddAccountSettings (has extras)} from uid 1000 on display 0
01-29 20:53:32.070  2345  3005 I ActivityManager: START u0 {cmp=com.android.settings/.accounts.ChooseAccountActivity (has extras)} from uid 1000 on display 0
01-29 20:53:32.550  2345  2377 I ActivityManager: Displayed com.android.settings/.accounts.ChooseAccountActivity: +451ms (total +515ms)
01-29 20:53:34.450  2345  4841 I ActivityManager: Start proc 10186:br.com.alexandremarcondes.contactsample:auth/u0i2 for service br.com.alexandremarcondes.contactsample/br.com.alexandremarcondes.ContactSample.AuthenticationService
01-29 20:53:34.470 10186 10186 I art     : Late-enabling -Xcheck:jni
01-29 20:53:34.650 10186 10186 E art     : No implementation found for void br.com.alexandremarcondes.MainApplication.n_onCreate() (tried Java_br_com_alexandremarcondes_MainApplication_n_1onCreate and Java_br_com_alexandremarcondes_MainApplication_n_1onCreate__)
01-29 20:53:34.650 10186 10186 D AndroidRuntime: Shutting down VM
01-29 20:53:34.650 10186 10186 E AndroidRuntime: FATAL EXCEPTION: main
01-29 20:53:34.650 10186 10186 E AndroidRuntime: Process: br.com.alexandremarcondes.contactsample:auth, PID: 10186
01-29 20:53:34.650 10186 10186 E AndroidRuntime: Theme: themes:{}
01-29 20:53:34.650 10186 10186 E AndroidRuntime: java.lang.UnsatisfiedLinkError: No implementation found for void br.com.alexandremarcondes.MainApplication.n_onCreate() (tried Java_br_com_alexandremarcondes_MainApplication_n_1onCreate and Java_br_com_alexandremarcondes_MainApplication_n_1onCreate__)
01-29 20:53:34.650 10186 10186 E AndroidRuntime: 	at br.com.alexandremarcondes.MainApplication.n_onCreate(Native Method)
01-29 20:53:34.650 10186 10186 E AndroidRuntime: 	at br.com.alexandremarcondes.MainApplication.onCreate(MainApplication.java:34)
01-29 20:53:34.650 10186 10186 E AndroidRuntime: 	at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1014)
01-29 20:53:34.650 10186 10186 E AndroidRuntime: 	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4751)
01-29 20:53:34.650 10186 10186 E AndroidRuntime: 	at android.app.ActivityThread.-wrap1(ActivityThread.java)
01-29 20:53:34.650 10186 10186 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1424)
01-29 20:53:34.650 10186 10186 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:102)
01-29 20:53:34.650 10186 10186 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:148)
01-29 20:53:34.650 10186 10186 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:5461)
01-29 20:53:34.650 10186 10186 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
01-29 20:53:34.650 10186 10186 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
01-29 20:53:34.650 10186 10186 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
01-29 20:53:37.100 10186 10186 I Process : Sending signal. PID: 10186 SIG: 9

01-29 20:53:37.130  2345  4841 I ActivityManager: Process br.com.alexandremarcondes.contactsample:auth (pid 10186) has died
01-29 20:53:37.130  2345  4841 W ActivityManager: Scheduling restart of crashed service br.com.alexandremarcondes.contactsample/br.com.alexandremarcondes.ContactSample.AuthenticationService in 1000ms
01-29 20:53:38.200  2345  2362 I ActivityManager: Start proc 10205:br.com.alexandremarcondes.contactsample:auth/u0i3 for service br.com.alexandremarcondes.contactsample/br.com.alexandremarcondes.ContactSample.AuthenticationService
01-29 20:53:38.235 10205 10205 I art     : Late-enabling -Xcheck:jni
01-29 20:53:38.415 10205 10205 E art     : No implementation found for void br.com.alexandremarcondes.MainApplication.n_onCreate() (tried Java_br_com_alexandremarcondes_MainApplication_n_1onCreate and Java_br_com_alexandremarcondes_MainApplication_n_1onCreate__)
01-29 20:53:38.415 10205 10205 D AndroidRuntime: Shutting down VM
01-29 20:53:38.425 10205 10205 E AndroidRuntime: FATAL EXCEPTION: main
01-29 20:53:38.425 10205 10205 E AndroidRuntime: Process: br.com.alexandremarcondes.contactsample:auth, PID: 10205
01-29 20:53:38.425 10205 10205 E AndroidRuntime: Theme: themes:{}
01-29 20:53:38.425 10205 10205 E AndroidRuntime: java.lang.UnsatisfiedLinkError: No implementation found for void br.com.alexandremarcondes.MainApplication.n_onCreate() (tried Java_br_com_alexandremarcondes_MainApplication_n_1onCreate and Java_br_com_alexandremarcondes_MainApplication_n_1onCreate__)
01-29 20:53:38.425 10205 10205 E AndroidRuntime: 	at br.com.alexandremarcondes.MainApplication.n_onCreate(Native Method)
01-29 20:53:38.425 10205 10205 E AndroidRuntime: 	at br.com.alexandremarcondes.MainApplication.onCreate(MainApplication.java:34)
01-29 20:53:38.425 10205 10205 E AndroidRuntime: 	at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1014)
01-29 20:53:38.425 10205 10205 E AndroidRuntime: 	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4751)
01-29 20:53:38.425 10205 10205 E AndroidRuntime: 	at android.app.ActivityThread.-wrap1(ActivityThread.java)
01-29 20:53:38.425 10205 10205 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1424)
01-29 20:53:38.425 10205 10205 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:102)
01-29 20:53:38.425 10205 10205 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:148)
01-29 20:53:38.425 10205 10205 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:5461)
01-29 20:53:38.425 10205 10205 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
01-29 20:53:38.425 10205 10205 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
01-29 20:53:38.425 10205 10205 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
01-29 20:53:38.495  2345  2487 E         : Device driver API match
01-29 20:53:38.495  2345  2487 E         : Device driver API version: 29
01-29 20:53:38.495  2345  2487 E         : User space API version: 29 
01-29 20:53:38.495  2345  2487 E         : mali: REVISION=Linux-r3p2-01rel3 BUILD_DATE=Tue Aug 26 17:05:16 KST 2014 
01-29 20:53:40.115 10205 10205 I Process : Sending signal. PID: 10205 SIG: 9
01-29 20:53:40.145  2345  2359 I ActivityManager: Process br.com.alexandremarcondes.contactsample:auth (pid 10205) has died
01-29 20:53:40.145  2345  2359 W ActivityManager: Service crashed 2 times, stopping: ServiceRecord{e37d4e2 u0 br.com.alexandremarcondes.contactsample/br.com.alexandremarcondes.ContactSample.AuthenticationService}


---

My environment is:

Xamarin Studio Community
Version 6.2 (build 1778)
Installation UUID: c678abb9-dfc2-4b76-b49a-84e9b4f2cc1f
Runtime:
	Mono 4.8.0 (mono-4.8.0-branch/6f90ed1) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 408000472

NuGet
Version: 3.5.0.0

Xamarin.Profiler
Version: 1.1.6
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

Apple Developer Tools
Xcode 8.2.1 (11766.1)
Build 8C1002

Xamarin.iOS
Version: 10.4.0.96 (Xamarin Studio Community)
Hash: 4e31137
Branch: cycle9
Build date: 2017-01-20 13:08:53-0500

Xamarin.Android
Version: 7.1.0.25 (Xamarin Studio Community)
Android SDK: /Volumes/data/Users/alexandremarcondes/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.3    (API level 10)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
		5.1    (API level 22)
		6.0    (API level 23)
		7.0    (API level 24)
		7.1    (API level 25)

SDK Tools Version: 25.2.5
SDK Platform Tools Version: 25.0.3
SDK Build Tools Version: 25.0.2

Java SDK: /Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

Xamarin Android Player
Not Installed

Xamarin.Mac
Version: 3.0.0.366 (Xamarin Studio Community)

Xamarin Inspector
Version: 1.0.0.0
Hash: 1f3067d
Branch: master
Build date: Tue, 15 Nov 2016 21:13:59 GMT

Build Information
Release ID: 602001778
Git revision: 615fe0299995fbf4023cf95980615013b1cf8d74
Build date: 2017-01-20 08:31:58-05
Xamarin addins: f53fb5ce32a48c49c329af8d1b75a3ea1b2c2ff1
Build lane: monodevelop-lion-cycle9

Operating System
Mac OS X 10.12.2
Darwin Alexandres-MacBook-Pro.local 16.3.0 Darwin Kernel Version 16.3.0
    Thu Nov 17 20:23:58 PST 2016
    root:xnu-3789.31.2~1/RELEASE_X86_64 x86_64

Enabled user installed addins
Android Signature Tool 1.0.1
MSBuild Editor 1.1.2
NuGet Package Management Extensions 0.12
Show in Github 1.0.3
JSON Copy 1.1
Comment 1 Ryan Schlesinger 2017-02-15 22:32:11 UTC
I'm also seeing an UnsatisfiedLinkError when starting up an IsolatedProcess. I'm unable to find a way to get Android IsolatedProcesses to work with Xamarin.
Comment 2 Ryan Schlesinger 2017-02-15 22:35:05 UTC
Looks like this person is as well:
https://forums.xamarin.com/discussion/88203/how-do-i-get-an-isolatedprocess-to-work
Comment 3 Frank 2017-02-15 23:22:49 UTC
Chiming in here - I'm running into the same issue as Ryan - trying to start an IsolatedProcess.
Comment 4 Jonathan Pryor 2017-03-16 18:28:35 UTC
Current analysis -- which is *weird* going, because for unknown reasons my `android.util.Log.w()` messages aren't actually showing up in `adb logcat` (I get the *tag*, but not the *message*!) -- is that things are horrifically broken. :-)

Way back when we originally added support for multiple processes, I found that Android would run the listed `<provider/>` values within `AndroidManifest.xml` within the new process. Which is why when we look at the generated `AndroidManifest.xml` for SampleContacts, we see:

>    <provider android:name="mono.MonoRuntimeProvider" android:exported="false" android:initOrder="2147483647" android:authorities="br.com.alexandremarcondes.contactsample.mono.MonoRuntimeProvider.__mono_init__" />
>    <provider android:name="mono.MonoRuntimeProvider_1" android:exported="false" android:initOrder="2147483647" android:process=":auth" android:authorities="br.com.alexandremarcondes.contactsample.mono.MonoRuntimeProvider_1.__mono_init__" />
>    <provider android:name="mono.MonoRuntimeProvider_2" android:exported="false" android:initOrder="2147483647" android:process=":contacts" android:authorities="br.com.alexandremarcondes.contactsample.mono.MonoRuntimeProvider_2.__mono_init__" />
>    <provider android:name="mono.MonoRuntimeProvider_3" android:exported="false" android:initOrder="2147483647" android:process=":sync" android:authorities="br.com.alexandremarcondes.contactsample.mono.MonoRuntimeProvider_3.__mono_init__" />

We're emitting a `<provider/>` for `MonoRuntimeProvider` for each process detected. In this case, we emit 4 of them, one for the default process, and one each for the :auth, :contacts, and :sync processes.

What I'm seeing when I run the ContactSample on my Android v7.1.2 device is that the MonoRuntimeProvider instances aren't being created within the new process.

`MonoRuntimeProvider` is responsible for initializing mono and loading registering the Application subclass, so all sorts of things break when it doesn't run.

(Alternatively, `android.util.Log` is unusable within the created process at the time that MonoRuntimeProvider is created and used. I'll need to dig further to ensure this isn't the case, )
Comment 5 Jonathan Pryor 2017-03-16 18:36:27 UTC
Jumping off of @Frank in Comment #3, this appears to be related to `//service/@android:isolatedProcess`.

https://developer.android.com/guide/topics/manifest/service-element.html#isolated

If I remove the use of `ServiceAttribute.IsolatedProcess` -- thus removing that attribute -- then the ContactSample app works as expected. I also see the log messages I expected to see, which is always a bonus. :-)

I thus have to suspect that `//*/@android:isolatedProcess` not only has "no permissions of its own," but also doesn't launch any `<provider/>`s, thus killing our entire bootstrap mechanism.

I have no idea how to fix this right now, or what the timeframe for supporting isolatedProcess will be. Research needed.

:-(
Comment 6 David Hathaway 2017-03-29 05:18:11 UTC
I believe I recreated this situation with the MyDriving app.

Pre-steps

1. Clone MyDriving from https://github.com/Azure-Samples/MyDriving
2. Open up the MainApplication.cs file, and put breakpoints in each method
3. Open up the GeolocationService.cs file, and put breakpoints in each method
4. On the [Service] Attribute of GeolocationService.cs, add the IsolatedProcess=true attribute so it reads [Service(IsolatedProcess = true)]

Steps to reproduce (Part 1)

1. Compile and run the android app, and observe that any breakpoints set in the MainApplication.cs file are hit.
2. Walk through the main screen of the app (swipe through the view pager, then click the LET'S GO! button)
3. Click on the "NO AUTH" button on the login page
4. If prompted (depends on the version of Android on your device) allow location services.
5. Note that each of the breakpoints in GeolocationService.cs are hit

Expected Result

App should continue to run, and service should be running in the background tracking location

Actual Result

User is prompted that the app has crashed.  In reality, the service has crashed, but the app continues to run.

Steps to reproduce (Part 2)

1. Clean the Android project, and delete all bin/obj folders
2. Fully uninstall the app from the test device
3. Open up the MainApplication.cs file, and comment out the entire MainApplication class
4. Recompile, and re-run the android app.  Follow steps 2-5 above, and note that service starts, and the app, and the service now run without crashing.
Comment 7 Dan Waters 2017-04-03 18:55:06 UTC
(In reply to David Hathaway from comment #6)
> I believe I recreated this situation with the MyDriving app.
> 
> Pre-steps
> 
> 1. Clone MyDriving from https://github.com/Azure-Samples/MyDriving
> 2. Open up the MainApplication.cs file, and put breakpoints in each method
> 3. Open up the GeolocationService.cs file, and put breakpoints in each method
> 4. On the [Service] Attribute of GeolocationService.cs, add the
> IsolatedProcess=true attribute so it reads [Service(IsolatedProcess = true)]
> 
> Steps to reproduce (Part 1)
> 
> 1. Compile and run the android app, and observe that any breakpoints set in
> the MainApplication.cs file are hit.
> 2. Walk through the main screen of the app (swipe through the view pager,
> then click the LET'S GO! button)
> 3. Click on the "NO AUTH" button on the login page
> 4. If prompted (depends on the version of Android on your device) allow
> location services.
> 5. Note that each of the breakpoints in GeolocationService.cs are hit
> 
> Expected Result
> 
> App should continue to run, and service should be running in the background
> tracking location
> 
> Actual Result
> 
> User is prompted that the app has crashed.  In reality, the service has
> crashed, but the app continues to run.
> 
> Steps to reproduce (Part 2)
> 
> 1. Clean the Android project, and delete all bin/obj folders
> 2. Fully uninstall the app from the test device
> 3. Open up the MainApplication.cs file, and comment out the entire
> MainApplication class
> 4. Recompile, and re-run the android app.  Follow steps 2-5 above, and note
> that service starts, and the app, and the service now run without crashing.

I followed these same reproduction steps. Using IsolatedProcess=true causes the MyDriving app (in this case) to crash whether or not a custom Application class is used. 

For me, I received the same exception whether or not the [Application] class was commented out entirely:

System.Exception: Service not bound yet
  at MyDriving.Droid.Services.GeolocationHelper.get_LocationService () [0x00015] in /Users/danwaters/MyDriving/src/MobileApps/MyDriving/MyDriving.Android/Services/GeolocationHelper.cs:31
  at MyDriving.Droid.Fragments.FragmentCurrentTrip.OnStop () [0x000c0] in /Users/danwaters/MyDriving/src/MobileApps/MyDriving/MyDriving.Android/Fragments/FragmentCurrentTrip.cs:345
  at Android.Support.V4.App.Fragment.n_OnStop (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in <25036d67d6b14ac088a0cce60b36c55f>:0
  at at (wrapper dynamic-method) System.Object:14226f9d-85d2-4dff-a41b-e8319a687dd4 (intptr,intptr)
Comment 8 Jonathan Pryor 2017-04-14 16:06:09 UTC
*** Bug 54420 has been marked as a duplicate of this bug. ***
Comment 9 Tom Opgenorth 2017-04-28 17:06:18 UTC
Just adding a bit more info in the hopes that this helps resolve the issue. I Tried this out with a sample app (https://github.com/xamarin/monodroid-samples/tree/master/ApplicationFundamentals/ServiceSamples/MessengerServiceDemo) from the Xamarin.Android docs on out-of-process services (https://developer.xamarin.com/guides/android/application_fundamentals/services/out-of-process-services/) as I know that I did have a sample working with `IsolatedProcess=true` at one time (notice the screenshots in the guide).

Steps to duplicate:
1. Get the code for the MessengerServiceDemo.
2. Open the solution in Visual Studio for Mac, and add the `IsolatedProcess=true` property to the ServiceAttribute on TimestampService class in the MessengerService project.
3. Connect an Android device running Android 6.0.1 to the computer.
4. Ensure that the MessengerService is set as the startup application.
5. Run the application
6. Service will crash with the message "Unfortunately, Messenger Service Demo has stopped".

Expected Result:
The Messenger Service Demo app will start, and after a short pause the service will be running as well.

Note that the provided sample solution also contains a second Xamarin.Android app which (should) start the service from the first Xamarin.Android project (in it's own process) and make IPC calls.  In this scenario, the service will crash when it is starting up as well.


Here are the relevant logcat messages from the timestamp service as it is trying to start up:

04-27 11:15:45.539: E/art(17568): No implementation found for void mono.android.Runtime.register(java.lang.String, java.lang.Class, java.lang.String) (tried Java_mono_android_Runtime_register and Java_mono_android_Runtime_register__Ljava_lang_String_2Ljava_lang_Class_2Ljava_lang_String_2)
04-27 11:15:45.539: D/AndroidRuntime(17568): Shutting down VM
04-27 11:15:45.540: E/AndroidRuntime(17568): FATAL EXCEPTION: main
04-27 11:15:45.540: E/AndroidRuntime(17568): Process: com.xamarin.xample.messengerservice.timestampservice_process, PID: 17568
04-27 11:15:45.540: E/AndroidRuntime(17568): java.lang.UnsatisfiedLinkError: No implementation found for void mono.android.Runtime.register(java.lang.String, java.lang.Class, java.lang.String) (tried Java_mono_android_Runtime_register and Java_mono_android_Runtime_register__Ljava_lang_String_2Ljava_lang_Class_2Ljava_lang_String_2)
04-27 11:15:45.540: E/AndroidRuntime(17568): 	at mono.android.Runtime.register(Native Method)
04-27 11:15:45.540: E/AndroidRuntime(17568): 	at com.xamarin.TimestampService.<clinit>(TimestampService.java:17)
04-27 11:15:45.540: E/AndroidRuntime(17568): 	at java.lang.Class.newInstance(Native Method)
04-27 11:15:45.540: E/AndroidRuntime(17568): 	at android.app.ActivityThread.handleCreateService(ActivityThread.java:2859)
04-27 11:15:45.540: E/AndroidRuntime(17568): 	at android.app.ActivityThread.-wrap4(ActivityThread.java)
04-27 11:15:45.540: E/AndroidRuntime(17568): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1427)
04-27 11:15:45.540: E/AndroidRuntime(17568): 	at android.os.Handler.dispatchMessage(Handler.java:102)
04-27 11:15:45.540: E/AndroidRuntime(17568): 	at android.os.Looper.loop(Looper.java:148)
04-27 11:15:45.540: E/AndroidRuntime(17568): 	at android.app.ActivityThread.main(ActivityThread.java:5417)
04-27 11:15:45.540: E/AndroidRuntime(17568): 	at java.lang.reflect.Method.invoke(Native Method)
04-27 11:15:45.540: E/AndroidRuntime(17568): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
04-27 11:15:45.540: E/AndroidRuntime(17568): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
04-27 11:20:45.543: I/Process(17568): Sending signal. PID: 17568 SIG: 9
04-27 11:20:46.687: E/art(18050): No implementation found for void mono.android.Runtime.register(java.lang.String, java.lang.Class, java.lang.String) (tried Java_mono_android_Runtime_register and Java_mono_android_Runtime_register__Ljava_lang_String_2Ljava_lang_Class_2Ljava_lang_String_2)
04-27 11:20:46.698: D/AndroidRuntime(18050): Shutting down VM
04-27 11:20:46.698: E/AndroidRuntime(18050): FATAL EXCEPTION: main
04-27 11:20:46.698: E/AndroidRuntime(18050): Process: com.xamarin.xample.messengerservice.timestampservice_process, PID: 18050
04-27 11:20:46.698: E/AndroidRuntime(18050): java.lang.UnsatisfiedLinkError: No implementation found for void mono.android.Runtime.register(java.lang.String, java.lang.Class, java.lang.String) (tried Java_mono_android_Runtime_register and Java_mono_android_Runtime_register__Ljava_lang_String_2Ljava_lang_Class_2Ljava_lang_String_2)
04-27 11:20:46.698: E/AndroidRuntime(18050): 	at mono.android.Runtime.register(Native Method)
04-27 11:20:46.698: E/AndroidRuntime(18050): 	at com.xamarin.TimestampService.<clinit>(TimestampService.java:17)
04-27 11:20:46.698: E/AndroidRuntime(18050): 	at java.lang.Class.newInstance(Native Method)
04-27 11:20:46.698: E/AndroidRuntime(18050): 	at android.app.ActivityThread.handleCreateService(ActivityThread.java:2859)
04-27 11:20:46.698: E/AndroidRuntime(18050): 	at android.app.ActivityThread.-wrap4(ActivityThread.java)
04-27 11:20:46.698: E/AndroidRuntime(18050): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1427)
04-27 11:20:46.698: E/AndroidRuntime(18050): 	at android.os.Handler.dispatchMessage(Handler.java:102)
04-27 11:20:46.698: E/AndroidRuntime(18050): 	at android.os.Looper.loop(Looper.java:148)
04-27 11:20:46.698: E/AndroidRuntime(18050): 	at android.app.ActivityThread.main(ActivityThread.java:5417)
04-27 11:20:46.698: E/AndroidRuntime(18050): 	at java.lang.reflect.Method.invoke(Native Method)
04-27 11:20:46.698: E/AndroidRuntime(18050): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
04-27 11:20:46.698: E/AndroidRuntime(18050): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
04-27 11:20:48.748: I/Process(18050): Sending signal. PID: 18050 SIG: 9


Here is information about my development environment: 

=== Visual Studio for Mac Preview ===

Version Preview 9 (7.0 build 2943)
Installation UUID: 56ba30d8-1dd6-4d40-ae16-fb0321a72123
Runtime:
	Mono 5.0.0.78 (2017-02/ba317ed) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 500000078

=== NuGet ===

Version: 4.0.0.2323

=== .NET Core ===

Runtime: Not installed
SDK: Not installed
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.0.0/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.5.4
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Xamarin.Android ===

Version: 7.3.0.11 (Visual Studio Enterprise)
Android SDK: /Users/tom/Library/Android/sdk
	Supported Android versions:
		4.4 (API level 19)
		5.0 (API level 21)
		5.1 (API level 22)
		6.0 (API level 23)
		7.0 (API level 24)
		7.1 (API level 25)

SDK Tools Version: 26.0.1
SDK Platform Tools Version: 25.0.4
SDK Build Tools Version: 25.0.2

Java SDK: /usr
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Apple Developer Tools ===

Xcode 8.3.2 (12175)
Build 8E2002

=== Xamarin.iOS ===

Version: 10.10.0.21 (Visual Studio Enterprise)
Hash: 675645b0
Branch: d15-2
Build date: 2017-04-22 14:32:46-0400

=== Xamarin Inspector ===

Version: 1.2.2
Hash: b71b035
Branch: d15-1
Build date: Fri, 21 Apr 2017 17:57:12 GMT

=== Xamarin.Mac ===

Version: 3.4.0.21 (Visual Studio Enterprise)

=== Build Information ===

Release ID: 700002943
Git revision: 66a6782a4635dbcdfb0b9bb3f076f46d8fc9b4b6
Build date: 2017-04-24 07:46:52-04
Xamarin addins: e7459e0d456fbb73c2661cfcd237235be4950936
Build lane: monodevelop-lion-d15-2

=== Operating System ===

Mac OS X 10.12.4
Darwin 16.5.0 Darwin Kernel Version 16.5.0
    Fri Mar  3 16:52:33 PST 2017
    root:xnu-3789.51.2~3/RELEASE_X86_64 x86_64
Comment 11 Jordan 2017-05-03 18:48:34 UTC
Thought I'd drop in and mention that I'm having similar issues with this bug as well. The app I am writing requires a background service, and through some extensive testing to eliminate any possible case of my code causing the crash, I found this and it seems to be the bug that's causing my code to not work properly.

When I create my service, it works perfectly fine until I add the IsolatedProcess = true attribute to the service declaration, then at that point it simply crashes at launch. I've even gone as far as creating an empty service class and running it as isolated to ensure that it's not my code being at fault, that of which also crashes. The app works fine (Whether it's in the foreground or suspended in the background), but the service fails to run.

Note You need to log in before you can comment on or make changes to this bug.