Skip to content
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

Crash on Android when hold app over 2 minutes in background #22284

Open
ThinhKVT opened this issue May 8, 2024 · 8 comments
Open

Crash on Android when hold app over 2 minutes in background #22284

ThinhKVT opened this issue May 8, 2024 · 8 comments
Labels
platform/android 🤖 s/needs-attention Issue has more information and needs another look s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working

Comments

@ThinhKVT
Copy link

ThinhKVT commented May 8, 2024

Description

Hi all,

Could you help to suggestion any solution for the crash issue on Android only ?
We detected this after hold app over 2 minutes in background. Then re-open the app, it was crashed.

This is log:
android.runtime.JavaProxyThrowable: [System.NullReferenceException]: Object reference not set to an instance of an object.
05-07 17:25:16.035 22354 22354 E AndroidRuntime: at SPMobile.MAUI.App+<b__2_0>d.MoveNext(Unknown Source:0)
05-07 17:25:16.035 22354 22354 E AndroidRuntime: at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(Unknown Source:0)
05-07 17:25:16.035 22354 22354 E AndroidRuntime: at System.Threading.Tasks.Task+<>c.b__128_0(Unknown Source:0)
05-07 17:25:16.035 22354 22354 E AndroidRuntime: at Android.App.SyncContext+<>c__DisplayClass2_0.b__0(Unknown Source:0)
05-07 17:25:16.035 22354 22354 E AndroidRuntime: at Java.Lang.Thread+RunnableImplementor.Run(Unknown Source:0)
05-07 17:25:16.035 22354 22354 E AndroidRuntime: at Java.Lang.IRunnableInvoker.n_Run(Unknown Source:0)
05-07 17:25:16.035 22354 22354 E AndroidRuntime: at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PP_V(Unknown Source:0)
05-07 17:25:16.035 22354 22354 E AndroidRuntime: at mono.java.lang.RunnableImplementor.n_run(Native Method)
05-07 17:25:16.035 22354 22354 E AndroidRuntime: at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:31)
05-07 17:25:16.035 22354 22354 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:942)
05-07 17:25:16.035 22354 22354 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99)
05-07 17:25:16.035 22354 22354 E AndroidRuntime: at android.os.Looper.loopOnce(Looper.java:226)
05-07 17:25:16.035 22354 22354 E AndroidRuntime: at android.os.Looper.loop(Looper.java:313)
05-07 17:25:16.035 22354 22354 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:8757)
05-07 17:25:16.035 22354 22354 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
05-07 17:25:16.035 22354 22354 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
05-07 17:25:16.035 22354 22354 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)

Steps to Reproduce

No response

Link to public reproduction project repository

No response

Version with bug

8.0.6 SR1

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

7.0.101

Affected platforms

Android

Affected platform versions

Android 13

Did you find any workaround?

Not yet.

Relevant log output

Attached on Description.
@ThinhKVT ThinhKVT added the t/bug Something isn't working label May 8, 2024
Copy link
Contributor

github-actions bot commented May 8, 2024

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@jaosnz-rep
Copy link
Collaborator

Verified this issue with Visual Studio 17.10 Preview 6.0 (8.0.21), I can repro this error using a physical Android device (Samsung Android 13.0), but on the Android emulator it works fine.

@jaosnz-rep jaosnz-rep added platform/android 🤖 s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels May 8, 2024
@PureWeen
Copy link
Member

PureWeen commented May 8, 2024

Can you attach a logcat file with your crash?
https://learn.microsoft.com/en-us/xamarin/android/deploy-test/debugging/android-debug-log?tabs=windows

@PureWeen
Copy link
Member

PureWeen commented May 8, 2024

@jaosnz-rep can you attach your repro please?

@PureWeen PureWeen added the s/needs-info Issue needs more info from the author label May 8, 2024
@jaosnz-rep
Copy link
Collaborator

@jaosnz-rep can you attach your repro please?

I attached the Log and Output as follows
DeviceCrashLog.txt
DebugOutput.txt

I created a default .NET MAUI project to reproduce this error. The size is 96M and cannot be attached here. I can upload it to OneDrive if you need it.

@dotnet-policy-service dotnet-policy-service bot added s/needs-attention Issue has more information and needs another look and removed s/needs-info Issue needs more info from the author labels May 9, 2024
@drasticactions
Copy link
Contributor

@jaosnz-rep You don't need to upload the bin/obj folders, you just need to upload the source code, preferably to a GitHub repo, as described in the note when making the issue.

@drasticactions drasticactions added s/needs-repro Attach a solution or code which reproduces the issue and removed s/needs-attention Issue has more information and needs another look labels May 10, 2024
@drasticactions
Copy link
Contributor

Also, if you could try doing what you're doing in a .NET Android app that doesn't implement that MAUI UI framework (You can create one using the CLI command dotnet new android) and try your code there, that would be great. My guess based on your description is that what you're doing would break any Android app, not just ones using the MAUI UI framework controls.

@jaosnz-rep
Copy link
Collaborator

Also, if you could try doing what you're doing in a .NET Android app that doesn't implement that MAUI UI framework (You can create one using the CLI command dotnet new android) and try your code there, that would be great. My guess based on your description is that what you're doing would break any Android app, not just ones using the MAUI UI framework controls.

I tried it on .NET Android project and it also reproduces on physical Android device.
Below is my repo:
https://github.com/jaosnz-rep/MauiApp72

@dotnet-policy-service dotnet-policy-service bot added s/needs-attention Issue has more information and needs another look and removed s/needs-repro Attach a solution or code which reproduces the issue labels May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform/android 🤖 s/needs-attention Issue has more information and needs another look s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants