You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running the Avalonia app (it can be the stock Avalonia template app) on a "Small Desktop" Android device, it crashes when clicking on the window resize/restore button (which isn't visible). This same crash also happens on my own app and was caught by Google Store's automated quality check.
Here are the exception details
Message
Unable to activate instance of type Avalonia.Android.Platform.SkiaPlatform.TopLevelImpl+ViewImpl from native handle 0x7fff7dace158 (key_handle 0x3812fd6).
Exception
System.NotSupportedException: Unable to activate instance of type Avalonia.Android.Platform.SkiaPlatform.TopLevelImpl+ViewImpl from native handle 0x7fff7dace158 (key_handle 0x3812fd6).
---> System.MissingMethodException: No constructor found for Avalonia.Android.Platform.SkiaPlatform.TopLevelImpl+ViewImpl::.ctor(System.IntPtr, Android.Runtime.JniHandleOwnership)
---> Java.Interop.JavaLocationException: Exception of type 'Java.Interop.JavaLocationException' was thrown.
Java.Lang.Error: Exception of type 'Java.Lang.Error' was thrown.
--- End of managed Java.Lang.Error stack trace ---
java.lang.Error: Java callstack:
at crc64bd239b21961e24ab.TopLevelImpl_ViewImpl.n_surfaceDestroyed(Native Method)
at crc64bd239b21961e24ab.TopLevelImpl_ViewImpl.surfaceDestroyed(TopLevelImpl_ViewImpl.java:130)
at android.view.SurfaceView.notifySurfaceDestroyed(SurfaceView.java:1800)
at android.view.SurfaceView.updateSurface(SurfaceView.java:993)
at android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:308)
at android.view.View.dispatchDetachedFromWindow(View.java:21336)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3949)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3949)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3949)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3949)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3949)
at android.view.ViewGroup.removeViewInternal(ViewGroup.java:5573)
at android.view.ViewGroup.removeViewInternal(ViewGroup.java:5544)
at android.view.ViewGroup.removeView(ViewGroup.java:5475)
at com.android.internal.widget.DecorCaptionView.removeContentView(DecorCaptionView.java:383)
at com.android.internal.policy.DecorView.clearContentView(DecorView.java:2383)
at com.android.internal.policy.PhoneWindow.clearContentView(PhoneWindow.java:530)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:5459)
at android.app.ActivityThread.handleRelaunchActivityInner(ActivityThread.java:5743)
at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:5658)
at android.app.servertransaction.ActivityRelaunchItem.execute(ActivityRelaunchItem.java:71)
at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2307)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7872)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
--- End of managed Java.Lang.Error stack trace ---
java.lang.Error: Java callstack:
at crc64bd239b21961e24ab.TopLevelImpl_ViewImpl.n_surfaceDestroyed(Native Method)
at crc64bd239b21961e24ab.TopLevelImpl_ViewImpl.surfaceDestroyed(TopLevelImpl_ViewImpl.java:130)
at android.view.SurfaceView.notifySurfaceDestroyed(SurfaceView.java:1800)
at android.view.SurfaceView.updateSurface(SurfaceView.java:993)
at android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:308)
at android.view.View.dispatchDetachedFromWindow(View.java:21336)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3949)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3949)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3949)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3949)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3949)
at android.view.ViewGroup.removeViewInternal(ViewGroup.java:5573)
at android.view.ViewGroup.removeViewInternal(ViewGroup.java:5544)
at android.view.ViewGroup.removeView(ViewGroup.java:5475)
at com.android.internal.widget.DecorCaptionView.removeContentView(DecorCaptionView.java:383)
at com.android.internal.policy.DecorView.clearContentView(DecorView.java:2383)
at com.android.internal.policy.PhoneWindow.clearContentView(PhoneWindow.java:530)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:5459)
at android.app.ActivityThread.handleRelaunchActivityInner(ActivityThread.java:5743)
at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:5658)
at android.app.servertransaction.ActivityRelaunchItem.execute(ActivityRelaunchItem.java:71)
at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2307)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7872)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
--- End of inner exception stack trace ---
at Java.Interop.TypeManager.CreateProxy(Type type, IntPtr handle, JniHandleOwnership transfer) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Java.Interop/TypeManager.cs:line 349
at Java.Interop.TypeManager.CreateInstance(IntPtr handle, JniHandleOwnership transfer, Type targetType) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Java.Interop/TypeManager.cs:line 311
--- End of inner exception stack trace ---
at Java.Interop.TypeManager.CreateInstance(IntPtr handle, JniHandleOwnership transfer, Type targetType) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Java.Interop/TypeManager.cs:line 318
at Java.Lang.Object.GetObject(IntPtr handle, JniHandleOwnership transfer, Type type) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Java.Lang/Object.cs:line 303
at Java.Lang.Object._GetObject[ISurfaceHolderCallback](IntPtr handle, JniHandleOwnership transfer) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Java.Lang/Object.cs:line 289
at Java.Lang.Object.GetObject[ISurfaceHolderCallback](IntPtr handle, JniHandleOwnership transfer) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Java.Lang/Object.cs:line 281
at Java.Lang.Object.GetObject[ISurfaceHolderCallback](IntPtr jnienv, IntPtr handle, JniHandleOwnership transfer) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Java.Lang/Object.cs:line 275
at Android.Views.ISurfaceHolderCallbackInvoker.n_SurfaceDestroyed_Landroid_view_SurfaceHolder_(IntPtr jnienv, IntPtr native__this, IntPtr native_holder) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/obj/Release/net8.0/android-34/mcw/Android.Views.ISurfaceHolder.cs:line 220
at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPL_V(_JniMarshal_PPL_V callback, IntPtr jnienv, IntPtr klazz, IntPtr p0) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:line 121
Inner Exception
System.MissingMethodException: No constructor found for Avalonia.Android.Platform.SkiaPlatform.TopLevelImpl+ViewImpl::.ctor(System.IntPtr, Android.Runtime.JniHandleOwnership)
---> Java.Interop.JavaLocationException: Exception of type 'Java.Interop.JavaLocationException' was thrown.
Java.Lang.Error: Exception of type 'Java.Lang.Error' was thrown.
--- End of managed Java.Lang.Error stack trace ---
java.lang.Error: Java callstack:
at crc64bd239b21961e24ab.TopLevelImpl_ViewImpl.n_surfaceDestroyed(Native Method)
at crc64bd239b21961e24ab.TopLevelImpl_ViewImpl.surfaceDestroyed(TopLevelImpl_ViewImpl.java:130)
at android.view.SurfaceView.notifySurfaceDestroyed(SurfaceView.java:1800)
at android.view.SurfaceView.updateSurface(SurfaceView.java:993)
at android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:308)
at android.view.View.dispatchDetachedFromWindow(View.java:21336)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3949)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3949)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3949)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3949)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3949)
at android.view.ViewGroup.removeViewInternal(ViewGroup.java:5573)
at android.view.ViewGroup.removeViewInternal(ViewGroup.java:5544)
at android.view.ViewGroup.removeView(ViewGroup.java:5475)
at com.android.internal.widget.DecorCaptionView.removeContentView(DecorCaptionView.java:383)
at com.android.internal.policy.DecorView.clearContentView(DecorView.java:2383)
at com.android.internal.policy.PhoneWindow.clearContentView(PhoneWindow.java:530)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:5459)
at android.app.ActivityThread.handleRelaunchActivityInner(ActivityThread.java:5743)
at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:5658)
at android.app.servertransaction.ActivityRelaunchItem.execute(ActivityRelaunchItem.java:71)
at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2307)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7872)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
--- End of managed Java.Lang.Error stack trace ---
java.lang.Error: Java callstack:
at crc64bd239b21961e24ab.TopLevelImpl_ViewImpl.n_surfaceDestroyed(Native Method)
at crc64bd239b21961e24ab.TopLevelImpl_ViewImpl.surfaceDestroyed(TopLevelImpl_ViewImpl.java:130)
at android.view.SurfaceView.notifySurfaceDestroyed(SurfaceView.java:1800)
at android.view.SurfaceView.updateSurface(SurfaceView.java:993)
at android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:308)
at android.view.View.dispatchDetachedFromWindow(View.java:21336)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3949)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3949)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3949)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3949)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3949)
at android.view.ViewGroup.removeViewInternal(ViewGroup.java:5573)
at android.view.ViewGroup.removeViewInternal(ViewGroup.java:5544)
at android.view.ViewGroup.removeView(ViewGroup.java:5475)
at com.android.internal.widget.DecorCaptionView.removeContentView(DecorCaptionView.java:383)
at com.android.internal.policy.DecorView.clearContentView(DecorView.java:2383)
at com.android.internal.policy.PhoneWindow.clearContentView(PhoneWindow.java:530)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:5459)
at android.app.ActivityThread.handleRelaunchActivityInner(ActivityThread.java:5743)
at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:5658)
at android.app.servertransaction.ActivityRelaunchItem.execute(ActivityRelaunchItem.java:71)
at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2307)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7872)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
--- End of inner exception stack trace ---
at Java.Interop.TypeManager.CreateProxy(Type type, IntPtr handle, JniHandleOwnership transfer) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Java.Interop/TypeManager.cs:line 349
at Java.Interop.TypeManager.CreateInstance(IntPtr handle, JniHandleOwnership transfer, Type targetType) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Java.Interop/TypeManager.cs:line 311
To Reproduce
Create an Android emulator for "Small Desktop" 1366x768. I'm using Android 13.0
Create a new Avalonia Cross Platform app
Debug the app on the Android device
Find where the resize/restore window decoration button would be (it's the second from the right). It won't be visible, but the mouse cursor will change
Click that button and the app will crash
Screencast.from.2024-07-25.17-58-22.mp4
Expected behavior
The window should resize without crashing
Avalonia version
11.1
OS
Android
Additional context
No response
The text was updated successfully, but these errors were encountered:
This exception is trhowed when your Activity is not configured to handle the configuration change, in that case the android runtime recreates the activity. To avoid the issue it is sufficient to adjust ConfigurationChanges of the ActivityAttribute. In your case it should be similar to:
Describe the bug
When running the Avalonia app (it can be the stock Avalonia template app) on a "Small Desktop" Android device, it crashes when clicking on the window resize/restore button (which isn't visible). This same crash also happens on my own app and was caught by Google Store's automated quality check.
Here are the exception details
Message
Unable to activate instance of type Avalonia.Android.Platform.SkiaPlatform.TopLevelImpl+ViewImpl from native handle 0x7fff7dace158 (key_handle 0x3812fd6).
Exception
Inner Exception
To Reproduce
Screencast.from.2024-07-25.17-58-22.mp4
Expected behavior
The window should resize without crashing
Avalonia version
11.1
OS
Android
Additional context
No response
The text was updated successfully, but these errors were encountered: