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 Fragment: not being displayed

See original GitHub issue

Description

I’ve create a simple module to experiment using an Android Fragment in React Native, everything is fine, I can see the Fragment in the “Layout Inspector” but it does not display the data and it appear in the very back of the Views hierarchy.

I have added to this repo for better visualization: https://github.com/wilsolutions/react-native-experiments

I have also added to StackOverflow: https://stackoverflow.com/questions/69771856/android-fragment-not-displayed-in-react-native-app

Screenshot of the Views, also available in the link above: https://i.stack.imgur.com/XEbVb.png

Version

0.66.0

Output of react-native info

Please note that this an example project create with npx create-react-native-library but I have created a project with RN 0.66 as well.

System: OS: macOS 11.5.2 CPU: (12) x64 Intel® Core™ i7-8750H CPU @ 2.20GHz Memory: 116.01 MB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 15.7.0 - /usr/local/bin/node Yarn: 1.22.10 - /usr/local/bin/yarn npm: Not Found Watchman: 4.9.0 - /usr/local/bin/watchman Managers: CocoaPods: 1.10.1 - /Users/wils/.rvm/rubies/ruby-2.6.6/bin/pod SDKs: iOS SDK: Platforms: iOS 15.0, DriverKit 20.4, macOS 11.3, tvOS 15.0, watchOS 8.0 Android SDK: API Levels: 23, 28, 29, 30 Build Tools: 23.0.1, 24.0.0, 26.0.1, 26.0.2, 27.0.1, 27.0.3, 28.0.0, 28.0.1, 28.0.3, 29.0.2, 29.0.3, 30.0.1, 30.0.2 System Images: android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom, android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom Android NDK: Not Found IDEs: Android Studio: 2020.3 AI-203.7717.56.2031.7784292 Xcode: 13.0/13A233 - /usr/bin/xcodebuild Languages: Java: 1.8.0_181 - /usr/bin/javac Python: 2.7.16 - /usr/bin/python npmPackages: @react-native-community/cli: Not Found react: 16.13.1 => 16.13.1 react-native: 0.63.4 => 0.63.4 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Steps to reproduce

Please checkout the example: https://github.com/wilsolutions/react-native-experiments Then run the yarn boostrap followed by yarn example android

When the App launches it should display the Android Fragment but it is not.

Snack, code example, screenshot, or link to a repository

Repo: https://github.com/wilsolutions/react-native-experiments

Screenshot and more info: https://stackoverflow.com/questions/69771856/android-fragment-not-displayed-in-react-native-app

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
arjun1194commented, Nov 15, 2021

can you please at-least post the updated doc link ?? or a PR to the changes, im really confused what has changed please!!

0reactions
jamninetyfivecommented, Apr 15, 2022

same here @wilsolutions For me, it is to embed the react native page into Android. Now get a white screen, but views hierarchy is fine… any idea for me

Read more comments on GitHub >

github_iconTop Results From Across the Web

android - Fragment not showing up - Stack Overflow
Have you tried creating a fragment holder type FrameLayout or similar in your root layout to display your fragment? · By trying to...
Read more >
Fragment | Android Developers
onStop() fragment is no longer visible to the user either because its activity is being stopped or a fragment operation is modifying it...
Read more >
Android – Fragment not showing up - iTecNote
To get the result in your fragment make sure you call startActivityForResult(intent,111); instead of getActivity().startActivityForResult(intent,111); inside ...
Read more >
7 Common Mistakes Easily Made with Android Fragment
Why this is not good · Using add will keep the bottom fragment views visible, and take up more memories unnecessarily (since it...
Read more >
Creating and Using Fragments | CodePath Android Cliffnotes
onActivityCreated() is called when host activity has completed its onCreate() method. onStart() is called once the fragment is ready to be displayed on...
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