标签: react-native-ios

React Native Version Mismatch

在初始化新项目然后启动x-code模拟器时获取以下消息."React-Native Version Mismatch"Javascript版本0.50.1原生版本:0.50.0

确保您已重建本机代码...

有谁知道这里发生了什么,可以帮助我吗?

谢谢!

在此输入图像描述

react-native react-native-android react-native-ios

166
推荐指数
11
解决办法
9万
查看次数

`react-native run-ios`返回错误:找不到iPhone X模拟器

每当我跑步时react-native run-ios,我都会

Could not find iPhone X simulator

Error: Could not find iPhone X simulator
    at resolve (calendarPractice/node_modules/react-native/local-cli/runIOS/runIOS.js:149:13)
    at new Promise (<anonymous>)
    at runOnSimulator (calendarPractice/node_modules/react-native/local-cli/runIOS/runIOS.js:134:10)
    at Object.runIOS [as func] (calendarPractice/node_modules/react-native/local-cli/runIOS/runIOS.js:106:12)
    at Promise.resolve.then (calendarPractice/node_modules/react-native/local-cli/cliEntry.js:117:22)
Run Code Online (Sandbox Code Playgroud)

但是,当我在Xcode上运行时,它工作正常

{
  "devicetypes" : [
    {
      "name" : "iPhone 4s",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/iPhone 4s.simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-4s"
    },
    {
      "name" : "iPhone 5",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/iPhone 5.simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-5"
    },
    {
      "name" : "iPhone 5s",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/iPhone 5s.simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-5s"
    },
    { …
Run Code Online (Sandbox Code Playgroud)

ios-simulator react-native react-native-ios

101
推荐指数
13
解决办法
5万
查看次数

找不到"React/RCTBridgeModule.h"文件

在xcode上构建反应原生的iOS应用程序时出现此错误.

在此输入图像描述

在npm install和rpm链接react-native-fs库之后开始出现此错误.但在网上搜索解决方案之后,我注意到许多人在安装其他反应本机库时遇到了同样的错误.

一个可能的解决方案,许多建议是,添加在"生成设置"下面- >"头搜索路径".

$(SRCROOT)/../node_modules/react-native/React - (递归)

但是这个解决方案没有运气,仍然得到同样的错误

xcode native ios reactjs react-native-ios

94
推荐指数
4
解决办法
8万
查看次数

找不到“event2/event-config.h”文件

我正在尝试在 iOS 中构建一个 react-native 应用程序,但不幸的是遇到了以下问题(指的是 libevent/Flipper):

'event2/event-config.h' file not found

我有 react-native v0.63.4 并且我已经使用react-native link并运行了这些包pod update。我也删除了我的Podfile.lockpod install再次运行。

我的猜测是这与 Flipper 版本有关?当我use_flipper!在我的 Podfile 中注释掉并构建时,它可以工作。

关于如何解决这个问题的任何想法?

react-native react-native-ios

91
推荐指数
8
解决办法
4万
查看次数

Xcode 抛出“atomic_notify_one&lt;unsigned long&gt;”不可用

我在 Mac 上安装了 Xcode 12,尝试构建在 android 上完美运行的 React Native 应用程序,并获得'atomic_notify_one<unsigned long>' is unavailable. 这是我从错误中获得的最多信息。

react-native react-native-ios xcode12beta6

83
推荐指数
11
解决办法
3万
查看次数

如何在React Native项目中重新生成ios文件夹?

不久前我在我的本机应用程序中删除了/ ios目录(让我们称之为X).我一直在开发和测试使用Android模拟器,但现在我想确保它适用于ios与xcode模拟器等.

所以我目前的想法是用ios文件夹创建一个新的反应原生裸项目(让我们称之为Y),然后按照这些步骤重命名Y,使其名称为X,然后将/ ios目录从Y移动到X和试图run-ios.

我会在这里更新一下,但我想知道是否有更好的方法并且之前没有人遇到过这种情况?

我已经google了很多东西'重新生成ios文件夹''删除了ios文件夹''将ios文件夹添加到现有文件中'并且没有任何帮助.也许我的googlefu不够好,但如果有人有任何建议,非常感谢.

第2步将确保它由于依赖和东西而编译,但是现在我的目标是在项目中恢复/ ios文件夹,并让React Native知道它的存在(它具有所有必要的配置).

谢谢

xcode ios react-native react-native-ios

62
推荐指数
4
解决办法
7万
查看次数

收到此错误:错误:捆绑失败:错误:无法解析模块“react-native-safe-area-context”

运行我的应用程序后出现此错误:

错误:捆绑失败:错误:无法react-native-safe-area-contextnode_modules/react-navigation-stack/lib/module/vendor/views/Stack/StackView.js以下位置解析模块:在项目中找不到 react-native-safe-area-context。

但是我为我的旧演示所做的同样的事情。它工作得很好。

我不知道我在这里做错了什么。请检查我的代码:

用于安装:

  1. 反应本机导航和手势处理程序:

npm install --save react-navigation

npm install --save react-native-gesture-handler

  1. 反应原生堆栈:

npm install --save react-navigation-stack

应用程序.js

import { createAppContainer } from "react-navigation";
import { createStackNavigator } from "react-navigation-stack";
import FirstOptionsPage from "./FirstOptionsPage";

const MainNavigator = createStackNavigator(
  {
    FirstOptions: FirstOptionsPage
  },
  {
    defaultNavigationOptions: {
      headerStyle: {
        // backgroundColor: '#28F1A6',
        elevation: 0,
        shadowOpacity: 0
      },
      headerTintColor: "#ca375e",
      headerTitleStyle: {
        fontWeight: "bold",
        color: "#161616"
      }
    }
  }
);

const App = createAppContainer(MainNavigator); // For …
Run Code Online (Sandbox Code Playgroud)

react-native react-native-android react-native-ios react-native-navigation

59
推荐指数
6
解决办法
7万
查看次数

如何启动和打开电子邮件客户端React-native?

我不想撰写电子邮件.我只是希望能够从反应原生的应用程序在用户的设备(iOS和Android)上启动主电子邮件应用程序.

场景:我会在注册时向用户发送验证电子邮件.

react-native react-native-android react-native-ios

42
推荐指数
6
解决办法
3万
查看次数

错误:EMFILE:打开的文件太多 - React Native CLI

我尝试使用 react-native start 运行 react-native-cli 项目,但是 Metro bundler 失败了,说如下:

events.js 187
throw er; //Unhandled 'error' event

Error: EMFILE: too many open files, watch

Emitted 'error' event on NodeWatcher isntance at:
     at NodeWatcher: checkedEmitError (.../react-native-project/node_modules/sane/src/node_watcher.js:143:12)
     at FSWatcher.emit (events.js:210:5)
     at FSEvent.FSWatcher:_handle onchange (internal/fs/watchers.js:129:12) {
   errno: -24,
   syscall: 'watch',
   code : 'EMFILE',
   filename: null
)
Process terminated. Press <enter> to close the window
Run Code Online (Sandbox Code Playgroud)

react-native react-native-ios

31
推荐指数
9
解决办法
3万
查看次数

不推荐使用componentWillMount,它将在React Native的下一个主要版本0.54.0中删除

我使用的是本机最新版本的0.54.0和每当在iOS上运行应用程序时,发现有关弃用生命周期方法的警告.还请更新组件.

警告 :

不推荐使用componentWillMount,将在下一个主要版本中删除它.请改用componentDidMount.作为临时解决方法,您可以重命名为UNSAFE_componentWillMount.请更新以下组件:容器,文本,TouchableOpacity,Transitioner,View

我也根据waring添加前缀UNSAFE_的每个方法进行更改.

UNSAFE_componentDidMount() {
}
UNSAFE_componentWillMount() {
}
UNSAFE_componentWillUpdate(nextProps, nextState) {
}
UNSAFE_componentWillReceiveProps(nextProps) {
}
Run Code Online (Sandbox Code Playgroud)

虽然警告仍在继续.请帮我.

目前我在我的应用程序中隐藏了YellowBox waring.

import { YellowBox } from 'react-native';

render() {

  YellowBox.ignoreWarnings([
    'Warning: componentWillMount is deprecated',
    'Warning: componentWillReceiveProps is deprecated',
  ]);
}
Run Code Online (Sandbox Code Playgroud)

react-native react-native-android react-native-ios

29
推荐指数
3
解决办法
4万
查看次数