Skip to content

Crash on Xiaomi device: Fatal Exception: java.lang.NullPointerException service!!.referrerBundle(bundle) must not be null #1261

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

Closed
enea-ceolini opened this issue Apr 24, 2025 · 13 comments

Comments

@enea-ceolini
Copy link

Describe the bug

The app crashes at launch on a Xiaomi Redmi 13 Running Android 15 (HyperOS 2.0.3.0).
The Branch SDK version was 5.15.0

This seems to be related to retrieving referral information on Xiamoi devices. Interestingly we have not seen this issue in other manufacturers or in other Xiaomi devices

Steps to reproduce

  1. Branch is integrated/initialized in the standard way
// Application
Branch.getAutoInstance(this)
  1. Upon opening the app the crash appears
Fatal Exception: java.lang.NullPointerException: service!!.referrerBundle(bundle) must not be null
       at com.miui.referrer.api.GetAppsReferrerClientImpl.getInstallReferrer(GetAppsReferrerClientImpl.kt:141)
       at io.branch.coroutines.InstallReferrersKt$getXiaomiGetAppsReferrerDetails$2$1.onGetAppsReferrerSetupFinished(InstallReferrers.kt:201)
       at com.miui.referrer.api.GetAppsReferrerClientImpl$GetAppsReferrerServiceConnection.onServiceConnected(GetAppsReferrerClientImpl.kt:158)
       at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:2321)
       at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:2354)
       at android.os.Handler.handleCallback(Handler.java:959)
       at android.os.Handler.dispatchMessage(Handler.java:100)
       at android.os.Looper.loopOnce(Looper.java:249)
       at android.os.Looper.loop(Looper.java:337)
       at android.app.ActivityThread.main(ActivityThread.java:9486)
       at java.lang.reflect.Method.invoke(Method.java)

Expected behavior

The app should not crash at launch

SDK Version

5.15.0

Make and Model

Xiaomi Redmi 15

OS

15

Additional Information/Context

HyperOS 2.0.3.0

@gdeluna-branch
Copy link
Contributor

Thanks for reporting this, we'll investigate and issue a fix for this.

@Enny1991
Copy link

Quick update, we have encountered the same crash also on an additional Xiaomi device, Xiaomi 14 Ultra running HyperOS 2.0.103.0 and Android version 15.

Is there any ETA on this investigation?

Thanks!

@gdeluna-branch
Copy link
Contributor

Work will start later this week, thanks.

@adonixis
Copy link

Image

I am also waiting for this bug to be fixed, it affected a lot of devices in our application

@gdeluna-branch
Copy link
Contributor

@adonixis Are the devices affected using HyperOS, or can you repro on MIUI?

@adonixis
Copy link

adonixis commented May 23, 2025

@adonixis Are the devices affected using HyperOS, or can you repro on MIUI?

Image

Among the devices in the Crashlytics I see Redmi Note 13 Pro, Redmi Note 13, Redmi 14C, Redmi Note 13, Redmi 12, Poco X6 Pro 5G, Redmi Note 13, Redmi 13C, Redmi Note 8m, etc. As far as I know, they all run MIUI, not HyperOS. Unfortunately, I don't have a device with MIUI, so I can't reproduce this on mine.

@enea-ceolini
Copy link
Author

Some of those devices did receive an update to HyperOS, but it is unclear if they did update or not since unfortunately Firebase does not help in discerning HyperOS/MIUI. We received the crash reports directly from users running HyperOS and we got confirmation that a device running MIUI was NOT affected, but we cannot vouch for all MIUI (which we also do not have in house to reproduce).

@adonixis
Copy link

Ok, I get it. And can you fix this for HyperOS devices?

@gdeluna-branch
Copy link
Contributor

I'm able to repro with a HyperOS device, working on a fix now.

@gdeluna-branch
Copy link
Contributor

Please give 5.18.1 a try. Please re-open if you have a repro with 5.18.1, thanks!

@arunlodhi
Copy link

arunlodhi commented May 28, 2025

Thanks for the fix!

@gdeluna-branch Can you please also publish a new version of the React Native SDK pointing to this version? Unable to open an issue there as issues are disabled.

@adonixis
Copy link

@gdeluna-branch Great, thanks! We'll check it in the next release

@gdeluna-branch
Copy link
Contributor

Yes I'll publish this to react native sdk soon. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants