Why NetMaui Apps Crash in Release Mode on iOS Devices — A Journey to the Solution

Paul Willy Hammer
4 min readJun 19, 2024

Discover why NetMaui apps often crash in release mode on iOS devices and how to fix it. Through my journey of debugging and research, I found that AOT (Ahead-of-Time Compilation), especially with JSON serialization libraries, was the issue. By excluding AOT for these libraries, I stabilized my app. Learn this simple yet effective tweak to ensure your app runs smoothly and avoids frustrating crashes. Dive into the code and see the difference!

Last week on a warm summer evening, I decided to release my app to the internal test team. The app I had been working on for months was ready for internal testing. But every time I tested the release build on my iPhone, it crashed. Without any error message. The console and my tools showed nothing. I was at a loss.

I spent the first few weeks checking the usual suspects: faulty libraries, outdated packages, even my own code. The unit tests all passed perfectly. But nothing helped. My app kept crashing every time it tried to fetch data from a REST service and process it with JSON.

My frustration grew. I could already imagine the negative reviews in the App Store and the disappointed faces of my users. Was my app cursed? Had I made a fundamental error somewhere? These thoughts gnawed at me as I went through every line of…

--

--

Paul Willy Hammer

PWH, a senior software developer, excels in creating efficient .NET applications, always eager to share insights and best practices in software development.