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

NullReferenceException on cold starts without attribution [iOS] [Adjust v5.1.2] #330

Open
AndrewUrbanovich opened this issue Mar 11, 2025 · 10 comments

Comments

@AndrewUrbanovich
Copy link

AndrewUrbanovich commented Mar 11, 2025

Hi! We are facing NullRef exception during cold app starts without any attribution present.

NullReferenceException: Object reference not set to an instance of an object.
AdjustSdk.JSONNode.Parse (System.String aJSON) (at <00000000000000000000000000000000>:0)
AdjustSdk.AdjustAttribution..ctor (System.String jsonString) (at <00000000000000000000000000000000>:0)
AdjustSdk.AdjustiOS+<>c__DisplayClass111_0.<AttributionGetterMonoPInvoke>b__0 () (at <00000000000000000000000000000000>:0)
AdjustThreadDispatcher.Update () (at <00000000000000000000000000000000>:0)

Adjust: 5.1.2
Platform: iOS (probably same behavior for Android)
XCode: 15.4
Unity: 2022.3.52f

@uerceg
Copy link
Contributor

uerceg commented Mar 11, 2025

Hey @AndrewUrbanovich,

Thanks for reporting this. Are you getting this when you are trying to initialize SDK during the InitSdk call or at some other moment?

@AndrewUrbanovich
Copy link
Author

AndrewUrbanovich commented Mar 11, 2025

@uerceg I suppose it's on GetAttribution call right after InitSdk

Adjust.InitSdk(adjustConfig);
Adjust.GetAttribution(AttributionChangedHandler);

@uerceg
Copy link
Contributor

uerceg commented Mar 11, 2025

Thank you. And is this always reproducible on your end?

@AndrewUrbanovich
Copy link
Author

@uerceg yesterday it was happening on every launch, but now I can't reproduce this.
Maybe it was happening because it couldn't find an attribution for some reason, NullRef should happen if attribution string is null because there are no null checks during JSON parsing.
But I'm not sure how to make it happen again.

@AndrewUrbanovich
Copy link
Author

Here is some additional information, maybe you can check some information on your end and see what's happened:
idfa: 02662947-4141-4245-9C2B-4C3CB80EB508
Time: 11.03.2025 16:00:45 CEST

@AndrewUrbanovich
Copy link
Author

@uerceg Hi! Did you manage to detect the issue? Any news on estimation?

@AndrewUrbanovich
Copy link
Author

We managed to find 100% reproduction steps:

  1. Install app with Adjust v5.0.6
  2. Launch the app with normal internet connection
  3. Update the app to new version with Adjust v5.1.2
  4. Turn on 100% loss in developer option, network link conditioner
  5. Launch the app

And getting error mentioned above

@AndrewUrbanovich
Copy link
Author

After we added few additional null-checks for jsonString and jsonResponseString there is no error
Image
But we're not getting attributionChanged callback anymore (same steps - during update from previous version to a new one) and this is issue for us, we are subscribing in two ways:

AttributionChangedDelegate = AttributionChangedHandler inside AdjustConfig

And

Adjust.InitSdk(adjustConfig);
Adjust.GetAttribution(AttributionChangedHandler);

@uerceg
Copy link
Contributor

uerceg commented Mar 21, 2025

Thank you for all the checks and report. We'll address this next week. I'll keep you posted.

@uerceg uerceg mentioned this issue Mar 24, 2025
@uerceg
Copy link
Contributor

uerceg commented Mar 24, 2025

Hey @AndrewUrbanovich,

Thank you one more time for all the effort on this one from your end. We have just shipped v5.1.3 with this fix. Looking forward to hearing back from you if this version fixed this issue for you or are you maybe still facing it.

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

2 participants