Skip to content

Enhanced Fast Deployment doesn't work with Application subclasses #2730

Closed
@brendanzagaeski

Description

@brendanzagaeski

While checking the accuracy of what I had written for the Xamarin.Android 9.2 preview release notes related to Enhanced Fast Deployment, I realized I should check the exact old test case from Xamarin Bugzilla Bug 55050. It turns out the test case fails with a different error with the new version of Enhanced Fast Deployment. The error on an Android 8.0 emulator is very similar to the one seen by a user in Developer Community 435111 (probably only different because I'm using a newer preview version), but the error is different on an Android 7.1 emulator and on an Android 9.0 device, so I am filing a new issue to record all 3 versions of the error message.

Steps to Reproduce

  1. Download the test case.

  2. Build and install the app with enhanced fast deployment enabled:

     msbuild -t:Install -p:DefineConstants=INCLUDE_APP
  3. Run the app.

Expected Behavior

The app launches successfully and displays the "HELLO WORLD, CLICK ME!" button. (This is how the test case behaves when Enhanced Fast Deployment is disabled.)

Actual Behavior

The app exits unexpectedly during initialization.

Excerpt from the adb logcat output on Android 9.0 (API level 28) arm64-v8a Google Pixel 3 device

AndroidRuntime: Shutting down VM
--------- beginning of crash
AndroidRuntime: FATAL EXCEPTION: main
AndroidRuntime: Process: scratch.bxc55050, PID: 7870
AndroidRuntime: java.lang.IllegalAccessError: Illegal class access: 'mono.android.Runtime' attempting to access 'mono.android.GCUserPeer' (declaration of 'mono.android.Runtime' appears in /data/app/scratch.bxc55050--x-XSYlRTtX_PyHDVMsL9A==/base.apk)
AndroidRuntime:        at mono.android.Runtime.<clinit>(Runtime.java:8)
AndroidRuntime:        at mono.android.Runtime.init(Native Method)
AndroidRuntime:        at mono.MonoPackageManager.LoadApplication(MonoPackageManager.java:51)
AndroidRuntime:        at mono.MonoRuntimeProvider.attachInfo(MonoRuntimeProvider.java:42)
AndroidRuntime:        at android.app.ActivityThread.installProvider(ActivityThread.java:6402)
AndroidRuntime:        at android.app.ActivityThread.installContentProviders(ActivityThread.java:5949)
AndroidRuntime:        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5864)
AndroidRuntime:        at android.app.ActivityThread.access$1100(ActivityThread.java:200)
AndroidRuntime:        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1651)
AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:106)
AndroidRuntime:        at android.os.Looper.loop(Looper.java:193)
AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:6680)
AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
AndroidRuntime:        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
ActivityManager:   Force finishing activity scratch.bxc55050/md58bfd9258c6beb71a97a5dd7a0600aa01.MainActivity

Excerpt from the adb logcat output on Android 8.0 (API level 26) x86 emulator

AndroidRuntime: Shutting down VM
--------- beginning of crash
AndroidRuntime: FATAL EXCEPTION: main
AndroidRuntime: Process: scratch.bxc55050, PID: 6136
AndroidRuntime: java.lang.UnsatisfiedLinkError: No implementation found for void mono.android.Runtime.init(java.lang.String, java.lang.String[], java.lang.String, java.lang.String[], java.lang.ClassLoader, java.lang.String[], java.lang.String[], java.lang.String, int, java.lang.String[]) (tried Java_mono_android_Runtime_init and Java_mono_android_Runtime_init__Ljava_lang_String_2_3Ljava_lang_String_2Ljava_lang_String_2_3Ljava_lang_String_2Ljava_lang_ClassLoader_2_3Ljava_lang_String_2_3Ljava_lang_String_2Ljava_lang_String_2I_3Ljava_lang_String_2)
AndroidRuntime:        at mono.android.Runtime.init(Native Method)
AndroidRuntime:        at mono.MonoPackageManager.LoadApplication(MonoPackageManager.java:51)
AndroidRuntime:        at mono.MonoRuntimeProvider.attachInfo(MonoRuntimeProvider.java:42)
AndroidRuntime:        at android.app.ActivityThread.installProvider(ActivityThread.java:6239)
AndroidRuntime:        at android.app.ActivityThread.installContentProviders(ActivityThread.java:5805)
AndroidRuntime:        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5722)
AndroidRuntime:        at android.app.ActivityThread.-wrap1(Unknown Source:0)
AndroidRuntime:        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656)
AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:106)
AndroidRuntime:        at android.os.Looper.loop(Looper.java:164)
AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:6494)
AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
AndroidRuntime:        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
ActivityManager:   Force finishing activity scratch.bxc55050/md58bfd9258c6beb71a97a5dd7a0600aa01.MainActivity

Excerpt from the adb logcat output on Android 7.1 (API level 25) x86 emulator

AndroidRuntime: Shutting down VM
--------- beginning of crash
AndroidRuntime: FATAL EXCEPTION: main
AndroidRuntime: Process: scratch.bxc55050, PID: 31891
AndroidRuntime: java.lang.IllegalAccessError: Illegal class access: 'mono.MonoPackageManager' attempting to access 'mono.MonoPackageManager_Resources' (declaration of 'mono.MonoPackageManager' appears in /data/app/scratch.bxc55050-1/base.apk)
AndroidRuntime:        at mono.MonoPackageManager.LoadApplication(MonoPackageManager.java:54)
AndroidRuntime:        at mono.MonoRuntimeProvider.attachInfo(MonoRuntimeProvider.java:42)
AndroidRuntime:        at android.app.ActivityThread.installProvider(ActivityThread.java:5853)
AndroidRuntime:        at android.app.ActivityThread.installContentProviders(ActivityThread.java:5445)
AndroidRuntime:        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5384)
AndroidRuntime:        at android.app.ActivityThread.-wrap2(ActivityThread.java)
AndroidRuntime:        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545)
AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:102)
AndroidRuntime:        at android.os.Looper.loop(Looper.java:154)
AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:6119)
AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
AndroidRuntime:        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
ActivityManager:   Force finishing activity scratch.bxc55050/md58bfd9258c6beb71a97a5dd7a0600aa01.MainActivity

Version Information

Visual Studio 2019 Int Preview
Xamarin.Android SDK 9.1.103.12 (HEAD/7e1c4688)

VS bug #790706

Metadata

Metadata

Assignees

Labels

Area: App+Library BuildIssues when building Library projects or Application projects.Area: CommercialIssues with non-OSS components.bugComponent does not function as intended.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions