1

我正在使用反应导航安装反应导航,但是当我安装时npm install react-native-reanimated react-native-gesture-handler react-native-screens react-native-safe-area-context @react-native-community/masked-view,它开始在 iOS 中给我错误。

错误是Use of undeclared identifier 'UIScrollTypeMaskAll'RNPanHandler.m

我遵循文档的所有步骤。

Xcode 版本:- 11.3.1

反应本机手势处理程序版本:- 1.9.0

我也试过这个: -

1.

   import 'react-native-gesture-handler'; //by adding on top
   import * as React from 'react';
   import { NavigationContainer } from '@react-navigation/native';

   export default function App() {
      return (
        <NavigationContainer>{/* Rest of your app code */}</NavigationContainer>
      );
     }
  1. rm -rf node_modules并删除package-lock.json
  2. 将 React 本机手势处理程序与 React 本机手势处理程序分开安装
  3. pod install
4

2 回答 2

3

这里已经提到了这个问题,

https://github.com/software-mansion/react-native-gesture-handler/issues/1235

尝试将您的 XCode 版本升级到 12.2 或尝试将您的 React Native Gesture Handler 版本升级到 1.8.0

于 2020-12-15T09:01:26.643 回答
1

官方文档说您必须将此库添加为文件中的第一个导入,index.js但您的文件看起来像App.js.

于 2020-12-15T07:39:35.823 回答