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

[Bug]: iOS instant crash during splash screen with .net8 and 5.2.1 #122

Closed
1 task done
IainS1986 opened this issue Sep 18, 2024 · 8 comments
Closed
1 task done

Comments

@IainS1986
Copy link

IainS1986 commented Sep 18, 2024

What happened?

Nuget 5.2.1 instantly kills the app during splash screen, no debugger even connected yet and no actual calls within my code to OneSignal yet.

This is on an iOS 17.6.1 device.

No crash log as of now, debugger is not connected and annoyingly XCode is not showing me any crash logs to fetch off the device 🤷

Rolling back to 5.1.3 is the current work around.

Steps to reproduce?

1. .net-ios .Net8
2. Add 5.2.1 OneSignal nuget
3. Launch App
4. App crashes during splashscreen.

What did you expect to happen?

App to startup fine and continue as before.

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@alexsmi-noveo
Copy link

alexsmi-noveo commented Sep 26, 2024

Perhaps I met familiar issue today when deployed my app to the testflight: splash screen replaced with total black and no logs, no errors, no exception. @IainS1986 please check if 2 location permissions are in the info.plist: NSLocationWhenInUseUsageDescription and NSLocationAlwaysAndWhenInUseUsageDescription even if your app doesn't use them. According to the documentation they are required for location-bases PN.
I'm using latest maui 8.0.91 + onesignal 5.2.1

@IainS1986
Copy link
Author

IainS1986 commented Sep 26, 2024

Tried that, but no luck, still instant crash/tear down the moment the splash screen appears.

@emawby
Copy link
Contributor

emawby commented Oct 1, 2024

@IainS1986 Odd it sounds like a crash during dynamic linking. It is hard to say what could be going wrong without any form of stack trace though. If you are able to find some form of log in xcode that would be very helpful

@IainS1986
Copy link
Author

I've not been successful so far in getting a decent crash log.

However I have spent some time getting a repo example.

https://github.com/IainS1986/OneSignal-iOS-Crash

This repo isn't completely empty, I've tried to set it up in the same way our project is structured. So MvvmCross is included and some basic viewmodels + startup flow.

But it crashes during the splash screen when using 5.2.X

If you roll the nugets back to 5.1.3 it works fine.

In setting this up I ran into some crashes even on 5.1.3 that were due to missing PInfo values (as suggested above). Did 5.2.X add more pinfo permissions that we now need to add?

Please let me know if you are able to confirm it crashing in that repo for you too 👍

@IainS1986
Copy link
Author

Ok. In investigating that project above i've managed to fix my issue, and god damn am I annoyed :D !

Just delete your Bin and Obj folder 🤦

If you're like me, you might have upgraded from 5.1.3 -> 5.2.X, ran locally, and seen it crashing. Tried out a few changes here and there, tried to debug, but nothing would work. Even a clean build (VS or Rider) doesn't fix it.

Then I just reverted back to 5.1.3 and carried on, periodically trying the above again and it never working.

If you manually delete the Bin/Obj folders though, bingo - works fine.

No idea why its being that tempromental going from 5.1.X -> 5.2.X but its resolved 🤷 👍

@DaveBrask
Copy link

I don't think this is related to OneSignal, I think it is a Maui thing. Before my release builds I delete the bin and obj folders, reboot, and clean solution. Failing to do this I've had crashing on both Android and iOS.

@IainS1986
Copy link
Author

Yeah it's certainly a common issue (although I will say Rider doesn't seem to be suffering from it anywhere near as much as VSMac did) - but - I've never really ran into it so consistently when going between 2 nuget versions.

FYI too, this was just with debug builds - I pretty much never do release builds locally as DevOps is all setup for that (and had I committed and ran it, I would have seen it work fine as that always does a completely clean build)

@jkasten2
Copy link
Member

jkasten2 commented Nov 1, 2024

@IainS1986 Thanks for sharing that deleting the Bin and Obj folders worked for you. We have seen odd issues too in the past with both Xamarin and MAUI when we developing this SDK, but didn't realize MAUI could have issues when upgrading released versions too. We will add some notes to our documentation to call this out.

Solution

Delete your Bin and Obj after upgrading the OneSignal SDK.

@jkasten2 jkasten2 closed this as completed Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants