java.lang.AssertionErrorAssertions.java:21

See original GitHub issue

Hello,

We recently upgraded to React Native 0.26.0 and since our production release have been seeing a large ramp up in the following crashes (This is from Bugsnag):

java.lang.AssertionError
        at com.facebook.infer.annotation.Assertions.assertNotNull(Assertions.java:21)
        at com.facebook.react.uimanager.events.EventDispatcher$DispatchEventsRunnable.run(EventDispatcher.java:305)
        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:31)
        at android.os.Looper.loop(Looper.java:148)
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:187)
        at java.lang.Thread.run(Thread.java:818)

I dove in and saw that in EventDispatcher.java, mRCTEventEmitter is null and there’s nothing catching the exception. My urge is to check if it’s null and do something like this…

    if (mRCTEventEmitter == null) {
      mRCTEventEmitter = mReactContext.getJSModule(RCTEventEmitter.class);
    }

but that can’t be right - i don’t know why it’s null in the first place.

We’re not having these problems in iOS.

Thanks in advanced, and i hope i’ve provided enough info - please ask if i haven’t

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
MicroKibacocommented, May 12, 2017

I encountered a similar problem, when dealing with map positioning, the program is running out, so far has not found the problem, the following I posted the error log, someone can help me?

com.facebook.infer.annotation.Assertions.assertCondition(Assertions.java:65) 2 com.facebook.react.uimanager.events.EventDispatcher.dispatchEvent(EventDispatcher.java:115) 3 com.dianwoba.rctamap.AMapView$9.run(AMapView.java:526) 4 android.os.Handler.handleCallback(Handler.java:751) 5 android.os.Handler.dispatchMessage(Handler.java:95) 6 android.os.Looper.loop(Looper.java:154) 7 android.app.ActivityThread.main(ActivityThread.java:6077) 8 java.lang.reflect.Method.invoke(Native Method) 9 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865) 10 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)

0reactions
mkonicekcommented, Oct 27, 2016

Hi there! This issue is being closed because it has been inactive for a while.

But don’t worry, it will live on with ProductPains! Check out its new home: https://productpains.com/post/react-native/javalangassertionerrorassertionsjava21

Product Pains has been very useful in highlighting the top bugs and feature requests: https://productpains.com/product/react-native?tab=top

Also, if this issue is a bug, please consider sending a pull request with a fix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exception in thread "main" java.lang.AssertionError
I ran into this very unhelpful error while compiling a project, and discovered that the problem was a reference to a non-existent static...
Read more >
AssertionError (Java Platform SE 7 ) - Oracle Help Center
Constructs an AssertionError with its detail message derived from the specified int , which is converted to a string as defined in section...
Read more >
5 | Handling java.lang.AssertionError - YouTube
assertion error javaJAVA & WEB | Session 16 | Assertion in Java ...
Read more >
What is java.lang.AssertionError in junit java
In this JUnit Tutorial in java we will learn when java.lang.AssertionError occurs with example in java junit. What is hierarchy of java.lang.
Read more >
Source for java.lang.AssertionError - developer.classpath.org!
42: * An assertion error normally occurs as a result of the <code>assert</code> 43: ; 47: * the string <code>"" + <em>expression</em></code>. This...
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