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.

2.4.0 [Android] Crash: No view found for id 0x531 (unknown) for fragment ScreenFragment

See original GitHub issue

#54 was closed, I’m creating a new issue for the following dependencies:

"react-native-screens": "^2.4.0",
"react-native-gesture-handler": "^1.5.6",
"react-native": "0.61.5",
"react-navigation": "^4.3.7",
"react-navigation-stack": "^2.2.3",
"react-navigation-tabs": "^2.8.2", 

Raw Exception:

java.lang.RuntimeException Unable to pause activity {com.ovo.energy/com.ovo.energy.MainActivity}: java.lang.IllegalArgumentException: No view found for id 0x531 (unknown) for fragment ScreenFragment{d5e11cd} (1dfe2ba5-2b95-4f48-ab7a-947dde476854) id=0x531} 
    ActivityThread.java:3981 android.app.ActivityThread.performPauseActivityIfNeeded
    ActivityThread.java:3947 android.app.ActivityThread.performPauseActivity
    ActivityThread.java:3921 android.app.ActivityThread.performPauseActivity
    ActivityThread.java:4739 android.app.ActivityThread.handleRelaunchActivity
    Unknown android.app.ActivityThread.-wrap18
    ActivityThread.java:1604 android.app.ActivityThread$H.handleMessage
    Handler.java:105 android.os.Handler.dispatchMessage
    Looper.java:251 android.os.Looper.loop
    ActivityThread.java:6572 android.app.ActivityThread.main
    Method.java:-2 java.lang.reflect.Method.invoke
    Zygote.java:240 com.android.internal.os.Zygote$MethodAndArgsCaller.run
    ZygoteInit.java:767 com.android.internal.os.ZygoteInit.main

Caused by: java.lang.IllegalArgumentException No view found for id 0x531 (unknown) for fragment ScreenFragment{d5e11cd} (1dfe2ba5-2b95-4f48-ab7a-947dde476854) id=0x531} 
    FragmentStateManager.java:315 androidx.fragment.app.FragmentStateManager.createView
    FragmentManager.java:1187 androidx.fragment.app.FragmentManager.moveToState
    FragmentManager.java:1356 androidx.fragment.app.FragmentManager.moveToState
    FragmentManager.java:1434 androidx.fragment.app.FragmentManager.moveFragmentToExpectedState
    FragmentManager.java:1497 androidx.fragment.app.FragmentManager.moveToState
    FragmentManager.java:2625 androidx.fragment.app.FragmentManager.dispatchStateChange
    FragmentManager.java:2593 androidx.fragment.app.FragmentManager.dispatchPause
    FragmentController.java:280 androidx.fragment.app.FragmentController.dispatchPause
    FragmentActivity.java:419 androidx.fragment.app.FragmentActivity.onPause
    ReactActivity.java:49 com.facebook.react.ReactActivity.onPause
    Activity.java:7115 android.app.Activity.performPause
    Instrumentation.java:1408 android.app.Instrumentation.callActivityOnPause
    ActivityThread.java:3970 android.app.ActivityThread.performPauseActivityIfNeeded
    ActivityThread.java:3947 android.app.ActivityThread.performPauseActivity
    ActivityThread.java:3921 android.app.ActivityThread.performPauseActivity
    ActivityThread.java:4739 android.app.ActivityThread.handleRelaunchActivity
    Unknown android.app.ActivityThread.-wrap18
    ActivityThread.java:1604 android.app.ActivityThread$H.handleMessage
    Handler.java:105 android.os.Handler.dispatchMessage
    Looper.java:251 android.os.Looper.loop
    ActivityThread.java:6572 android.app.ActivityThread.main
    Method.java:-2 java.lang.reflect.Method.invoke
    Zygote.java:240 com.android.internal.os.Zygote$MethodAndArgsCaller.run
    ZygoteInit.java:767 com.android.internal.os.ZygoteInit.main

MainActivity.java:

package com.app;

import com.facebook.react.ReactActivity;
import android.os.Bundle; // <- RNBootSplash
import com.zoontek.rnbootsplash.RNBootSplash; // RNBootSplash

import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactRootView;
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;

public class MainActivity extends ReactActivity {

  /**
   * Returns the name of the main component registered from JavaScript. This is used to schedule
   * rendering of the component.
   */
  @Override
  protected String getMainComponentName() {
    return "App";
  }

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(null);
    RNBootSplash.show(R.drawable.bootsplash, MainActivity.this); // <- display the "bootsplash" xml view over our MainActivity
   }

   @Override
   protected ReactActivityDelegate createReactActivityDelegate() {
     return new ReactActivityDelegate(this, getMainComponentName()) {
       @Override
       protected ReactRootView createRootView() {
        return new RNGestureHandlerEnabledRootView(MainActivity.this);
       }
     };
   }
}

enableScreens() is called in the same way as https://github.com/software-mansion/react-native-screens/blob/master/Example/App.js#L16

Additional information that might be helpful:

Android Versions:

OS versions OS Events % Events
10about 1 hour ago – 3 days ago android 117 54.2%
9about 1 hour ago – 3 days ago android 64 29.6%
8.0.0about 27 minutes ago – 3 days ago android 16 7.4%
7.0about 1 hour ago – 2 days ago android 9 4.2%
8.1.0about 1 day ago – 2 days ago android 8 3.7%
7.1.1about 2 days ago android 2 0.9%

Manufacturers:

Manufacturers Events % Events
samsungabout 1 hour ago – 3 days ago 133 61.6%
HUAWEIabout 1 hour ago – 3 days ago 31 14.4%
Googleabout 1 hour ago – 2 days ago 17 7.9%
Sonyabout 28 minutes ago – 3 days ago 14 6.5%
OnePlusabout 1 hour ago – 18 hours ago 11 5.1%
motorolaabout 15 hours ago – 2 days ago 4 1.9%
Droiabout 2 days ago 2 0.9%
LGEabout 2 days ago 2 0.9%
Xiaomiabout 2 days ago 2 0.9%

Models

Models Manufacturer Events % Events
SM-G960Fabout 9 hours ago – 3 days ago samsung 30 13.9%
SM-G973Fabout 3 hours ago – 2 days ago samsung 14 6.5%
SM-G975Fabout 12 hours ago – 3 days ago samsung 12 5.6%
ONEPLUS A5010about 1 hour ago – 14 hours ago OnePlus 8 3.7%
SM-A505FNabout 2 days ago – 3 days ago samsung 7 3.2%
CLT-L09about 13 hours ago – 3 days ago HUAWEI 6 2.8%
Pixel 3aabout 1 hour ago – 1 day ago Google 6 2.8%
SM-A530Fabout 1 day ago – 2 days ago samsung 6 2.8%
SM-G965Fabout 2 hours ago – 3 days ago samsung 6 2.8%
FIG-LX1about 14 hours ago – 2 days ago HUAWEI 5 2.3%
Pixel 3about 1 day ago – 2 days ago Google 5 2.3%
ELE-L09about 1 day ago – 3 days ago HUAWEI 4 1.9%
F5321about 3 hours ago – 3 days ago Sony 4 1.9%
FRD-L09about 1 hour ago – 1 day ago HUAWEI 4 1.9%
J8110about 22 hours ago – 2 days ago Sony 4 1.9%
SM-A705FNabout 1 day ago – 2 days ago samsung 4 1.9%
SM-G930Fabout 14 hours ago – 2 days ago samsung 4 1.9%
SM-G970Fabout 19 hours ago – 1 day ago samsung 4 1.9%
SM-J530Fabout 2 hours ago – 1 day ago samsung 4 1.9%
SM-N960Fabout 2 days ago samsung 4 1.9%
SM-N976Babout 15 hours ago – 1 day ago samsung 4 1.9%
ONEPLUS A5000about 17 hours ago – 18 hours ago OnePlus 3 1.4%
SM-G950Fabout 21 hours ago samsung 3 1.4%
SM-M307FNabout 1 day ago samsung 3 1.4%
SM-T510about 1 hour ago samsung 3 1.4%
ELE-L29about 2 days ago HUAWEI 2 0.9%
F8331about 28 minutes ago – 29 minutes ago Sony 2 0.9%
H8416about 1 day ago Sony 2 0.9%
HRY-LX1about 2 days ago HUAWEI 2 0.9%
J8210about 1 day ago Sony 2 0.9%
LYA-L09about 3 days ago HUAWEI 2 0.9%
Moto G (5S) Plusabout 2 days ago motorola 2 0.9%
Nexus 5Xabout 2 days ago LGE 2 0.9%
Nexus 6Pabout 1 day ago Huawei 2 0.9%
One Maxabout 2 days ago Droi 2 0.9%
Pixel 2 XLabout 1 day ago Google 2 0.9%
Pixel 3 XLabout 2 days ago Google 2 0.9%
Pixel 3a XLabout 14 hours ago Google 2 0.9%
Redmi Note 8 Proabout 2 days ago Xiaomi 2 0.9%
SM-A105FNabout 4 hours ago samsung 2 0.9%
SM-A320FLabout 12 hours ago samsung 2 0.9%
SM-A405FNabout 2 days ago samsung 2 0.9%
SM-A520Fabout 2 days ago samsung 2 0.9%
SM-A600FNabout 1 day ago samsung 2 0.9%
SM-A750FNabout 3 days ago samsung 2 0.9%
SM-G925Fabout 2 days ago samsung 2 0.9%
SM-G928Fabout 2 days ago samsung 2 0.9%
SM-G935Fabout 1 day ago – 2 days ago samsung 2 0.9%
SM-G986Babout 2 days ago samsung 2 0.9%
SM-J510FNabout 2 days ago samsung 2 0.9%
SM-T590about 16 hours ago samsung 2 0.9%
SNE-LX1about 2 days ago HUAWEI 2 0.9%
VOG-L09about 1 day ago HUAWEI 2 0.9%
motorola oneabout 15 hours ago motorola 2 0.9%
SM-T715about 18 hours ago samsung 1 0.5%

Thanks for all your help in advance!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:39 (14 by maintainers)

github_iconTop GitHub Comments

5reactions
WoLewickicommented, Jul 20, 2021

Can you check if this PR fixes the issue and does not introduce any new ones: https://github.com/software-mansion/react-native-screens/pull/1006/files ? It should be enough to apply changes from ScreenContainer.java and ScreenStack.java. It would be really helpful to get feedback about it since we would probably merge it if it does not introduce any new problems.

5reactions
anirudhagarwal365commented, Sep 15, 2020

I have been facing the same issue. Not able to reproduce this, but seeing a number of crashes on Crashlytics. Here are the dependencies I am using - I am passing null to super.onCreate

"@react-navigation/drawer": "5.1.1"
"@react-navigation/native": "5.0.9"
"react-native": "0.63.0"
"react-native-screens": "2.10.1"

Stacktrace -

Fatal Exception: java.lang.RuntimeException: Unable to pause activity {*.*.*/*.*.MainActivity}: java.lang.IllegalArgumentException: No view found for id 0xa9 (unknown) for fragment g{c2f6631} (3d710c8a-fa3f-42a1-a496-69d9773638ef) id=0xa9}
       at android.app.ActivityThread.performPauseActivityIfNeeded(ActivityThread.java:4078)
       at android.app.ActivityThread.performPauseActivity(ActivityThread.java:4033)
       at android.app.ActivityThread.handleRelaunchActivityInner(ActivityThread.java:4817)
       at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4756)
       at android.app.servertransaction.ActivityRelaunchItem.execute(ActivityRelaunchItem.java:69)
       at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
       at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
       at android.app.ClientTransactionHandler.executeTransaction(ClientTransactionHandler.java:55)
       at android.app.ActivityThread.handleRelaunchActivityLocally(ActivityThread.java:4806)
       at android.app.ActivityThread.access$3300(ActivityThread.java:200)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1841)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:201)
       at android.app.ActivityThread.main(ActivityThread.java:6823)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)

Caused by java.lang.IllegalArgumentException: No view found for id 0xa9 (unknown) for fragment g{c2f6631} (3d710c8a-fa3f-42a1-a496-69d9773638ef) id=0xa9}
       at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:18)
       at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:18)
       at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1)
       at androidx.fragment.app.FragmentManager.W(FragmentManager.java:47)
       at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:9)
       at androidx.fragment.app.FragmentManager.dispatchPause(FragmentManager.java:2)
       at androidx.fragment.app.FragmentController.dispatchPause(FragmentController.java:2)
       at androidx.fragment.app.FragmentActivity.onPause(FragmentActivity.java:2)
       at com.pgapps.MainActivity.onPause(MainActivity.java)
       at android.app.Activity.performPause(Activity.java:7444)
       at android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1466)
       at android.app.ActivityThread.performPauseActivityIfNeeded(ActivityThread.java:4068)
       at android.app.ActivityThread.performPauseActivity(ActivityThread.java:4033)
       at android.app.ActivityThread.handleRelaunchActivityInner(ActivityThread.java:4817)
       at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4756)
       at android.app.servertransaction.ActivityRelaunchItem.execute(ActivityRelaunchItem.java:69)
       at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
       at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
       at android.app.ClientTransactionHandler.executeTransaction(ClientTransactionHandler.java:55)
       at android.app.ActivityThread.handleRelaunchActivityLocally(ActivityThread.java:4806)
       at android.app.ActivityThread.access$3300(ActivityThread.java:200)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1841)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:201)
       at android.app.ActivityThread.main(ActivityThread.java:6823)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)

Device coverage - image

@WoLewicki Please let me know if any other info is required to help you debug.

Read more comments on GitHub >

github_iconTop Results From Across the Web

2.4.0 [Android] Crash: No view found for id 0x531 (unknown ...
#54 was closed, I'm creating a new issue for the following dependencies: "react-native-screens": "^2.4.0", "react-native-gesture-handler": ...
Read more >
Android app error No view found for id(..) for fragment
I'm getting no view found and i don't know how can fix it. Here is the first fragment: import android.os.Build; import android.os.
Read more >
Issue with Forms 2.4.0.280 on an android [No view found for id ...
IllegalArgumentException: No view found for id 0x1 (unknown) for fragment FragmentContainer{1716c46c #0 id=0x1} referenceTable GDEF ...
Read more >
Fixing IllegalArgumentException: No view found when using ...
This article is written to help people that have received the exception: java.lang.IllegalArgumentException: No view found for id 0x102036e ...
Read more >
未找到片段ViewPager 的id 视图 - 免费编程教程
2.4.0 [Android] Crash: No view found for id 0x531 (unknown) for ,. java.lang.IllegalArgumentException: No view found for id 0x7f080011 for fragment ...
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