question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

java.lang.NullPointerException: Attempt to invoke interface method 'void no.nordicsemi.android.mesh.InternalTransportCallbacks.onMeshPduCreated(int, byte[])' on a null object reference

See original GitHub issue

Describe the bug Exception may thrown if Invoke “MeshManagerApi#createMeshPdu” too often.

To Reproduce Invoke “MeshManagerApi#createMeshPdu” method with high frequency. ( User send “VendorModelMessageAcked” via trigger UI, the interval around 1 seconds. )

Expected behavior Let app client catch the exception to avoid app crash.

Platform details:

  • Device: Samsung Galaxy S7
  • OS: 8.0.0
  • Library Version: v3.1.6

Logs / Screenshots

Fatal Exception: java.lang.NullPointerException: Attempt to invoke interface method 'void no.nordicsemi.android.mesh.InternalTransportCallbacks.onMeshPduCreated(int, byte[])' on a null object reference
       at no.nordicsemi.android.mesh.transport.MeshMessageState.sendSegmentAcknowledgementMessage(MeshMessageState.java:59)
       at no.nordicsemi.android.mesh.transport.LowerTransportLayer.sendBlockAck(LowerTransportLayer.java:115)
       at no.nordicsemi.android.mesh.transport.LowerTransportLayer.lambda$initSegmentedAccessAcknowledgementTimer$0(LowerTransportLayer.java:7)
       at no.nordicsemi.android.mesh.transport.LowerTransportLayer.$r8$lambda$qTByC7sBLyiT_YEVpMUYnkrHITk(LowerTransportLayer.java)
       at no.nordicsemi.android.mesh.transport.LowerTransportLayer$$InternalSyntheticLambda$0$40fa1d885b2ecaa88363e7d5e92ea6befb4732f4aefe7a7290462273435dc7a2$0.run(LowerTransportLayer.java:12)
       at android.os.Handler.handleCallback(Handler.java:789)
       at android.os.Handler.dispatchMessage(Handler.java:98)
       at android.os.Looper.loop(Looper.java:164)
       at android.app.ActivityThread.main(ActivityThread.java:6944)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
roshanrajaratnamcommented, Oct 29, 2021

@slydeur I will be away from work today so I will definitely give this a test on Monday. Thanks for the details.

0reactions
daretobeorjancommented, Feb 10, 2022

Does this happen when you send to multiple messages to multiple nodes?

I’m just working with one node at the moment.

This is basically my setup:

fun sendAndWait(cmd, response): Single {
    return Single.create { e ->
        createMeshPdu(cmd)
        addIncomingMessageListener(response) {
            e.onNext(it)
        }
    }.timeout().retry()
}

sendAndWait(ConfigModelAppBind, ConfigModelAppStatus).flatMap {
sendAndWait(ConfigModelAppBind, ConfigModelAppStatus).flatMap {
// repeat for many more models
sendAndWait(ConfigModelSubscriptionAdd, ConfigModelSubscriptionStatus).flatMap {
// and many more
sendAndWait(ConfigModelPublicationSet, ConfigModelPublicationStatus)
// and many more
}.subscribe()

It seems to work when only chaining a handful of messages, but as soon as I approach 10, it starts failing. Not always on the same message, it varies a bit, probably due to timing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android App Crash: Attempt to invoke interface method 'void ...
Android App Crash: Attempt to invoke interface method 'void com.transistorsoft.locationmanager.data.a.f()' on a null object reference #703.
Read more >
Attempt to invoke interface method 'void onclicklistner ...
You are using the listener before initialization. This is why you are getting nullpointerexception. public class support_fragment extends ...
Read more >
Attempt to invoke interface method 'void android.view ...
lang.NullPointerException: Attempt to invoke interface method 'void android.view.IWindowSession.finishDrawing(android.view.IWindow)' on a null object reference.
Read more >
3245632 - Error in Mobile SDK 'Fatal Exception: java.lang ...
NullPointerException : Attempt to invoke interface method 'boolean java.util.Map.containsKey(java.lang.Object)' on a null object reference ・Question 1.
Read more >
Fixed Error android error attempt to invoke virtual method
Need Help or Code Support? Feel Free To Contact Us Here http://www.aaviskar.com/support.phpThis video is about Fixed Error android error ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found