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.

[Android] App crash on start (NullPointerException)

See original GitHub issue

Hi All,

I’m using this library with react-navigation

when enable this library using:

// enable in App.js
import { enableScreens } from 'react-native-screens'
enableScreens() // OK on iOS but crash on Android

Then when I start my app in Android it crashes right at the beginning

Here the error:

 --------- beginning of crash
2020-01-11 17:56:41.155 25469-25469/com.myapp E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.meadow9, PID: 25469
    java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.swmansion.rnscreens.ScreenContainer.isTransitioning()' on a null object reference
        at com.swmansion.rnscreens.ScreenFragment.onCreate(ScreenFragment.java:51)
        at androidx.fragment.app.Fragment.performCreate(Fragment.java:2586)
        at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:838)
        at androidx.fragment.app.FragmentManagerImpl.addAddedFragments(FragmentManagerImpl.java:2100)
        at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManagerImpl.java:1874)
        at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManagerImpl.java:1830)
        at androidx.fragment.app.FragmentManagerImpl.execPendingActions(FragmentManagerImpl.java:1727)
        at androidx.fragment.app.FragmentManagerImpl$2.run(FragmentManagerImpl.java:150)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

My environment:

  • react-native: 0.61.5
  • react-navigation: 4.0.10
  • react-native-screens: 2.0.0-alpha.22 (Other setups I already follow documents)

Can any help this,

Many thanks

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:19
  • Comments:17 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kmagieracommented, Feb 5, 2020

I can take a look but before I do I’d need to get a minimal repro app where I can see the crash happening. Apparently in this case the stacktrace that’s provided in the issue description does not say much about what could be causing the issue (I see that there one object is null but I wouldn’t expect it to be null at this moment and adding nullability check won’t resolve this problem)

0reactions
WoLewickicommented, Apr 1, 2020

Ok, so I am closing it. Feel free to comment if something still does not work as it should.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I fix android app crashing after a java.lang ...
I think the problem is your binding. You can use a diffrenete way to overide onCreateView. First import import androidx.fragment.app.
Read more >
Android crash / NullPointerException · Issue #2477 - GitHub
I was able to reproduce it using my app (which is not terribly fancy) by setting minifyEnabled true, so it should be pretty...
Read more >
Bug: Application crashes due to NullpointerException while ...
Open Google Maps 2. Start Navigation (For bike) 3. Choose starting point 4. Choose destination -> App Crash Navigation by foot also brings...
Read more >
App crash / force close java.lang.NullPointerException, help
Hello everyone, I open this thread here because I know much of the ... Lite v4.5 Android x86", every think work as expected...
Read more >
Crashes - Android Developers
An Android app crashes whenever there's an unexpected exit caused by an unhandled exception or signal. An app that is written using Java...
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