A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
Thanks for reaching out. The exception ObjCRuntime.ObjCException in a .NET MAUI iOS app is a wrapper exception. It typically indicates that an underlying native iOS ( Objective-C) error is being thrown, but not surfaced clearly in managed logs. The stack trace you are seeing (UIApplication.Main) is only the entry point and does not reveal the root cause.
Root Cause Possibilities
Since you already:
- Verified GoogleService-Info.plist
- Added it to .csproj as BundleResource
The issue is most likely one of the following:
- Incorrect Firebase/plist Integration Even if the file exists, iOS will crash silently if:
- Bundle ID in Apple project is not equal to Bundle ID in plist
- plist is not included in the final app bundle Verify:
Also confirm:<ItemGroup> <BundleResource Include="Platforms\iOS\GoogleService-Info.plist"/> </ItemGroup>- File Build Action = BundleResource
- File is physically present under Platforms/iOS
- Missing Required iOS permissions (very common) If your app uses Firebase (especially Messaging/ Analytics), iOS may crash at startup dur to missing permissions. Check your Info.plist for required keys like:
Missing permission keys can directly trigger ObjException.<key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict> <key>NSCameraUsageDescription</key> <string> This app requires camera access</string> <key>NSLocationWhenInUseUsageDescription</key> <string>This app requires location access</string> - AppDelegate/Firebase Initialization Issue If you are using Firebase, ensure initialization is correct in AppDelegate.cs:
And ensure it is called before using any firebase services.Firebase.Core.App.Configure(); - Unhandled native exception- need full logs The actual error is hidden. You must capture device logs, not just Visual Studio output. Steps to get real error:
- Run app on iOS Simulator
- Open:
- Visual Studio -> View -> Pads -> Application Output
- Or use Mac Console:
Look for:Console.app -> Select Simulator -> Filter by your app- Terminating app due to uncaught exception
- reason: (this contains the real issue)
- Linking/ AOT issues (MAUI iOS) Sometimes linker removes required assemblies. Try:
Or from settings:<MtouchLink>None</MtouchLink>- iOS build -> Linker Behavior -> Don't link
- Clean/ Rebuild (Important) Corrupted builds can cause this exact issue. Run:
Or is visual studio:dotnet clean dotnet build- Delete bin and obj
- Restart IDE
- Rebuild solution
Recommended Action Plan
- Verify plist inclusion + bundle ID
- Check info.plist permissions
- Ensure Firebase initialization is correct
- Disable linker temporarily
- Capture full iOS native logs (critical step)
if the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment"