title: Delphi 11.1 crash staring Foregound Service
body: <p>I just upgraded from Delhi 11.0 to 11.1, because of issues with Jlocation on Android 12.</p>
  <p>Now my App no longer works at all, on ANY version of Android.</p>
  <p>It crashes when the App starts the Foreground Service, looks like the 'OnCreate'. It is dead before the first log entry.</p>
  <p>The App starts the Service like this:</p>
  <pre><code>DoLog('Init is starting Service');
          TLocalServiceConnection.StartService('SARTrackService');
  </code></pre>
  <p>The Android Log shows this (snipped a big chunk out), I do not understand it, it is not my code:</p>
  <pre><code>06-30 15:33:26.372: I/info(22110): SARTrack Client: [15:33:26.363] Init is starting Service
  
  06-30 15:33:26.563: W/ack.SARTrackAp(22110): CheckJNI: method to register &quot;dispatchToNative2&quot; not in the given class. This is slow, consider changing your RegisterNatives calls.
  06-30 15:33:26.563: E/ack.SARTrackAp(22110): ----- class 'Lcom/embarcadero/services/SARTrackServiceProxyInterface;' cl=0x14040590 -----
  06-30 15:33:26.563: E/ack.SARTrackAp(22110):   objectSize=188 (172 from super)
  06-30 15:33:26.563: E/ack.SARTrackAp(22110):   access=0x0008.0001
  06-30 15:33:26.563: E/ack.SARTrackAp(22110):   super='java.lang.Class&lt;java.lang.Object&gt;' (cl=0x0)
  06-30 15:33:26.564: E/ack.SARTrackAp(22110):   interfaces (1):
  06-30 15:33:26.564: E/ack.SARTrackAp(22110):      0: java.lang.Class&lt;java.lang.reflect.InvocationHandler&gt; (cl=0x0)
  06-30 15:33:26.564: E/ack.SARTrackAp(22110):   vtable (4 entries, 11 in super):
  06-30 15:33:26.564: E/ack.SARTrackAp(22110):      0: java.lang.Object com.embarcadero.services.SARTrackServiceProxyInterface.CreateProxyClass(java.lang.Class, long)
  06-30 15:33:26.564: E/ack.SARTrackAp(22110):      1: void com.embarcadero.services.SARTrackServiceProxyInterface.cleanNative(long)
  06-30 15:33:26.564: E/ack.SARTrackAp(22110):      2: java.lang.Object com.embarcadero.services.SARTrackServiceProxyInterface.dispatchToNative(java.lang.String, java.lang.Object[], long)
  06-30 15:33:26.564: E/ack.SARTrackAp(22110):      3: java.lang.Object com.embarcadero.services.SARTrackServiceProxyInterface.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
  06-30 15:33:26.564: E/ack.SARTrackAp(22110):   direct methods (1 entries):
  06-30 15:33:26.564: E/ack.SARTrackAp(22110):      0: void com.embarcadero.services.SARTrackServiceProxyInterface.&lt;init&gt;()
  06-30 15:33:26.564: E/ack.SARTrackAp(22110):   instance fields (1 entries):
  06-30 15:33:26.564: E/ack.SARTrackAp(22110):      0: long com.embarcadero.services.SARTrackServiceProxyInterface.pointer
  06-30 15:33:26.564: E/ack.SARTrackAp(22110): Failed to register native method com.embarcadero.services.SARTrackServiceProxyInterface.dispatchToNative2(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;J)Ljava/lang/Object; in /data/app/nz.sartrack.SARTrackApp-goI3CrRvcsABMeDExErzog==/base.apk
  06-30 15:33:26.959: A/ack.SARTrackAp(22110): java_vm_ext.cc:542] JNI DETECTED ERROR IN APPLICATION: JNI RegisterNatives called with pending exception java.lang.NoSuchMethodError: no static or non-static method &quot;Lcom/embarcadero/services/SARTrackServiceProxyInterface;.dispatchToNative2(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;J)Ljava/lang/Object;&quot;
  06-30 15:33:26.959: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   at void com.embarcadero.rtl.ProxyService.onCreateNative(java.lang.Object, java.lang.String) (ProxyService.java:-2)
  06-30 15:33:26.959: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   at void com.embarcadero.rtl.ProxyService.onCreate(java.lang.Object, java.lang.String) (ProxyService.java:51)
  06-30 15:33:26.959: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   at void com.embarcadero.services.SARTrackService.onCreate() (SARTrackService.java:40)
  06-30 15:33:26.960: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   at void android.app.ActivityThread.handleCreateService(android.app.ActivityThread$CreateServiceData) (ActivityThread.java:3804)
  06-30 15:33:26.960: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   at void android.app.ActivityThread.access$1500(android.app.ActivityThread, android.app.ActivityThread$CreateServiceData) (ActivityThread.java:248)
  06-30 15:33:26.960: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1846)
  06-30 15:33:26.960: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:106)
  06-30 15:33:26.960: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   at void android.os.Looper.loop() (Looper.java:216)
  06-30 15:33:26.960: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:7266)
  06-30 15:33:26.960: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   at java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) (Method.java:-2)
  06-30 15:33:26.960: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   at void com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run() (RuntimeInit.java:494)
  06-30 15:33:26.960: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:975)
  06-30 15:33:26.960: A/ack.SARTrackAp(22110): java_vm_ext.cc:542] 
  06-30 15:33:26.960: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]     in call to RegisterNatives
  06-30 15:33:26.960: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]     from void com.embarcadero.rtl.ProxyService.onCreateNative(java.lang.Object, java.lang.String)
  06-30 15:33:26.960: A/ack.SARTrackAp(22110): java_vm_ext.cc:542] &quot;main&quot; prio=5 tid=1 Runnable
  06-30 15:33:26.960: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   | group=&quot;main&quot; sCount=0 dsCount=0 flags=0 obj=0x74b70618 self=0xeaccd000
  06-30 15:33:26.960: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   | sysTid=22110 nice=-10 cgrp=default sched=0/0 handle=0xef35c4a8
  06-30 15:33:26.960: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   | state=R schedstat=( 0 0 0 ) utm=471 stm=55 core=1 HZ=100
  06-30 15:33:26.960: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   | stack=0xff63f000-0xff641000 stackSize=8MB
  06-30 15:33:26.960: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   | held mutexes= &quot;mutator lock&quot;(shared held)
  06-30 15:33:26.960: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   native: #00 pc 002e618f  /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream&lt;char, std::__1::char_traits&lt;char&gt;&gt;&amp;, int, BacktraceMap*, char const*, art::ArtMethod*, void*, bool)+134)
  06-30 15:33:26.960: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   native: #01 pc 00380b6d  /system/lib/libart.so (art::Thread::DumpStack(std::__1::basic_ostream&lt;char, std::__1::char_traits&lt;char&gt;&gt;&amp;, bool, BacktraceMap*, bool) const+212)
  06-30 15:33:26.960: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   native: #02 pc 0037d12b  /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream&lt;char, std::__1::char_traits&lt;char&gt;&gt;&amp;, bool, BacktraceMap*, bool) const+34)
  06-30 15:33:26.960: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   native: #03 pc 00239ce7  /system/lib/libart.so (art::JavaVMExt::JniAbort(char const*, char const*)+722)
  06-30 15:33:26.960: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   native: #04 pc 0023a04f  /system/lib/libart.so (art::JavaVMExt::JniAbortV(char const*, char const*, std::__va_list)+58)
  06-30 15:33:26.960: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   native: #05 pc 000c56a7  /system/lib/libart.so (art::(anonymous namespace)::ScopedCheck::AbortF(char const*, ...)+46)
  06-30 15:33:26.960: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   native: #06 pc 000c4349  /system/lib/libart.so (art::(anonymous namespace)::ScopedCheck::CheckPossibleHeapValue(art::ScopedObjectAccess&amp;, char, art::(anonymous namespace)::JniValueType)+1080)
  06-30 15:33:26.960: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   native: #07 pc 000c382b  /system/lib/libart.so (art::(anonymous namespace)::ScopedCheck::Check(art::ScopedObjectAccess&amp;, bool, char const*, art::(anonymous namespace)::JniValueType*)+622)
  06-30 15:33:26.960: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   native: #08 pc 000bdf1b  /system/lib/libart.so (art::(anonymous namespace)::CheckJNI::RegisterNatives(_JNIEnv*, _jclass*, JNINativeMethod const*, int)+530)
  06-30 15:33:26.960: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   native: #09 pc 0047a37d  /data/app/nz.sartrack.SARTrackApp-goI3CrRvcsABMeDExErzog==/lib/arm/libSARTrackService.so (???)
  
  [SNIP}
  
  06-30 15:33:26.961: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   native: #98 pc 00071c33  /system/lib/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+38)
  06-30 15:33:26.961: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   native: #99 pc 000740df  /system/lib/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector&lt;android::String8&gt; const&amp;, bool)+478)
  06-30 15:33:26.961: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   native: #100 pc 00002f35  /system/bin/app_process32 (main+728)
  06-30 15:33:26.961: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   native: #101 pc 0008dcdd  /system/lib/libc.so (__libc_init+48)
  06-30 15:33:26.961: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   native: #102 pc 00002c1d  /system/bin/app_process32 (_start_main+40)
  06-30 15:33:26.961: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   native: #103 pc 00000306  &lt;anonymous:ef359000&gt; (???)
  06-30 15:33:26.961: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   at com.embarcadero.rtl.ProxyService.onCreateNative(Native method)
  06-30 15:33:26.961: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   at com.embarcadero.rtl.ProxyService.onCreate(ProxyService.java:51)
  06-30 15:33:26.961: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   at com.embarcadero.services.SARTrackService.onCreate(SARTrackService.java:40)
  06-30 15:33:26.961: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   at android.app.ActivityThread.handleCreateService(ActivityThread.java:3804)
  06-30 15:33:26.961: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   at android.app.ActivityThread.access$1500(ActivityThread.java:248)
  06-30 15:33:26.961: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1846)
  06-30 15:33:26.961: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   at android.os.Handler.dispatchMessage(Handler.java:106)
  06-30 15:33:26.961: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   at android.os.Looper.loop(Looper.java:216)
  06-30 15:33:26.961: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   at android.app.ActivityThread.main(ActivityThread.java:7266)
  06-30 15:33:26.961: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   at java.lang.reflect.Method.invoke(Native method)
  06-30 15:33:26.961: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
  06-30 15:33:26.961: A/ack.SARTrackAp(22110): java_vm_ext.cc:542]   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)
  06-30 15:33:26.961: A/ack.SARTrackAp(22110): java_vm_ext.cc:542] 
  06-30 15:33:27.201: A/ack.SARTrackAp(22110): thread.cc:2155] No pending exception expected: java.lang.NoSuchMethodError: no static or non-static method &quot;Lcom/embarcadero/services/SARTrackServiceProxyInterface;.dispatchToNative2(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;J)Ljava/lang/Object;&quot;
  06-30 15:33:27.201: A/ack.SARTrackAp(22110): thread.cc:2155]   at void com.embarcadero.rtl.ProxyService.onCreateNative(java.lang.Object, java.lang.String) (ProxyService.java:-2)
  06-30 15:33:27.201: A/ack.SARTrackAp(22110): thread.cc:2155]   at void com.embarcadero.rtl.ProxyService.onCreate(java.lang.Object, java.lang.String) (ProxyService.java:51)
  06-30 15:33:27.201: A/ack.SARTrackAp(22110): thread.cc:2155]   at void com.embarcadero.services.SARTrackService.onCreate() (SARTrackService.java:40)
  06-30 15:33:27.201: A/ack.SARTrackAp(22110): thread.cc:2155]   at void android.app.ActivityThread.handleCreateService(android.app.ActivityThread$CreateServiceData) (ActivityThread.java:3804)
  06-30 15:33:27.201: A/ack.SARTrackAp(22110): thread.cc:2155]   at void android.app.ActivityThread.access$1500(android.app.ActivityThread, android.app.ActivityThread$CreateServiceData) (ActivityThread.java:248)
  06-30 15:33:27.201: A/ack.SARTrackAp(22110): thread.cc:2155]   at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1846)
  06-30 15:33:27.201: A/ack.SARTrackAp(22110): thread.cc:2155]   at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:106)
  06-30 15:33:27.201: A/ack.SARTrackAp(22110): thread.cc:2155]   at void android.os.Looper.loop() (Looper.java:216)
  06-30 15:33:27.201: A/ack.SARTrackAp(22110): thread.cc:2155]   at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:7266)
  06-30 15:33:27.201: A/ack.SARTrackAp(22110): thread.cc:2155]   at java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) (Method.java:-2)
  06-30 15:33:27.201: A/ack.SARTrackAp(22110): thread.cc:2155]   at void com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run() (RuntimeInit.java:494)
  06-30 15:33:27.201: A/ack.SARTrackAp(22110): thread.cc:2155]   at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:975)
  06-30 15:33:27.201: A/ack.SARTrackAp(22110): thread.cc:2155] 
  06-30 15:33:27.591: A/ack.SARTrackAp(22110): runtime.cc:577] Runtime aborting --- recursively, so no thread-specific detail!
  </code></pre>
  <p>Help...</p>