标签: react-native-ios

不推荐使用React-Native Navigator,并且已从此程序包中删除

我收到以下错误.

Navigator已弃用,已从此包中删除.它现在可以从react-native-deprecated-custom-components安装和导入,而不是react-native.在http://facebook.github.io/react-native/docs/navigation.html上了解替代导航解决方案

然后我会更新react-native-deprecated-custom-components包但问题没有解决

的package.json

"dependencies": {
    "react": "16.0.0-alpha.6",
    "react-native": "0.44.2",
    "react-native-deprecated-custom-components": "^0.1.0",
    "sendbird": "^3.0.30"
},
Run Code Online (Sandbox Code Playgroud)

main.js

var React = require('react-native')
var {
  Navigator,
  StyleSheet
} = React;

var Login = require('./components/login');

import NavigationExperimental from 'react-native-deprecated-custom-components';

var ROUTES = {
  login: Login
};

module.exports = React.createClass({
  renderScene: function(route, navigator) {
    var Component = ROUTES[route.name];
    return <Component route={route} navigator={navigator} />;
  },
  render: function() {
    return (

      <NavigationExperimental.Navigator
        style={ styles.container }
        initialRoute={ {name: 'login'} }
        renderScene={this.renderScene}
        configureScene={ () => …
Run Code Online (Sandbox Code Playgroud)

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

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

onRegionChangeComplete 函数使用 React Native 地图多次调用

我想在地图中移动某个位置时更改我的初始区域,为此我使用了 onRegionChangeComplete 功能,但它一次调用两次或三次。

这是我的代码:

onRegionChangeComplete(region) {
    if(!this.state.initialRegionChange){
      console.log("changeRegion:"+JSON.stringify(region))
      var initialRegion = {
        latitude: region.latitude,
        longitude :region.longitude,
        latitudeDelta: LATITUDE_DELTA,
        longitudeDelta: LONGITUDE_DELTA
      }
      var lat = parseFloat(region.latitude)
      var lang = parseFloat(region.longitude)
    }else{
      this.setState({
        initialRegionChange:false
      })
    }
  }

render(){
  return(
    <MapView
          ref="map"
          style={styles.map}
          initialRegion={this.state.region}
          provider={MapView.PROVIDER_DEFAULT}
          zoomEnabled={true}
          onRegionChangeComplete={this.onRegionChangeComplete.bind(this)}
          pitchEnabled={true}
          showsCompass={true}
          showsBuildings={true}
          showsUserLocation={true}
          showsTraffic={true}
          showsIndoors={true}
          />
    )
}
Run Code Online (Sandbox Code Playgroud)

请给我建议如何解决这个问题。

非常感谢任何帮助。

这是我正在关注的模块链接。 https://github.com/react-community/react-native-maps

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

6
推荐指数
2
解决办法
4532
查看次数

如何在 react-native 中播放 SCORM 内容

我试图创建一个简单的 LMS 来在网络中播放 SCORM 内容。解析 SCORM zip 中的清单文件,您可以获得目标文件并将其用作框架中的 src,内容播放和跟踪。

例子

<html>
<head>
    <title>VS SCORM - RTE Frameset</title>
    <!-- Rev 1.0 - Sunday, May 31, 2009 -->
</head>
<frameset 
  frameborder="0" framespacing="0" 
  border="0" rows="0,*" cols="*" >
    <frame src="api.html" name="API" noresize>
    <frame src="../course/course/index.html?type=scorm" name="course">
</frameset>
</html>
Run Code Online (Sandbox Code Playgroud)

这适用于网络应用程序。api.html 包含所有标准的 SCORM 函数,如 LMSInitialize、LMSCommit 等。我试图在 react-native 中玩 SCORM 并创建这些函数。

我曾尝试使用 WebView 和 HTMLView 但没有奏效。

scorm1.2 react-native react-native-android moodle-mobile react-native-ios

6
推荐指数
0
解决办法
1467
查看次数

未找到 GeneratedInfoPlistDotEnv.h 文件

我有一个关于 Xcode 的问题,在 react-native 权限文件中找不到 GeneratedInfoPlistDotEnv.h 文件。

如何解决这个问题?

已经将 Info.plist 预处理器前缀文件更改为

${CONFIGURATION_BUILD_DIR}/GeneratedInfoPlistDotEnv.h 
Run Code Online (Sandbox Code Playgroud)

但它没有解决。

问题是:

:1:10: 致命错误:找不到“/Users/DAMAGE/Library/Developer/Xcode/DerivedData/EmployWise-fzbhiywasjfdjnfqjsfnxjbhahzs/Build/Products/GeneratedInfoPlistDotEnv.h”文件

xcode info.plist react-native-ios

6
推荐指数
1
解决办法
2377
查看次数

xcodebuild:错误:名为“app”的工作区不包含名为“app”的方案

我正在开发一个从 0.59 升级到 0.60 的 React Native 应用程序。我已经整理了 cocoapods,我可以在模拟器中从 Xcode 成功构建和运行应用程序。但是,当我尝试使用运行该应用程序时react-native run-ios --scheme "app"出现错误:

xcodebuild: error: The workspace named "app" does not contain a scheme named "app". The "-list" option can be used to find the names of the schemes in the workspace.
Run Code Online (Sandbox Code Playgroud)

我有一个 app.xcworkspace 文件,我正在 Xcode 中打开它。我在“管理方案”对话框中共享了“应用程序”方案,并将其容器设置为工作区。

Xcode 已创建文件ios/app.xcworkspace/xcshareddata/xcschemes/app.xcscheme.

当我运行时,xcodebuild -workspace app.xcworkspace -list我看到:

Information about workspace "app":
    Schemes:
        app
        app-tvOS
        boost-for-react-native
        DoubleConversion
        Folly
        glog
        Pods-app
        Pods-app-tvOS
        Pods-app-tvOSTests
        Pods-appTests
        React
        React-Core
        ...
Run Code Online (Sandbox Code Playgroud)

以前,该react-native …

xcode xcodebuild cocoapods react-native react-native-ios

6
推荐指数
1
解决办法
1400
查看次数

为什么在更新到 macOS catalina 后立即在 react-native 中出现“Watchman crawl failed”错误?

尝试react-native run-ios从 xcode运行或构建 RN 项目,一旦 Metro bundler 启动,终端中就会出现此错误:

Loading dependency graph...jest-haste-map: Watchman crawl failed. Retrying once with node crawler.
  Usually this happens when watchman isn't running. Create an empty `.watchmanconfig` file in your project's root folder or initialize a git or hg repository in your project.
  Error: Watchman error: resolve_projpath: path `/Users/vorousjames/Desktop/Development/TicTacWHOA/app/TicTacWHOA`: open: /Users/vorousjames/Desktop/Development/TicTacWHOA/app/TicTacWHOA: Operation not permitted. Make sure watchman is running for this project. See https://facebook.github.io/watchman/docs/troubleshooting.html.
events.js:183
      throw er; // Unhandled 'error' event
  ^

Error: resolve_projpath: path …
Run Code Online (Sandbox Code Playgroud)

terminal watchman react-native react-native-android react-native-ios

6
推荐指数
4
解决办法
7274
查看次数

从 v0.61.5 手动升级到 v0.63.3 后如何修复“未找到 ReactCommon/CallInvoker.h 文件”

我不得不手动升级 react-native,因为nix react-native upgrade失败了。

在遵循 v.0.61.5 -> v0.63.3 的升级助手之后,我清理了我的构建文件夹并尝试运行该应用程序,结果构建失败

错误是:

词法或预处理器问题:找不到“ReactCommon/CallInvoker.h”文件 -> NativeToJsBridge.h

为什么会这样?附加环境/文件信息的注释

xcode react-native react-native-ios

6
推荐指数
1
解决办法
2224
查看次数

致命错误:找不到模块映射文件 YogaKit.modulemap

我正在尝试构建一个 iOS 应用程序并收到此错误。我的项目、目标和 podfile 都指定了 14.2 的 iOS 部署目标。我正在使用 Xcode V12.2。

致命错误:模块映射文件 '/Users/USERNAME/Library/Developer/Xcode/DerivedData/APPNAME-hevjyrbzqmxstztjalctjwmbxffm/Build/Products/Debug-iphonesimulator/YogaKit/YogaKit.modulemap' not found 1 错误生成。

当我导航到该目录时,我在那里看不到 YogaKit.modulemap 文件。如何配置构建以将其复制到该目录或以其他方式修复此错误?

我正在打开 .xcworkspace 项目文件。

我已经做了:

rm -rf ~/Library/Developer/Xcode/DerivedData/
pod deintegrate
pod update
Run Code Online (Sandbox Code Playgroud)

这是一个使用 react-native 0.63.3 和 cocoapods v1.10.0 的 expo 裸应用。我正在 Mac Mini M1 上构建。

任何帮助将不胜感激。

ios cocoapods react-native react-native-ios expo

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

由于 NSInternalInconsistencyException 导致 React-Native 应用程序终止 - “在创建 JS 线程之前不得调用此方法”

我想在我的 iPhone 上以调试模式运行我的 React-Native 应用程序。如果在发行版中运行它,则没有问题,它运行得很好。

当我尝试在调试中运行它时,它首先看起来很好并构建了应用程序。正如预期的那样,它然后安装到我的 iPhone 并启动它。我可以看到加载屏幕,但应用程序无法完成加载。它只显示加载屏幕,而不是典型的“连接到地铁服务器”或类似的东西

一两分钟后,应用程序停止在 Expo 中运行,控制台中的错误显示:

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 
'This method must not be called before the JS thread is created'
Run Code Online (Sandbox Code Playgroud)

main.m来自根项目的引用

错误上方是多次连接尝试,都导致超时

预先感谢!

xcode ios react-native react-native-ios

6
推荐指数
1
解决办法
430
查看次数

Firebase Web 与 iOS 和 Android 版本的 React Native 项目

我是应用程序开发新手,这让我很困惑。

我有一个用react-native 创建的项目,我希望它可用于android 和iOS。我看过一些关于如何为 React Native 后端创建 Firebase 数据库的教程,其中一些在构建应用程序时选择了“Web”版本。

那么,我是否正确地假设我只需要选择“Web”版本,我的应用程序仍然适用于 iOS 和 Android?(我不需要选择 android 和 iOS 版本)

谢谢您的帮助!

Firebase 应用版本

firebase react-native react-native-ios google-cloud-firestore

6
推荐指数
1
解决办法
1178
查看次数