当使用react-native-web时,NetInfo在Android和iOS上运行良好,但在web上不起作用。 为了确认web上运行的代码与Android相同,我在控制台上登录componentDidMount,Android和Web都会显示文本。然而,这些事件似乎不适用于web版本。 // src/App.js
import React from 'react';
import { Provider } from 'react-redux';
import store from './utilities/storage/store';
我有一个反应-本地应用程序,使用博览会。位置权限在android上工作,但在iOS上不起作用。在真正的iPhone (iOS 14.4.2版)上,它什么也不做。在模拟器上,我得到以下错误消息:
未处理的承诺拒绝:错误:执行此操作需要LOCATION_FOREGROUND权限。在node_modules/react-native/Libraries/BatchedBridge/NativeModules.js:103:50 in promiseMethodWrapper at node_modules/@unimodules/react-native-adapter/build/NativeMo
我使用的是react-native。我想在iOS模拟器上运行我的项目。在我第一次运行下面的代码时,一切工作正常。
sudo react-native run-ios --simulator "iPhone XR"
当我在模拟器上卸载我的项目后,上面的代码不起作用,我的项目也不显示(我的项目的图标不会出现在模拟器上)。
我的解决方案:
> I restarted the simulator.
> turn off and turn on simulator.
> sudo rm -rf ios/build;
> sudo react-native run
在iOS链接阶段,我开始看到的错误。
React原生版本:0.41.2、0.40、0.39
所有操作都很好,我编辑了Android版本,响应本地代码没有改变,当这种链接错误开始显示时,没有找到/node_modules/react-native/React/Base/{RCTHeaderName.h}路径上的标题:
In file included from /Users/user/ReactNativeProject/node_modules/react-native-vector-icons/RNVectorIconsManager/RNVectorIconsManager.h: