question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Blazor Hybrid app crashing on physical iOS device, but nowhere else

See original GitHub issue

Description

Everything works perfectly on Android and my new app is already in the Play Store. Everything also works in all the emulators, both Debug and Release mode. However, I cannot get it working on a physical device in Release mode, because it crashes right after the splash screen. It works perfectly fine on the physical divide in Debug mode. The csproj file is pretty much all defaults from VS 2022 Preview with my own provisioning information added in there, but nothing else special. Below is the symbolicated stack for the crash. From what I can tell it’s none of my actual code that crashes. Does anyone has any ideas as to what may be going on?

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Triggered by Thread:  0

Application Specific Information:
abort() called


Thread 0 name:  tid_103 Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libsystem_kernel.dylib        	       0x1baa66bbc __pthread_kill + 8
1   libsystem_pthread.dylib       	       0x1db120854 pthread_kill + 208
2   libsystem_c.dylib             	       0x18b5ec0b0 __abort + 124
3   libsystem_c.dylib             	       0x18b5976b8 abort + 136
4   BalanceForecasting.Mobile     	       0x105770fbc log_callback(char const*, char const*, char const*, int, void*) + 60
5   BalanceForecasting.Mobile     	       0x105a46d58 monoeg_g_logv + 172
6   BalanceForecasting.Mobile     	       0x105a46e8c monoeg_g_log + 28
7   BalanceForecasting.Mobile     	       0x1059e3a38 load_aot_module + 4172
8   BalanceForecasting.Mobile     	       0x1058ce090 mono_assembly_request_load_from + 1276
9   BalanceForecasting.Mobile     	       0x1058cdae8 mono_assembly_request_open + 584
10  BalanceForecasting.Mobile     	       0x1058cf740 mono_assembly_open + 84
11  BalanceForecasting.Mobile     	       0x105770778 xamarin_open_and_register + 80
12  BalanceForecasting.Mobile     	       0x105a4a70c xamarin_register_assemblies_impl() + 36
13  BalanceForecasting.Mobile     	       0x105779544 xamarin_main + 688
14  BalanceForecasting.Mobile     	       0x105a4a8ac main + 64
15  dyld                          	       0x1118104d0 start + 444

Steps to Reproduce

Like I mentioned above, it’s your run off the mill Blazor Hybrid csproj with minor modifications to add provisioning and Release configurations for publishing.

Version with bug

6.0.486 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 15

Did you find any workaround?

I guess I could ship a Debug build, because that one worked on the physical device, but that’s just silly.

Relevant log output

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Kylar182commented, Sep 4, 2022

Sorry, that did not end up being the actual solution. My app is now in the app store and this is the configuration I have:


<PropertyGroup Condition="$(TargetFramework.Contains('-ios')) and '$(Configuration)' == 'Release'">

    <CodesignProvision>Automatic</CodesignProvision>

        <CodesignEntitlements>Entitlements.plist</CodesignEntitlements>

        <CodesignKey>iPhone Distribution</CodesignKey>

     <RuntimeIdentifier>ios-arm64</RuntimeIdentifier>

          <MtouchExtraArgs>--linkskip=Telerik.UI.for.Blazor --linkskip=AutoMapper --linkskip=Blazor.Styled --linkskip=MyApp.Razor</MtouchExtraArgs>

        <UseInterpreter>true</UseInterpreter>

        <MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>



</PropertyGroup>

I’m pretty sure the necessary parts are --linkskip=Telerik.UI.for.Blazor and <UseInterpreter>true</UseInterpreter>, but I threw the other ones in there for good measure. Be sure to do a completely clean build, otherwise it won’t work. Learned that the hard way.

This saved me. I’m now on the App Store!

0reactions
javiercncommented, Oct 20, 2022

@GolfJimB could you file a separate issue if you are still running into issues as @Eilon suggested?

@Eilon @PureWeen we are closing this issue as there is no further action here. It seems that the issue is related to correctly configuring the linker to make a third-party library work. So, I do not think there is anything for the Blazor team to take action here.

Feel free to comment if that is not the case and reopen the issue untagging area/blazor.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Blazor Hybrid (MAUI) app works in iOS simulator, but not ...
I recently finished developing my first Blazor Hybrid app. ... The crash dump was very uninformative and I don't really know what to...
Read more >
Blazor MAUI blank screen on iOS
I have a Blazor Hybrid MAUI App that works great on Android. However, when I compile my code (both from VS and from...
Read more >
dotnet MAUI Blazor App crashes only when deployed from ...
When I use <UseInterpreter>false</UseInterpreter> , the app starts, but immediately crashes in the Blazor Web View, not showing any other ...
Read more >
App failing to install in release mode but working in debug
MAUI app crashing in release but working in debug : dotnetMAUI ... the app and recreated it using Blazor Hybrid because I couldn't...
Read more >
.net MAUI Real World mobile App— February 2023 | ...
With MAUI, you can develop apps for iPhone, Android, Windows, and iOS with a single codebase. MAUI had its official launch in May...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found