maui icon indicating copy to clipboard operation
maui copied to clipboard

App crashes only in release and only on physical device

Open Symbai opened this issue 3 years ago • 26 comments

Description

Update

Issue has been resolved for me by creating a new project and copying all code. I will leave the issue open since there are other people with same/similar problem.

Original

My app crashes right after splashscreen on my physical devices (iPhone and an android phone), before ANY of my code is executed. I can even remove all my code so its a blank shell, it still crashes. That it crashes only in release mode makes it super hard to determine. I've noticed that it does NOT crash when AOT is disabled (but I cannot do that for iOS so its still a major issue).

I've added the device log output from VS.

Steps to Reproduce

  1. Deploy in release mode (with AOT)
  2. Open app on iphone
  3. Splashscreen appears then hard crash back to homescreen

Version with bug

6.0.408 (current)

Last version that worked well

6.0 Release Candidate 3

Affected platforms

iOS, Android

Affected platform versions

iOS 15

Did you find any workaround?

Disable AOT, but this workaround only works on Android

Relevant log output

Time	Device Name	Type	PID	Tag	Message
Jul 22 15:22:53	iPhone	Error	66	SpringBoard(FrontBoard)	Scene FBSceneManager/sceneID:com.testapp-default update failed: <NSError: 0x282893c30; domain: FBSceneErrorDomain; code: 1 (operation-failed); reason: "Scene update failed."> {
Jul 22 15:22:54	iPhone	Notice	99	analyticsd	Aggregated. Transform: StabilityCrashNumerator3WithIncidentID Dirty: 1 Event: com.apple.stability.crash {"bundleID":"com.testapp","bundleVersion":"1","exceptionCodes":"0x0000000000000000, 0x0000000000000000(\134n    0,\134n    0\134n)EXC_CRASHSIGABRT","incidentID":"4407CF76-1386-4D97-9188-B009C08F12F5","logwritten":1,"process":"TestApp","terminationReasonNamespace":"<none>","timestamp":1658496174003213}
Jul 22 15:22:54	iPhone	Notice	99	analyticsd	Aggregated. Transform: StabilityCrashNumerator3 Dirty: 1 Event: com.apple.stability.crash {"bundleID":"com.testapp","bundleVersion":"1","exceptionCodes":"0x0000000000000000, 0x0000000000000000(\134n    0,\134n    0\134n)EXC_CRASHSIGABRT","incidentID":"4407CF76-1386-4D97-9188-B009C08F12F5","logwritten":1,"process":"TestApp","terminationReasonNamespace":"<none>","timestamp":1658496174003213}
Jul 22 15:22:54	iPhone	Notice	99	analyticsd	Aggregated. Transform: StabilityCrashNumerator3WithBundleVersion Dirty: 1 Event: com.apple.stability.crash {"bundleID":"com.testapp","bundleVersion":"1","exceptionCodes":"0x0000000000000000, 0x0000000000000000(\134n    0,\134n    0\134n)EXC_CRASHSIGABRT","incidentID":"4407CF76-1386-4D97-9188-B009C08F12F5","logwritten":1,"process":"TestApp","terminationReasonNamespace":"<none>","timestamp":1658496174003213}
Jul 22 15:22:54	iPhone	Notice	99	analyticsd	Received event: com.apple.stability.crash {"bundleID":"com.testapp","bundleVersion":"1","exceptionCodes":"0x0000000000000000, 0x0000000000000000(\134n    0,\134n    0\134n)EXC_CRASHSIGABRT","incidentID":"4407CF76-1386-4D97-9188-B009C08F12F5","logwritten":1,"process":"TestApp","terminationReasonNamespace":"<none>"}
Jul 22 15:22:54	iPhone	Notice	262	ReportCrash	com.testapp is not a MetricKit client
Jul 22 15:22:54	iPhone	Notice	262	ReportCrash(CoreAnalytics)	Sending event: com.apple.stability.crash {"bundleID":"com.testapp","bundleVersion":"1","exceptionCodes":"0x0000000000000000, 0x0000000000000000(\134n    0,\134n    0\134n)EXC_CRASHSIGABRT","incidentID":"4407CF76-1386-4D97-9188-B009C08F12F5","logwritten":1,"process":"TestApp","terminationReasonNamespace":"<none>"}
Jul 22 15:22:53	iPhone	Notice	262	ReportCrash	loadStoreInfo [platform 2] com.testapp from file:///private/var/containers/Bundle/Application/BF3FD221-BD77-419F-8143-3C60347EF46E/TestApp.app/
Jul 22 15:22:53	iPhone	Notice	118	symptomsd(SymptomEvaluator)	Failed to find process for com.testapp
Jul 22 15:22:53	iPhone	Notice	118	symptomsd(SymptomEvaluator)	com.testapp: Foreground: false
Jul 22 15:22:53	iPhone	Error	118	symptomsd(SymptomEvaluator)	COSMCtrl _foregroundAppActivity incoming bundle com.testapp has nil supplied UUID, finds existing 75BCB216-0B34-3FC9-B011-711A4262C951
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(UserNotificationsServer)	[com.testapp] com.testapp application state changed to Terminated
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(UserNotificationsServer)	[com.testapp] Ignore becoming background for application without push registration
Jul 22 15:22:53	iPhone	Notice	73	locationd	{"msg":"#CLIUA Marking change", "clientKey":"com.testapp", "reason":"Process state from RunningBoard", "assertionLevel":5, "coming":0}
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(SpringBoard)	didRemoveExternalForegroundApplicationSceneHandle pid:1101 scene:com.apple.frontboard.systemappservices::sceneID%3Acom.testapp-default now:<empty>
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(FrontBoard)	Client provider invalidated: <FBWorkspace: 0x28105fa70; application<com.testapp>>
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(SpringBoard)	Application process state changed for com.testapp: (null)
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(SpringBoard)	Process exited: <FBApplicationProcess: 0x105a678d0; application<com.testapp>:1101(vC52)> -> <RBSProcessExitContext| specific, status:<RBSProcessExitStatus| domain:signal(2) code:SIGABRT(6)>>
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(UIKitCore)	No longer tracking: <FBScene: 0x281217a80; sceneID:com.testapp-default>
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(FrontBoard)	Invalidating scene: sceneID:com.testapp-default
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(SpringBoard)	[SBMainDisplaySceneManager sceneManager:didDestroyScene: <FBScene: 0x281217a80; sceneID:com.testapp-default>] - proposing IdleTimerBehavior.
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(FrontBoard)	[sceneID:com.testapp-default][1] Scene invalidated.
Jul 22 15:22:53	iPhone	Error	66	SpringBoard(FrontBoard)	Scene FBSceneManager/sceneID:com.testapp-default update failed: <NSError: 0x282aeb180; domain: FBSceneErrorDomain; code: 1 (operation-failed); reason: "Scene update failed."> {
Jul 22 15:22:53	iPhone	Notice	39	mediaserverd(MediaExperience)	-CMSessionMgr- CMSessionMgrHandleApplicationStateChange: Client com.testapp with pid '1101' is now Terminated. Background entitlement: NO ActiveLongFormVideoSession: NO WhitelistedLongFormVideoApp NO
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(FrontBoard)	[application<com.testapp>:1101] Dropping launch assertion.
Jul 22 15:22:53	iPhone	Notice	46	powerd	Process runningboardd.35 Released SystemIsActive "application<com.testapp>35-66-9785:FBApplicationProcess" age:00:00:00  id:51539642784 [System: SysAct]
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(FrontBoard)	Removing: <FBApplicationProcess: 0x105a678d0; application<com.testapp>:1101(vC52)>
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(FrontBoard)	[application<com.testapp>:1101] Process exited: <RBSProcessExitContext| specific, status:<RBSProcessExitStatus| domain:signal(2) code:SIGABRT(6)>>.
Jul 22 15:22:53	iPhone	Notice	35	runningboardd(RunningBoard)	Calculated state for application<com.testapp>: none (role: None)
Jul 22 15:22:53	iPhone	Notice	35	runningboardd(RunningBoard)	Calculated state for application<com.testapp>: none (role: None)
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(FrontBoard)	Removing workspace registration for processHandle: [application<com.testapp>:1101]
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(FrontBoard)	[application<com.testapp>:1101] Setting process task state to: Not Running
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(FrontBoard)	[application<com.testapp>:1101] Invalidating workspace.
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(FrontBoard)	[application<com.testapp>:1101] Now flagged as pending exit for reason: launch failed
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(FrontBoard)	[application<com.testapp>:1101] Setting process visibility to: Unknown
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(FrontBoard)	[application<com.testapp>:1101] Connection to remote process was not established.
Jul 22 15:22:53	iPhone	Notice	35	runningboardd(RunningBoard)	Removed last relative-start-date-defining assertion for process application<com.testapp>
Jul 22 15:22:53	iPhone	Notice	35	runningboardd(RunningBoard)	Removing assertions for terminated process: [application<com.testapp>:1101]
Jul 22 15:22:53	iPhone	Notice	35	runningboardd(RunningBoard)	Removed job for [application<com.testapp>:1101]
Jul 22 15:22:53	iPhone	Notice	35	runningboardd(RunningBoard)	Removing launch job for: [application<com.testapp>:1101]
Jul 22 15:22:53	iPhone	Notice	35	runningboardd(RunningBoard)	[application<com.testapp>:1101] termination reported by launchd (0, 0, 6)
Jul 22 15:22:53	iPhone	Notice	35	runningboardd(RunningBoard)	Removing process: [application<com.testapp>:1101]
Jul 22 15:22:53	iPhone	Notice	156	chronod(ChronoCore)	noting foreground launch for com.testapp with widget extension; trigger metadata query
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(SpringBoard)	Application process state changed for com.testapp: <SBApplicationProcessState: 0x282124320; pid: 1101; taskState: Running; visibility: Foreground>
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(SpringBoard)	Application process state changed for com.testapp: <SBApplicationProcessState: 0x28213efa0; pid: 1101; taskState: Running; visibility: Foreground>
Jul 22 15:22:53	iPhone	Notice	73	locationd	CLMicroLocationLogic: startRecordingOrLocalizingIfAppropriate Recording parameters: localize: <private>, record: <private>
Jul 22 15:22:53	iPhone	Notice	73	locationd	{"msg":"CLMicroLocationLogic::startRecordingOrLocalizingIfAppropriate", "request":2, "will start recording":0, "reason":"Recording blacked out", "will start localizing":0, "reason":""}
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(UserNotificationsServer)	[com.testapp] Foreground app will not request ephemeral notifications isAppClip: NO wantsEphemeral notifications: NO
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(UserNotificationsServer)	[com.testapp] Ignore becoming foreground for application without push registration
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(UserNotificationsServer)	[com.testapp] com.testapp application state changed to ForegroundRunning
Jul 22 15:22:53	iPhone	Notice	118	symptomsd(SymptomEvaluator)	Failed to find process for com.testapp
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(FrontBoard)	[application<com.testapp>:1101] Workspace assertion state did change: ForegroundFocal (acquireAssertion = NO).
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(FrontBoard)	[sceneID:com.testapp-default] Scene assertion state did change: ForegroundFocal.
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(FrontBoard)	[application<com.testapp>:1101] Launch assertion supersedes update of workspace assertion to ForegroundFocal.
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(FrontBoard)	[sceneID:com.testapp-default] scene content state changed: preparing
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(FrontBoard)	[sceneID:com.testapp-default] Scene lifecycle state did change: Foreground
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(SpringBoard)	policy: now generation: 930; keyboardFocusTarget: <token: com.apple.frontboard.systemappservices::sceneID%3Acom.testapp-default; pid: 1101>; recentlyUsedScenes: <recentPIDs: [1101]; recentSceneIdentityTokensByPID: {1101: [com.apple.frontboard.systemappservices::sceneID%3Acom.testapp-default]}>; selectionPolicy: KeyboardArbiter; shouldSuppressRemoteDeferring: 0
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(SpringBoard)	policy: MRU target:<pid=1101 token=com.apple.frontboard.systemappservices::sceneID%3Acom.testapp-default>
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(SpringBoard)	didAddExternalForegroundApplicationSceneHandle pid:1101 scene:com.apple.frontboard.systemappservices::sceneID%3Acom.testapp-default now:<recentPIDs: [1101]; recentSceneIdentityTokensByPID: {1101: [com.apple.frontboard.systemappservices::sceneID%3Acom.testapp-default]}>
Jul 22 15:22:53	iPhone	Notice	35	runningboardd(RunningBoard)	Assertion 35-66-9786 (target:[application<com.testapp>:1101]) will be created as inactive as originator process has not exited
Jul 22 15:22:53	iPhone	Notice	35	runningboardd(RunningBoard)	Acquiring assertion targeting [application<com.testapp>:1101] from originator [daemon<com.apple.SpringBoard>:66] with description <RBSAssertionDescriptor| "com.apple.frontboard.after-life.interrupted" ID:35-66-9786 target:1101 attributes:[
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(UIKitCore)	[sceneID:com.testapp-default] Setting deactivation reasons to: 'systemAnimation' for reason: scene settings update - settings are eligible for deactivation reasons.
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(UIKitCore)	Now tracking: <FBScene: 0x281217a80; sceneID:com.testapp-default>
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(FrontBoard)	[application<com.testapp>:1101] Workspace interruption policy did change: reconnect
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(FrontBoard)	[sceneID:com.testapp-default][1] Scene activated.
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(FrontBoard)	[application<com.testapp>:1101] Registered new scene: <FBUIApplicationWorkspaceScene: 0x281c7fa80; sceneID:com.testapp-default> (fromRemnant = 0)
Jul 22 15:22:53	iPhone	Notice	118	symptomsd(SymptomEvaluator)	com.testapp: Foreground: true
Jul 22 15:22:53	iPhone	Notice	91	bluetoothd(CoreUtils)	SystemUI unknown identifier: 'sceneID:com.testapp-default' / 'com.testapp'
Jul 22 15:22:53	iPhone	Notice	56	wifid(WiFiPolicy)	WiFiDeviceManagerCatsSetForegroundApp: CATSUpdate en0: fgApp:com.testapp hs=0 t=1 wl=1 rc=1
Jul 22 15:22:53	iPhone	Notice	56	wifid(WiFiPolicy)	WiFiDeviceManagerCatsSetLowLatencyApp: CATSUpdate en0: fgApp:com.testapp b=0x0 rc=0
Jul 22 15:22:53	iPhone	Notice	56	wifid(WiFiPolicy)	WifiDeviceManagerCatsWhitelistedApp: CATS en0:  deviceManager:0x104038e00 FgApp:com.testapp stateChange:1 whitelisted=1
Jul 22 15:22:53	iPhone	Notice	73	locationd	{"msg":"#CLIUA Marking change", "clientKey":"com.testapp", "reason":"Process state from RunningBoard", "assertionLevel":5, "coming":1}
Jul 22 15:22:53	iPhone	Notice	39	mediaserverd(CMCapture)	<<<< FigCaptureDisplayLayoutMonitor >>>> -[FigCaptureDisplayLayoutMonitor _updateCurrentLayout:]: <FBSDisplayLayout: 0x1016992a0; displayIdentity: Main> {    bounds = {{0, 0}, {375, 812}};    interfaceOrientation = "portrait (1)";    backlightLevel = 100;    elements = {        <SBSDisplayLayoutElement: 0x1016bcef0; sceneID:com.testapp-default; bundleID: com.testapp; frame: {{0, 0}, {375, 812}}; level: 1; role: primary>;    }    timestamp = 22. Juli 2022 um 15:22:53 MESZ;}
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(FrontBoard)	change foreground process from list:<FBApplicationProcess: 0x105a678d0; application<com.testapp>:1101(vC52)>
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(FrontBoard)	Adding: <FBApplicationProcess: 0x105a678d0; application<com.testapp>:1101(vC52)>
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(FrontBoard)	[application<com.testapp>:1101] Initial launch assertion state: ForegroundFocal.
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(FrontBoard)	[application<com.testapp>:1101] Registering event dispatcher at connect
Jul 22 15:22:53	iPhone	Notice	39	mediaserverd(MediaExperience)	-CMSessionMgr- CMSessionMgrHandleApplicationStateChange: Sending EndInterruption to com.testapp with pid '1101' because client moved to ForegroundRunning and is not allowed to play in the background
Jul 22 15:22:53	iPhone	Notice	39	mediaserverd(MediaExperience)	-CMSessionMgr- CMSessionMgrHandleApplicationStateChange: Client com.testapp with pid '1101' is now Foreground Running. Background entitlement: NO ActiveLongFormVideoSession: NO WhitelistedLongFormVideoApp NO
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(FrontBoard)	[application<com.testapp>:1101] Setting process visibility to: Foreground
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(FrontBoard)	[application<com.testapp>:1101] Setting process task state to: Running
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(FrontBoard)	[application<com.testapp>:-1] Bootstrap success!
Jul 22 15:22:53	iPhone	Notice	46	powerd	Process runningboardd.35 Created SystemIsActive "application<com.testapp>35-66-9785:FBApplicationProcess" age:00:00:00  id:51539642784 [System: SysAct]
Jul 22 15:22:53	iPhone	Notice	35	runningboardd(RunningBoard)	Executing launch request for application<com.testapp> (FBApplicationProcess)
Jul 22 15:22:53	iPhone	Notice	35	runningboardd(RunningBoard)	[application<com.testapp>:1101] Set darwin role to: UserInteractiveFocal
Jul 22 15:22:53	iPhone	Notice	35	runningboardd(RunningBoard)	[application<com.testapp>:1101] Resuming task.
Jul 22 15:22:53	iPhone	Notice	35	runningboardd(RunningBoard)	Calculated state for application<com.testapp>: running-active (role: UserInteractiveFocal)
Jul 22 15:22:53	iPhone	Notice	35	runningboardd(RunningBoard)	[application<com.testapp>:1101] Set jetsam priority to 10 [0] flag[1]
Jul 22 15:22:53	iPhone	Notice	35	runningboardd(RunningBoard)	Assertion 35-66-9785 (target:application<com.testapp>) will be created as active
Jul 22 15:22:53	iPhone	Notice	35	runningboardd(RunningBoard)	Acquiring assertion targeting application<com.testapp> from originator [daemon<com.apple.SpringBoard>:66] with description <RBSAssertionDescriptor| "FBApplicationProcess" ID:35-66-9785 target:application<com.testapp> attributes:[
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(FrontBoard)	Bootstrapping application<com.testapp> with intent foreground-interactive
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(FrontBoard)	Created <FBWorkspace: 0x28105fa70; application<com.testapp>>
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(FrontBoard)	Creating process (sync=true) with identity: application<com.testapp>
Jul 22 15:22:53	iPhone	Notice	66	SpringBoard(FrontBoard)	Asked to bootstrap a new process with identity: application<com.testapp>

Symbai avatar Jul 22 '22 13:07 Symbai

I'm just coming back to an app that was previously running fine pre-v6.0.312. Now it crashes on my iOS device (haven't tested Android) but runs fine on the sim. It crashes for both adhoc and development builds on the device.

J-Swift avatar Jul 22 '22 16:07 J-Swift

I've narrowed my crash down to something related to an ios-bindings project which was working fine previously, though I did update the bindings at the same time I updated the Maui version. Still investigating.

J-Swift avatar Jul 22 '22 16:07 J-Swift

@Symbai is there also a bindings project involved in your solution? If anyone can provide a reproduction of sorts that would be super helpful!

jfversluis avatar Jul 25 '22 12:07 jfversluis

Hi @Symbai. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

ghost avatar Jul 25 '22 12:07 ghost

I wasnt able to repro on a new project but it appears it has issues with both an internal bindings project as well as the firebase ios bindings project. Can maybe try to repro that later but its tough bc of needing to do a release build.

J-Swift avatar Jul 25 '22 12:07 J-Swift

bindings project

What exactly is a "bindings project"? As for "reproduction", why is my log file not enough? What else do you need besides running it yourself?

@J-Swift Does your app crashes RIGHT after splashscreen or somewhere else? If somewhere else, you have a different issue.

Symbai avatar Jul 25 '22 17:07 Symbai

Hi. Are you using AbsoluteLayout and ZIndexes in your xaml code? Have same issue with release mode but after move ZIndexes in C# part all works.

PaulChek avatar Jul 26 '22 15:07 PaulChek

@Symbai right after splash. A bindings project is something that provides a native interface for Maui code. For my project I have an internal bindings library that we wrote, and I also use the Firebase bindings project provided by the Maui team (https://github.com/xamarin/GoogleApisForiOSComponents/blob/main/docs/Firebase/Crashlytics/GettingStarted.md). If I remove both of those I don't crash any more.

@PaulChek I am using those but it runs fine even when I keep them in, as long as I remove "problematic" libraries mentioned above.

J-Swift avatar Jul 26 '22 17:07 J-Swift

Hi. Are you using AbsoluteLayout and ZIndexes in your xaml code?

No.

@J-Swift:

I am not using a "binding project". I have NO libraries referenced at all. The fact that the IDENTICAL code runs fine on a new project makes it difficult to track down. Moreover, asking for a "reproduction" on iOS is a bit complicated as for me, it happens only on a physical device in release mode. That means the person who wants to reproduce must have a legit Apple developer license and must have added the project to his developer account. I doubt that @jfversluis has it, correct me if I am wrong but I believe he or any other would run this on the emulator instead, where it doesn't crash.

However, I have now created a NEW project. Same name. Copied the existing code, went through all files in VS and adopted the existing code. It seems to run fine on my physical device I now only need to wait for my external testers to confirm. And yes I've deleted the obj and bin folder on the original project without success. I dont know why it crashes at all but it definitely has nothing to do with the code. So if you guys jump in and say "I have the same issue but removing this or that fixes it", it's very likely a different issue.

//edit: Testers confirmed the issue is solved. But since there are other people having this issue I'll leave it opened.

Symbai avatar Jul 26 '22 17:07 Symbai

I'm facing the same issue. If I try to run it on iOS simulators ok, but it crashes when I try to run it on physical device, even on debug mode. I can privately share my project with you @jfversluis if needed. Just ping me by mail/skype [email protected]

ederbond avatar Jul 26 '22 18:07 ederbond

@Symbai what did you end up changing, if anything?

J-Swift avatar Jul 27 '22 14:07 J-Swift

@J-Swift N-o-t-h-i-n-g, that's why its so super strange. Same code, same csproj content, same file/project names, same manifests. Its just one is the existing project and the other is a new project. Existing project crashes, new project does not. I dont know if there are any hidden files somewhere except of BIN and OBJ folder, which I already said I've deleted them on the existing project without success. But I already spent too much hours on this so now that its fixed for me, I don't bother trying to figure out the reason anymore.

Also like I said Im not sure if our problems are the same. Does your Android app crashes as well in release mode with AOT? Because mine did, just like the iOS app. The "fix" by creating a new project and copy the code also fixed the Android AOT crash for me.

Symbai avatar Jul 27 '22 23:07 Symbai

I have a similar issue on Android, the adb log shows this line:

08-03 10:24:31.592 HMD Global Nokia X10 Error 17068 .<app_name> * Assertion at /__w/1/s/src/mono/mono/mini/aot-runtime.c:3678, condition `is_ok (error)' not met, function:decode_patch, module 'Microsoft.Maui.dll.so' is unusable (GUID of dependent assembly Xamarin.AndroidX.AppCompat doesn't match (expected '1FC81757-8A70-4D56-93E6-8A635E2C23DE', got 'FD3821D1-CBF4-4956-B930-EA2A5379E18D')).

I have not yet tried to create a new project, will do later and report back.

MartinRothschink avatar Aug 03 '22 13:08 MartinRothschink

Hi. Are you using AbsoluteLayout and ZIndexes in your xaml code? Have same issue with release mode but after move ZIndexes in C# part all works.

I am not sure how much I've gone through many links to get here just to fix my issue, I'm not sure if this work on issues owner, but it work for me. Thanks you! I've been pulling my hairs out since midnight through to morning!!

ray1997 avatar Aug 30 '22 01:08 ray1997

I had a problem using Z-Index in Android as well.

FM1973 avatar Aug 30 '22 12:08 FM1973

I used this in my Maui App. Try this, I hope it help somebody.

<PropertyGroup Condition="$(TargetFramework.Contains('-ios'))">
       <UseInterpreter>true</UseInterpreter>
</PropertyGroup>

arthastheking113 avatar Sep 07 '22 03:09 arthastheking113

@FM1973

Just remove a Zindex and works.

nandosilvajr avatar Sep 08 '22 15:09 nandosilvajr

@arthastheking113 Due to this issue I was unable to give iOS release to the clients. But following your suggestion resolved the issue after months of failures. Thank you from the bottom of my heart.

HobDev avatar Sep 12 '22 10:09 HobDev

This is an issue for me as well. ZIndex in xaml causes the app to crash in release mode (both android physical device and emulator). This is on a brand new Maui project. No changes except adding a zindex to xaml on mainpage.xaml.

Repo is here: https://github.com/jmblakl/MauiIssue-ZIndex-Release.git

System.Reflection.TargetInvocationException: Arg_TargetInvocationException ---> System.FieldAccessException: Field Microsoft.Maui.Controls.VisualElement:ZIndexProperty' is inaccessible from method MauiApp4.MainPage:InitializeComponent ()'

at MauiApp4.MainPage..ctor() at System.Reflection.RuntimeConstructorInfo.InternalInvoke(Object , Object[] , Boolean ) Exception_EndOfInnerExceptionStack at System.Reflection.RuntimeConstructorInfo.InternalInvoke(Object , Object[] , Boolean ) at System.RuntimeType.CreateInstanceMono(Boolean , Boolean ) at System.RuntimeType.CreateInstanceDefaultCtor(Boolean , Boolean ) at System.Activator.CreateInstance(Type , Boolean , Boolean ) at System.Activator.CreateInstance(Type , Boolean ) at System.Activator.CreateInstance(Type ) at Microsoft.Maui.Controls.ShellContent.<>c__DisplayClass19_0.<Microsoft.Maui.Controls.IShellContentController.GetOrCreateContent>b__0() at Microsoft.Maui.Controls.ElementTemplate.CreateContent() at Microsoft.Maui.Controls.Internals.DataTemplateExtensions.CreateContent(DataTemplate self, Object item, BindableObject container) at Microsoft.Maui.Controls.ShellContent.Microsoft.Maui.Controls.IShellContentController.GetOrCreateContent() at Microsoft.Maui.Controls.Platform.Compatibility.ShellSectionRenderer.OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) at AndroidX.Fragment.App.Fragment.n_OnCreateView_Landroid_view_LayoutInflater_Landroid_view_ViewGroup_Landroid_os_Bundle_(IntPtr , IntPtr , IntPtr , IntPtr , IntPtr ) at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPLLL_L(_JniMarshal_PPLLL_L , IntPtr , IntPtr , IntPtr , IntPtr , IntPtr ) at crc640ec207abc449b2ca.ShellSectionRenderer.n_onCreateView(Native Method) at crc640ec207abc449b2ca.ShellSectionRenderer.onCreateView(ShellSectionRenderer.java:42) at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2995) at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:523) at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:261) at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1840) at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1764) at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1701) at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2849) at androidx.fragment.app.FragmentManager.dispatchViewCreated(FragmentManager.java:2777) at androidx.fragment.app.Fragment.performViewCreated(Fragment.java:3020) at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:551) at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:261) at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1840) at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1764) at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1701) at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2849) at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:2784) at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:262) at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:478) at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:246) at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1455) at android.app.Activity.performStart(Activity.java:8076) at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3660) at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221) at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201) at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2210) 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:7839) 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:1003)

jmblakl avatar Sep 22 '22 19:09 jmblakl

I'm not sure this issue has to do with ZIndex or if it is, the error is manifested in different ways.

I recently updated Visual Studio to 17.3.5 and Android built in Release mode now crashes with the below error. Debug build works fine. I tried everything from clean, rebuild, delete app from device, etc. Nothing fixed it. Even tried some suggestion of re-installing Maui components and that didn't work either.

4 E Layer : [Surface(name=Task=1)/@0xddb8e9d - animation-leash#0] No local sync point found 09-27 22:29:15.905 3348 3348 E sting.clientap: * Assertion at /__w/1/s/src/mono/mono/mini/aot-runtime.c:3678, condition `is_ok (error)' not met, function:decode_patch, module 'FindATasting.ClientApp.dll.so' is unusable (GUID of dependent assembly Microsoft.Maui doesn't match (expected 'BF439B92-AABA-4CDA-BC93-F05A69484D20', got '995F4EB1-CF87-459A-85C1-A7632CF609E3')). 09-27 22:29:15.905 3348 3348 F libc : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 3348 (sting.clientapp), pid 3348 (sting.clientapp) 09-27 22:29:15.973 3376 3376 I crash_dump32: obtaining output fd from tombstoned, type: kDebuggerdTombstone 09-27 22:29:15.973 480 480 I tombstoned: received crash request for pid 3348

tysonswing avatar Oct 01 '22 16:10 tysonswing

Related to https://github.com/dotnet/maui/issues/10705

mattleibow avatar Nov 02 '22 20:11 mattleibow

This also may be some bad properties in your csproj:

<EnableCodeSigning>false</EnableCodeSigning>

Might need to check the csproj and remove/comment out the <EnableCodeSigning> ones as that may be causing invalid things.

@rolfbjarne is this a useful comment? :)

mattleibow avatar Nov 02 '22 20:11 mattleibow

Yes, EnableCodeSigning should never be set to false for device builds (we had a VS(Mac) bug where this was accidentally stored to the csproj).

rolfbjarne avatar Nov 02 '22 20:11 rolfbjarne

This should be the issue of ZIndex. It was "solved" here, but for me at least it only works on .net7 and still crashes on .net6. So try switching to .net7 for now and it might start workeing

MissedSte4k avatar Nov 08 '22 12:11 MissedSte4k

I used this in my Maui App. Try this, I hope it help somebody.

<PropertyGroup Condition="$(TargetFramework.Contains('-ios'))">
       <UseInterpreter>true</UseInterpreter>
</PropertyGroup>

That solved my problem in a net-6.0 iOS application (migrated from Xamarin.iOS) What's the effect of using this?

My app also crashed directly after splash screen. After the UseInterpreter property, the build time is much faster, the application is much smaller. Sooo what's the catch? :)

vallgrenerik avatar Nov 10 '22 07:11 vallgrenerik

@mattleibow / @rolfbjarne - I checked all MAUI project files for EnableCodeSigning and it wasn't in any of them. I just recently updated to VS 17.4.0 and will try release build to device again.

tysonswing avatar Nov 11 '22 01:11 tysonswing

try plug in a physical device and build against that. Our app crashed if we build against a generic device via VS Mac

timdinhdotcom avatar Dec 05 '22 09:12 timdinhdotcom

I looked into using AOT compilation as the current non AOT builds of my app are ridiculously slow (collectionview adding items take about 2 seconds to render after added to the observable collection) on Android but not iOS, but my app won't even start with AOT enabled

LennoxP90 avatar Dec 14 '22 01:12 LennoxP90

@Symbai are you still able to reproduce your original issue? We can review the Android logs to investigate further. I don't think we have enough info here to investigate.

Try the following for Android:

adb logcat -c
adb shell setprop debug.mono.log default,assembly,mono_log_level=debug,mono_log_mask=all
# Launch the app, make it crash
adb logcat -d > log.txt

(if it only happens on iOS, let us know we can get similar instructions)

Or if someone has a sample app, we can also take a look. Thanks!

jonathanpeppers avatar Feb 21 '23 15:02 jonathanpeppers

Hi @Symbai. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

ghost avatar Feb 21 '23 15:02 ghost