Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all 28482 articles
Browse latest View live

react native shows Error: AndroidManifest.xml doesn't exist or has incorrect root tag

$
0
0

When I run MainActivity.java on Android Studio, it just shows Error: AndroidManifest.xml doesn't exist or has incorrect root tag

can anyone tell me how to resolve it?

enter image description here


Could not sign in Google account on android emulator with react-native app

$
0
0

I have react-native app, and it works thru Google account. And when i launch my app on android emulator i can not sign in Google account. Get an error: "There was a problem communicating with Google servers. Try again later".My steps to reproduction:

  • Reinstalled app and android emulator.
  • Cleaned app and emulator cache.
  • Checked different emulators model with different API.
  • Tried to sign in Google account in android emulator from google chrome, from Settings => Accounts => Add Account => Google.

And all this steps is not working for me. Every time the same situation: the process of loading, spinner is launching about a minute, and after get an error: "Could not sign in". Can somebody help me please.

enter image description here

React Native Expo - cannot send requests on Android, but can on iPhone

$
0
0
  1. SDK Version: 36
  2. Platforms: Android

Hello -

I've been working with expo for some time now, but only using it to build iOS apps.

A current project has a working iOS app that can make requests to my local and production servers. I also have it deployed on iTunes where it works as intended.

I want to have this application on Android as well. The issue I am having is that I cannot make requests to the backend. The same actions working on iOS don't make it to my server on Android.

The error I am receiving after trying a request on the Android emulator is -

TypeError: Network request failed    at XMLHttpRequest.xhr.onerror (fetch.umd.js:473)    at XMLHttpRequest.dispatchEvent (event-target-shim.js:818)    at XMLHttpRequest.setReadyState (XMLHttpRequest.js:574)    at XMLHttpRequest.__didCompleteResponse (XMLHttpRequest.js:388)    at XMLHttpRequest.js:501    at RCTDeviceEventEmitter.emit (EventEmitter.js:189)    at MessageQueue.__callFunction (MessageQueue.js:436)    at MessageQueue.js:111    at MessageQueue.__guard (MessageQueue.js:384)    at MessageQueue.callFunctionReturnFlushedQueue (MessageQueue.js:110)

I am hoping I am missing something easy, and any help would be appreciated. I am currently using Android Studio for the emulator.

How do I find the source of Android/Gradle "out of memory" errors?

$
0
0

I'm trying to get a React Native app to build, using Detox for e2e testing, and am getting java.lang.OutOfMemoryError (no error message). The app builds fine if Detox is out of the equation. I'm on a macbook pro w/ 16GB RAM.

  • multiDex is enabled
  • javaMaxHeapSize is 16g in my app build.gradle
  • I have JVM_ARGS="-Xmx2048m -XX:MaxPermSize=512m" in my shell

I'm new to Android, and the only documentation I can find about memory leaks assumes you're able to build the app and profile it.

How do I call a component in another file? React Native

$
0
0

I am new to React Native and I am confused about how to call a specific component function ('runDemo' in SQLData.js) in another file in order to get the data that I will then push into another component file to display. I am trying to keep my code as clean and understandable as possible so I am trying to split codes into separate files without cluttering.

The flow of my code is: Apps.js gets data from SQLData.js and sends it as a prop to FlatList.js which will then render it.

The results of my files below is throwing an "Invariant Violation. Tried to get frame for index out of range index NaN"

These are the 3 files below:

Apps.js - main file

import React from 'react';import CustomList from './components/FlatList';import SQLData from './components/SQLData';export default function App() {  return(    //Not too sure if this is the correct way!    var database = <SQLData /><CustomList data={database}/>  );};

FlatList.js - Used to return the Flatlist with data

import React, {useState} from 'react';...import ListItem from './ListItem';/** * Handles the FlatList structure. */export default function CustomList(props) {    //Sets up Getter , Setter , Initial Data    const [data, setData] = useState(props.data);    ...    //This is UI that will be returned    return(        //div block<View style = {styles.contentContainer}><FlatList                ListHeaderComponent = {header}                //Sets the data for FlatList                data = {data}                keyExtractor = { (item) => (item.id).toString()}                //Takes each item from the database and separates them into separate div and applies style to each one                ItemSeparatorComponent = { () => <View style={styles.itemSeparator}></View>}                contentContainerStyle={ {borderBottomColor:'grey', borderBottomWidth: 1} }                //Gets item and index pair and creates a ListItem with those as props                renderItem = { ({item, index}) => <ListItem item={item} index={index}/>}            /></View>    );};

SQLData.js - Used to read Data from local db file

import React, { useState } from 'react';import SQLite from 'react-native-sqlite-storage';...export default function importData(props) {  const [helperArray, setArray] = useState([]);  /** 1. First function to be called **/  function runDemo() {    loadAndQueryDB();  }  /** 2. Called when runDemo is called **/  /*   assigns variable 'db' to opened Database */  /*   Calls queryPeople(db) */  function loadAndQueryDB() {    db = SQLite.openDatabase({name : "users.db"}, openCB, errorCB);    queryPeople(db);  }  /** 3. Called when loadAndQueryDB is called **/  /*    Get the DB and applies a SQL call that if successful will call queryEmployeesSuccess*/  function queryEmployees(db) {    ...  }  /** 4.  [SUCCESS] Called when queryEmployees SQL execution is successful **/  /*      results - a ResultSet object */  function queryEmployeesSuccess(tx, results) {    var len = results.rows.length;    let localArray = [];    //Go through each item in dataset    for (let i = 0; i < len; i++) {      let row = results.rows.item(i);      localArray.push(row);    }    setArray(localArray);  }  return ({helperArray});};

Get value from Picker onValueChange in react-native

$
0
0

I am developing an app using react native.Already I have implemented a list of user data. One example of data is this.

UID234 {"name":"Chris","age":31,"traits":{"eyes":"blue","shoe_size":10}}

Here's my code.


import RNPickerSelect from 'react-native-picker-select';...<RNPickerSelect     onValueChange={(value) => console.log(value)} // そのユーザーのvalueを取る     // {console.log(to_user)}    items={[      { label: 'Chris', value: 'UID234' },      { label: 'Marge', value: 'UID345' },      { label: 'Yuri', value: 'UID456' }            ]}     style={pickerSelectStyles}     placeholder={{ label: '選択してください', value: '' }}     />

In this case, when I select Chris, I can see "UID234" is shown on the console.

What I want to do is to print "Chris" on the screen.How can I do that? Please help me...

React-native android "Program type already present: com.reactnativecommunity.asyncstorage.AsyncLocalStorageUtil"

$
0
0

We just upgrade a package and this happens. It works in the IOS part but not on the android part. I tried excluding this class but no avail is there any way to diss able this class from a package? I search for same issue but no avail I tried to rollback but we have changes that need the new package

app/build.gradle

    apply plugin: "com.android.application"apply from: project(':react-native-config').projectDir.getPath() +"/dotenv.gradle"import com.android.build.OutputFileproject.ext.react = [    entryFile: "index.js",    enableHermes: false,  // clean and rebuild if changing]apply from: "../../node_modules/react-native/react.gradle"def enableHermes = project.ext.react.get("enableHermes", false);android {    compileSdkVersion rootProject.ext.compileSdkVersion    compileOptions {        sourceCompatibility JavaVersion.VERSION_1_8        targetCompatibility JavaVersion.VERSION_1_8    }    defaultConfig {        applicationId "com.ginko.ginko"        minSdkVersion rootProject.ext.minSdkVersion        targetSdkVersion rootProject.ext.targetSdkVersion        versionCode 1        versionName "1.0"        multiDexEnabled true        missingDimensionStrategy 'react-native-camera', 'general'    }    splits {        abi {            reset()            enable enableSeparateBuildPerCPUArchitecture            universalApk false  // If true, also generate a universal APK            include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"        }    }    signingConfigs {        debug {            storeFile file('debug.keystore')            storePassword 'android'            keyAlias 'androiddebugkey'            keyPassword 'android'        }        release {            if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {                storeFile file(MYAPP_UPLOAD_STORE_FILE)                storePassword MYAPP_UPLOAD_STORE_PASSWORD                keyAlias MYAPP_UPLOAD_KEY_ALIAS                keyPassword MYAPP_UPLOAD_KEY_PASSWORD            }        }    }    buildTypes {        debug {            signingConfig signingConfigs.debug        }        release {            // Caution! In production, you need to generate your own keystore file.            // see https://facebook.github.io/react-native/docs/signed-apk-android.            signingConfig signingConfigs.release            minifyEnabled enableProguardInReleaseBuilds            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"            // signingConfig signingConfigs.release        }    }    // applicationVariants are e.g. debug, release    applicationVariants.all { variant ->        variant.outputs.each { output ->            // For each separate APK per architecture, set a unique version code as described here:            // https://developer.android.com/studio/build/configure-apk-splits.html            def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]            def abi = output.getFilter(OutputFile.ABI)            if (abi != null) {  // null for the universal-debug, universal-release variants                output.versionCodeOverride =                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode            }        }    }}dependencies {    compile(project(':react-native-nearby-api')) {         exclude group: 'com.google.android.gms'    }    implementation project(':react-native-contacts')    implementation (project(':@react-native-community_async-storage')){        exclude group: 'com.reactnativecommunity.asyncstorage.AsyncStorageErrorUtil'    }    implementation (project(":react-native-device-info"))    implementation project(':@react-native-community_geolocation')    implementation project(':react-native-permissions')    implementation project(':react-native-camera')    implementation (project(':react-native-ble-plx')){        exclude group: 'com.reactnativecommunity.asyncstorage.AsyncStorageErrorUtil'    }    implementation project(':react-native-linear-gradient')    implementation fileTree(dir: "libs", include: ["*.jar"])    implementation "com.facebook.react:react-native:+"  // From node_modules    implementation 'androidx.appcompat:appcompat:1.1.0-rc01' // for react-native-screens    implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha02' // for react-native-screens    // implementation project(':WebRTCModule')    implementation 'com.google.android.gms:play-services-nearby:17.0.0'    if (enableHermes) {        def hermesPath = "../../node_modules/hermes-engine/android/";        debugImplementation files(hermesPath +"hermes-debug.aar")        releaseImplementation files(hermesPath +"hermes-release.aar")    } else {        implementation jscFlavor    }}// Run this once to be able to run the application with BUCK// puts all compile dependencies into folder libs for BUCK to usetask copyDownloadableDepsToLibs(type: Copy) {    from configurations.compile    into 'libs'}apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"apply plugin: 'com.google.gms.google-services'// googleServices { disableVersionCheck = true }

Expo - LocationTaskService.java NullPointerException on Intent.getExtras()

$
0
0

Creating an Expo app and have it run a sticky notification, results in a NullPointerException after 15-60 minutes.

Here is the RN code

//backgroundTasks.jsimport {Permissions} from 'react-native-unimodules';import * as Location from 'expo-location';import * as TaskManager from "expo-task-manager";import {getStore} from "../redux/configureStore";import {newLocation} from "../redux/actions/device";import {Log} from "./log";import {Colors} from "./style/colors";import * as db from '../utils/db';import {getTranslator, secondsToInterval} from "./functions";import {showAlert} from "../redux/actions/app";import {APP} from "../redux/constants/app";import {setIgnoreState} from "./state";export const BG_TRACKING = 'BG_TRACKING';Log.info(`Unregister all tasks`);TaskManager.unregisterAllTasksAsync().then(() => {    Log.info(`Defined new background task ${BG_TRACKING}`);    TaskManager.defineTask(BG_TRACKING, async ({ data: { locations }, error }) => {        if(error) {            Log.error('Error received for locations', error);        } else {            locations.forEach(l => getStore().dispatch(newLocation(l)));        }    });});export const unregister = async () => {    if(await Location.hasStartedLocationUpdatesAsync(BG_TRACKING)) {        await Location.stopLocationUpdatesAsync(BG_TRACKING);    }};let permissionIndicationOpen = false;export const register = async () => {    let user = getStore().getState().get(APP).get('currentUser');    if(!user) return;    let permissionState = await Permissions.getAsync(Permissions.LOCATION);    if(!permissionState.granted || permissionState.canAskAgain) {        if(permissionIndicationOpen) return;        permissionIndicationOpen = true;        setIgnoreState(true);        permissionState = await Permissions.askAsync(Permissions.LOCATION);        setIgnoreState(false);        if(permissionState.granted) {            permissionIndicationOpen = false;        } else {            const t = await getTranslator();            getStore().dispatch(showAlert(t('needPermission'), t('locationPermissionNeeded'), {                onConfirm: () => {                    permissionIndicationOpen = false;                    register()                }            }));        }    }    const start = async () => {        const t = await getTranslator();        try {            Log.info(`Registering background task ${BG_TRACKING}`);            let trackingInterval = await db.getValue('trackingInterval');            if (!trackingInterval) return;            let interval = +trackingInterval;            if (interval < 0) interval = 60 * 60 //every hour, but it will be ignored by the server;            await unregister();            await Location.startLocationUpdatesAsync(BG_TRACKING, {                accuracy: Location.Accuracy.Highest,                timeInterval: interval * 1000,                foregroundService: {                    notificationBody: +trackingInterval > 0 ? t('yourPositionIsBeingMonitored', {                        period: secondsToInterval(t, interval)                    }) : t('positionSentOnlyOnAlarm'),                    notificationColor: Colors.primary                }            });            Log.info(`Successfully registered background task ${BG_TRACKING}`);        } catch (e) {            Log.error(`Failed registering background task ${BG_TRACKING}`);            Log.error(e);        }    };    await start();};

This file is called in the index.js, the entry point.

Then I see this stacktrace in Crashlytics.

Fatal Exception: java.lang.RuntimeException: Unable to start service expo.modules.location.services.LocationTaskService@97ff6c3 with null: java.lang.NullPointerException: Attempt to invoke virtual method 'android.os.Bundle android.content.Intent.getExtras()' on a null object reference       at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4222)       at android.app.ActivityThread.access$2100(ActivityThread.java:231)       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1984)       at android.os.Handler.dispatchMessage(Handler.java:107)       at android.os.Looper.loop(Looper.java:214)       at android.app.ActivityThread.main(ActivityThread.java:7682)       at java.lang.reflect.Method.invoke(Method.java)       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)

Why won't expo-updates provide checkForUpdateAsync?

$
0
0

When I transitioned to Expo's Managed Workflow (SDK 37 and now 38 as well), in-app update checking broke.

My code:

import * as Updates from 'expo-updates';async checkForUpdate() {    const update = await Updates.checkForUpdateAsync();    if (update.isAvailable) {        this.updateApp();    }}async updateApp() {    await Updates.fetchUpdateAsync();    Updates.reloadAsync();}

Logcat shows me that the checkForUpdateAsync() promise is being rejected with this message:

Error: The method or property Updates.checkForUpdateAsync is not available on android, are you sure you’ve linked all the native dependencies properly?

For the record I did install it via expo install expo-updates

Thanks.

React Native with Custom Native Module ``` Module HMRClient is not a registered callable module ```

$
0
0

I've developed a custom native module for React Native using create-react-native-module.

I've installed it as per the documentation. But when I try to use the custom module in my main project, I get the error Module HMRClient is not a registered callable module. The main project works fine when the custom module is not called from it.

I've tried all the common fixes like uninstalling node_modules, cleaning gradle, disabling hot reloading, restarting the server, restarting the emulator, restarting the computer, and all the other fixes which are linked with the error but none worked.

If I try to dismiss the error, I get Module RCTEventEmitter is not a registered callable module which reappears when I try to dismiss it.

These one and two are two similar questions which aren't answered as well.

Failed to read native JSON Data

$
0
0

I am trying to build an old project using Android studio but the process fails. The error message I get is this:

Error:Failed to read native JSON data Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $

I get a more detailed error message in the Build tab:enter image description here

I believe that the build.gradle file of the app, is responsible for the error. The code of the file is:

apply plugin: 'com.android.application'android {compileSdkVersion 25buildToolsVersion "25.0.3"defaultConfig {    applicationId "com.example.despoina.ldtest"    minSdkVersion 15    targetSdkVersion 25    versionCode 1    versionName "1.0"    ndk {        abiFilters 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'    }    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"    externalNativeBuild {        cmake {            arguments '-DANDROID_PLATFORM=android-13','-DANDROID_TOOLCHAIN=clang', '-DANDROID_STL=gnustl_static'        }    }}buildTypes {    release {        minifyEnabled false        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'    }}sourceSets {    main {        // let gradle pack the shared library into apk        jniLibs.srcDirs += ['../gen-libs/gmp']        jniLibs.srcDirs += ['../distribution/ecc/lib']        jniLibs.srcDirs += ['../distribution/smodbus/lib']        resources.includes = [ 'res/parameters.txt' ]    }}externalNativeBuild {    cmake {        path 'src/main/cpp/CMakeLists.txt'    }}}dependencies {    implementation fileTree(include: ['*.jar'], dir: 'libs')    implementation 'com.android.support:appcompat-v7:25.2.0'    implementation 'com.android.support.constraint:constraint-layout:1.0.1'    // uncomment out this one to generate lib binaries,    // and also uncommented out the one in settings.gradle    // after lib is generated, just comment them out again    //implementation project(':gen-libs')}

Any help will be appreciated!!

How can i upload multipart file in react-native?

$
0
0

i'm trying uploading multipart file to backend server using axios in react-native. I'm setting image using array, but i don't know how to transform object Object to object File. back-end server needs File type. How can i do??

expect log: [object File],

result log: [object Object]

My front code is here

//...//   interface ImageFile {   uri: string;   name: string;   type: string;}   const [images, setImages] = useState([] as ImageFile[]);//. using image picker.//   ImagePicker.showImagePicker(options, async (response) => {     if (response.didCancel) {       return;     }     else if (response.error) {       Alert.alert('에러: '+ response.error);     }     else {       //이미지가무사히선택된것       //기존에있던이미지에더해서배열을더해나감       // console.log(response.data);       setImages([...images, { uri: response.uri, name: response.fileName, type: response.type }]);     }     console.log(images);//post code//  async function toPost() {   let post: Post;   try {     post = await Post.create({ content: comment } as Post);   } catch (e) {     console.log(e);     console.log('포스트생성불가')     return;   }   try {     let a = 0     for (let image of images) {       console.log('image[0]: '+ JSON.stringify(image))       console.log('image[1]: '+ image.type)       console.log('test: '+ test)       await post.createMedia(test, 'IMAGE');       a++;     }   } catch (e) {     console.log(e.response.data);     console.log('이미지생성불가')     return;   }   try {     post.status = 'PUBLIC';     await post.save();   } catch (e) {     console.log(e);     console.log('포스트저장불가');     return;   }   console.log(`저장된글: ${post.content}, 이미지개수: ${post.medias.length}`) }

and my api Code

public async createMedia(file, type: PostMediaType) {    const formData = new FormData();    formData.append('file', { uri: file.uri, name: file.name, type: file.type } as File);    const postMedia = new PostMedia((      await getAxios().post(`/posts/${this.id}/${type}s`, formData, { headers: { 'Content-Type': 'multipart/form-data' } })).data);    if (!this.medias) this.medias = await this.getMedias();    else this.medias.push(postMedia);    return postMedia;  }

Space coming on Top when using ScrollView

Migrate Android app from Native to React Native

$
0
0

I'm currently working on an android app that's based on Java with Firebase in the backend. Is there any way to migrate to React Native without building it from scratch?

ExpoInAppPurchases: No virtual method setOldSku(Ljava/lang/String;)Lcom/android/billingclient

$
0
0

Relating to the npm package expo-in-app-purchases

purchaseAsync (imported from expo-in-app-purchases) is working fine on iOS.

On Android, when calling that, I get error code:

[Error: Encountered an exception while calling native method: Exception occurred while executing exported method purchaseItemAsync on module ExpoInAppPurchases: No virtual method setOldSku(Ljava/lang/String;)Lcom/android/billingclient/api/BillingFlowParams$Builder; in class Lcom/android/billingclient/api/BillingFlowParams$Builder; or its super classes (declaration of ‘com.android.billingclient.api.BillingFlowParams$Builder’ appears in /data/app/com.APPNAME

Any advice would be welcome.

Thanks!


How to convert android existing app to react-native android

$
0
0

I have developed an android app with code, i want to convert to react native android. is this possible to convert an existing android app to react native?

React native Modal, avoid resizing View when keyboard is opened (Android)

$
0
0

I'm using a react-native Modal, which contains a View.The View has some TextInput elements. When the keyboard pops up, the View elements all collapse to fit into the remaining space, but I don't want the View to change at all.

This does not happen for IOS. And also, it does not happen in non-modal Views for Android within the same app.

I have windowSoftInputMode="adjustPan" set in my android Manifest, but it doesn't seem to be applied on the Modal.

return( <ImageBackground source={require('./../images/IMG1.png')}        style={{flex: 1}} imageStyle={{resizeMode: 'cover'}}><View style={{flex: 1}}>     (...)<Modal visible={this.state.modalVisible} animationType={'slide'}         presentationStyle={'fullScreen'}        onRequestClose={() => this.closeModal()}><ImageBackground source={require('./../images/IMG2.png')}          style={{flex: 1}} imageStyle={{resizeMode: 'cover'}}><TouchableWithoutFeedback onPress={Keyboard.dismiss} accessible={false}><View style={{flex:1}}>          (...)<View style={{flex:0.9, alignItems:'center', justifyContent: 'center',                                                   flexDirection: 'row'}}><TextInput style={MyStyle.textInput}                onChangeText={(myTitle) => this.setState({myTitle})}                placeholder='Title'            /></View>

How to make a circular button in android using react-native's TouchableNativeFeedback?

$
0
0

With TouchableHighlight, I can easily make circular buttons using width, height, and borderRadius style properties.

However, borderRadius seems to be having no effect at all for TouchableNativeFeedback

I have tried wrapping the TouchableNativeFeedback element in a view with a borderRadius and overflow: 'hidden', but to no avail.

Would be glad to get some help here. Thanks.

React native app firebase crash report on splashscreen

$
0
0

Getting this crash quite often on firebase crashlytics.

Versions I'm consuming in my project:

"react": "16.8.6",

"react-native": "0.60.5",

"react-native-splash-screen": "3.2.0",

Fatal Exception: java.lang.NoClassDefFoundErrororg.devio.rn.splashscreen.fcom.facebook.react.PackageList.getPackages (PackageList.java)com.ingoibibo.MainApplication$1.getPackages (MainApplication.java)com.facebook.react.ReactNativeHost.createReactInstanceManager (ReactNativeHost.java)com.facebook.react.ReactNativeHost.getReactInstanceManager (ReactNativeHost.java)com.facebook.react.HeadlessJsTaskService.access$000 (HeadlessJsTaskService.java)com.facebook.react.HeadlessJsTaskService.onStartCommand (HeadlessJsTaskService.java)android.app.ActivityThread.handleServiceArgs (ActivityThread.java:2983)android.app.ActivityThread.access$2200 (ActivityThread.java:172)android.app.ActivityThread$H.handleMessage (ActivityThread.java:1405)android.os.Handler.dispatchMessage (Handler.java:102)android.os.Looper.loop (Looper.java:146)android.app.ActivityThread.main (ActivityThread.java:5653)java.lang.reflect.Method.invokeNative (Method.java)java.lang.reflect.Method.invoke (Method.java:515)com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1291)com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1107)dalvik.system.NativeStart.main (NativeStart.java)

Unable to understand the cause of it. Let me know if anybody can help.

Expo Cli - Invariant Violation: requireNativeComponent: "RNCSafeAreaProvider" was not found in the UIManager

$
0
0

I faced this issue with the expo client. The project is working on both iOS simulator and Android emulator. But the issue arise when I use expo app on the actual device.

I ran expo start and it gave me a QR code to scan, which I scanned from my device. Which displayed this error.

If I replace the Drawer navigator with just home component without react-navigation it works. The problem arises when I return <Navigator /> in my App.tsx.

import React from 'react';import Navigator from 'navigations';import {YellowBox, View, Text, SafeAreaView} from 'react-native';import {useFonts} from '@use-expo/font';YellowBox.ignoreWarnings(['VirtualizedLists should never ']);const App = () => {  let [fontsLoaded] = useFonts({    Poppins: require('./assets/fonts/Poppins-Regular.ttf'),'Poppins-Bold': require('./assets/fonts/Poppins-Bold.ttf'),'Poppins-Light': require('./assets/fonts/Poppins-Light.ttf'),  });  if (fontsLoaded) {    return (<><Navigator /></>    );  } else {    return (<SafeAreaView><View><Text>Loading</Text></View></SafeAreaView>    );  }};export default App;

enter image description here

This is package.json

"dependencies": {"@expo/vector-icons": "^10.2.0","@react-native-community/masked-view": "^0.1.10","@react-navigation/drawer": "^5.8.2","@react-navigation/material-bottom-tabs": "^5.2.10","@react-navigation/native": "^5.5.1","@react-navigation/stack": "^5.5.1","@types/react-native-snap-carousel": "^3.8.1","@use-expo/font": "^2.0.0","babel-plugin-module-resolver": "^4.0.0","expo": "~37.0.3","expo-font": "^8.1.1","expo-updates": "~0.2.0","intl": "^1.2.5","react": "~16.9.0","react-dom": "~16.9.0","react-native": "~0.61.5","react-native-gesture-handler": "^1.6.1","react-native-paper": "^3.10.1","react-native-reanimated": "^1.9.0","react-native-safe-area-context": "^3.0.3","react-native-screens": "^2.8.0","react-native-snap-carousel": "^3.9.1","react-native-unimodules": "~0.9.0","react-native-web": "~0.11.7"  },"devDependencies": {"@babel/core": "~7.9.0","@types/react": "~16.9.23","@types/react-native": "~0.61.23","babel-preset-expo": "~8.1.0","jest-expo": "~37.0.0","typescript": "~3.8.3"  },
Viewing all 28482 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>