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.

Attempt to invoke virtual method 'android.view.ViewParent android.widget.LinearLayout.getParent()' on a null object reference

See original GitHub issue

💻 My environment

  • react-native-bootsplash version: 2.0.5
  • react-native version: 0.61.5
  • Platform: android
  • OS version: 8 & 9
  • Simulator: no
  • Android buildToolsVersion: 28.0.3

🕵️‍♂️ Reproducing the issue

After upgrading to 2.x such a fatal error started to appear in our Sentry:

NullPointerException
Attempt to invoke virtual method 'android.view.ViewParent android.widget.LinearLayout.getParent()' on a null object reference

In the stack trace there are lots of repeated calls:

android.view.ViewGroup in findViewTraversal at line 4563
android.view.View in findViewById at line 22699
android.view.ViewGroup in findViewTraversal at line 4564
android.view.View in findViewById at line 22699
android.view.ViewGroup in findViewTraversal at line 4564
android.view.View in findViewById at line 22699
android.view.ViewGroup in findViewTraversal at line 4564
android.view.View in findViewById at line 22699
android.view.ViewGroup in findViewTraversal at line 4564
android.view.View in findViewById at line 22699
android.view.ViewGroup in findViewTraversal at line 4564
android.view.View in findViewById at line 22699
android.view.ViewGroup in findViewTraversal at line 4564
android.view.View in findViewById at line 22699
android.view.ViewGroup in findViewTraversal at line 4564
android.view.View in findViewById at line 22699
android.view.ViewGroup in findViewTraversal at line 4564
android.view.View in findViewById at line 22699
android.view.ViewGroup in findViewTraversal at line 4564
android.view.View in findViewById at line 22699
android.view.ViewGroup in findViewTraversal at line 4564
android.view.View in findViewById at line 22699
android.view.ViewGroup in findViewTraversal at line 4564
android.view.View in findViewById at line 22699
android.view.ViewGroup in findViewTraversal at line 4564
android.view.View in findViewById at line 22699
android.view.ViewGroup in findViewTraversal at line 4564
(...) etc

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
mefjuucommented, Mar 16, 2020

I’ve been trying to trigger a crash but with no luck, fortunately. So, big thanks!

1reaction
zoontekcommented, Mar 14, 2020

@mefjuu I successfully reproduced it and it should be fixed in the latest version: https://github.com/zoontek/react-native-bootsplash/releases/tag/2.1.0

Could you try it? 🙏

Read more comments on GitHub >

github_iconTop Results From Across the Web

Attempt to invoke virtual method 'int android.view.View ...
it sometimes occurs when we use a custom adapter in any activity of fragment . and we return null object i.e null view...
Read more >
ViewParent - Android Developers
It is recommended you base your own implementation on the source code for the Android Open Source Project if you must use it...
Read more >
[Resolved] attempt to invoke virtual method recyclerview ...
I wanted to search data from database to recycler view, my code is below but I get an error in line 20 please...
Read more >
1410221 - Crash in java.lang.NullPointerException
NullPointerException: Attempt to invoke virtual method 'android.content.Context android.view.ViewGroup.getContext()' on a null object reference at ...
Read more >
Android java.langNullPointerException null object reference
Attempt to invoke virtual method 'android.view.View android.widget.LinearLayout ... OnClickListener() { @Override public void onClick(View v) { LinearLayout ...
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