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

[Android] Null pointer exception crashing app for small number of users #131

Open
lostchopstik opened this issue Aug 8, 2022 · 3 comments

Comments

@lostchopstik
Copy link

Hi there,

I've been seeing a crash in our logs that has existed for many versions of our app and wanted to see if you guys might have any insights.

The error is:

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.database.sqlite.SQLiteDatabase.delete(java.lang.String, java.lang.String, java.lang.String[])' on a null object reference
       at com.tealium.core.persistence.d0.purgeExpired(SourceFile:5)
       at com.tealium.core.persistence.c0.<init>(SourceFile:8)
       at com.tealium.core.Tealium.<init>(SourceFile:65)
       at com.tealium.core.Tealium.<init>(SourceFile:114)
       at com.tealium.core.Tealium$Companion.create(SourceFile:1)
       at com.tealium.react.TealiumReact.initialize(TealiumReact.kt:65)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
       at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:188)
       at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
       at android.os.Handler.handleCallback(Handler.java:739)
       at android.os.Handler.dispatchMessage(Handler.java:95)
       at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
       at android.os.Looper.loop(Looper.java:148)
       at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228)
       at java.lang.Thread.run(Thread.java:818)

From what I can see, this error is happening on one device model, a Google Nexus 5X running Android 6.0.1 (which is right at our min supported SDK). This is probably not critical for you guys, just curious if anything can be done or if a null check needs to be added.

Thanks!

@jameskeith
Copy link
Contributor

hi @lostchopstik
I'm happy to take a look at it for you - the stack trace suggests that the Android SQLiteOpenHelper has returned a null value from getWritableDatabase which doesn't look like it should be possible according to their API; but rather it should throw us some exceptions when it fails to open the DB.

Are you able to confirm which version of our tealium-react-native package you are using? as it determines which version of the underlying Android SDK is in use - I'll need to know this to accurately troubleshoot.

@lostchopstik
Copy link
Author

Hey @jameskeith thanks for getting back. I've got v2.2.0 installed, though this issue has spanned all versions of 2.x that we have used since launching our app (this app has never used the 1.x version).

@mcapocaccia
Copy link

Hi @lostchopstik @jameskeith, sorry I got late to the party.
We noticed that specific device appears in automated tests by Google Play when we submit releases and it generates crashes that do not appear in the real world.
If you can check that is the case also for you (crashes reported in the dates when you submitted updates), you can probably close this issue.

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

3 participants