Skip to content Skip to sidebar Skip to footer

"RNCSafeAreaView" Was Not Found In The UIManager

I try to open a bundle, but when the android is running it shows the next message 2020-01-05 23:15:45.366 26210-26210/com.note.principal W/.note.principa: Accessing hidden fiel

Solution 1:

I encountered the same error. In order to solve it make sure to install react-native-safe-area-context.

npm install react-native-safe-area-context

Then if you are using React Native 0.61.X make sure to do a pod install. It will link everything together.

If you are using React Native < 0.6 then you need to do the linking manually with react-native link react-native-safe-area-context


Solution 2:

I was searched and found the next,

first, you need to clean the project

Second import modules at project

include ':app'
rootProject.name='Notes'


include ':hermes-engine'
project(':hermes-engine').projectDir = new File(rootProject.projectDir, '../node_modules/hermes-engine/android/')

include ':react-native-gesture-handler'
project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android')

include ':react-native-linear-gradient'
project(':react-native-linear-gradient').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-linear-gradient/android')

include ':react-native-linear-gradient'
project(':react-native-linear-gradient').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-linear-gradient/android')

include ':react-native-safe-area-context'
project(':react-native-safe-area-context').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-safe-area-context/android')

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation "com.facebook.react:react-native:+"
    implementation 'com.android.support:support-annotations:27.1.1'
    implementation project(':react-native-gesture-handler')
    implementation project(':react-native-linear-gradient')
    implementation project(':react-native-safe-area-context')

    if (enableHermes) {
        implementation project(':hermes-engine')
        debugImplementation files(hermesPath + "hermes-debug.aar")
        releaseImplementation files(hermesPath + "hermes-release.aar")
    } else {
        implementation jscFlavor
    }
}


 override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        SoLoader.init(this, false)
        mReactRootView = ReactRootView(this)
        mReactInstanceManager = ReactInstanceManager.builder()
            .setApplication(application)
            .setCurrentActivity(this)
            .setApplication(application)
            .setBundleAssetName("index.android.bundle")
            .addPackage(MainReactPackage())
            .addPackage(RNGestureHandlerPackage())
            .addPackage(LinearGradientPackage())
            .addPackage(SafeAreaContextPackage())
            .addPackage(SDKCorePackage())
            .setInitialLifecycleState(LifecycleState.RESUMED)
            .build()
        // The string here (e.g. "MyReactNativeApp") has to match
        // the string in AppRegistry.registerComponent() in index.js
        mReactRootView.startReactApplication(mReactInstanceManager, "Notes", null)

        setContentView(mReactRootView)

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
            if (!Settings.canDrawOverlays(this)) {
                val intent = Intent(
                        Settings.ACTION_MANAGE_OVERLAY_PERMISSION,
                        Uri.parse("package:$packageName")
                )
                startActivityForResult(intent, OVERLAY_PERMISSION_REQ_CODE)
            }
        }
    }

i will hope that it will be useful, also this link helped me

react-native-safe-area-context


Solution 3:

Below worked for me :

  1. npm install react-native-safe-area-context
  2. react-native link react-native-safe-area-context
  3. List item
  4. inside android gradlew clean
  5. npm start
  6. npm run android

Solution 4:

In case you are NOT using ReactRootView (integrating existing apps to react-native)...

You probably still need to add your package (packages which don't support autolinking yet, i.e., the new safe-area-view, for instance) to MainApplication.java:

android/app/src/main/.../MainApplication.java

On top, where imports are:

import com.th3rdwave.safeareacontext.SafeAreaContextPackage;

Add the SafeAreaContextPackage class to your list of exported packages.

@Override
protected List<ReactPackage> getPackages() {
    return Arrays.asList(
            new MainReactPackage(),
            /**other packages of yours**/
            new SafeAreaContextPackage()
    );
}

Solution 5:

Worked for me for below version and on iOS

"react": "16.9.0",
 "react-native": "0.61.5",

Step to resolve

-Stop the current running Metro Bundler

-install pod for ios

-try re-run the application

Hope this will help !


Post a Comment for ""RNCSafeAreaView" Was Not Found In The UIManager"