标签: react-native-ios

调试-iphonesimulator/YogaKit/YogaKit.modulemap' 未找到

我在react-native中创建了新项目,我正在尝试在xcode中构建,但出现了致命错误

致命错误:模块映射文件“/Users/gis00109/Library/Developer/Xcode/DerivedData/sam-capwmdorzbxfzphhezjlrwcbyxyp/Build/Products/Debug-iphonesimulator/YogaKit/YogaKit.modulemap”未找到

xcode react-native react-native-ios

5
推荐指数
1
解决办法
4672
查看次数

如何从 iOS 上的 React Native WebView 获取 Cookie?

我有一个在 web 视图中打开的单点登录网站。用户登录后,我需要使用 cookie 来从 API 请求令牌,并在应用程序中将其用于所有其他请求。这一切在 Android 上运行良好,但在 iOS 上,当我请求令牌时,没有 cookie。WebView 配置为使用共享 cookie 存储:

    <WebView
        source={{ uri: loginUrl }}
        onMessage={handleSsoLogin}
        injectedJavaScriptBeforeContentLoaded={JS_INTERFACE}
        sharedCookiesEnabled={true}
      />
Run Code Online (Sandbox Code Playgroud)

如果我使用 devTools 检查 webView,我可以看到 cookie。另外,如果我再次访问 SSO 站点,我已经记录了它。因此,cookie 被 webView 保存和使用。它们只是不被使用fetch并且 CookieManager 不访问它们:

const cookies = await CookieManager.get(url);
console.log({ cookies });
...
{"cookies": {}}
Run Code Online (Sandbox Code Playgroud)

那么,问题来了,如何从webView中获取这些cookie呢?

react-native react-native-ios react-native-webview react-native-cookies

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

React-native-maps 初始缩放:0 不适用于 iOS

我找不到一种方法让 iOS RN 地图从缩放级别 0 开始或缩小到 0。

const allowScaling = false;

const region = {
  latitude: 0,
  longitude: 0,
  latitudeDelta: 170,
  longitudeDelta: 180,
};

return (
  <View
    style={{
      position: 'relative',
      width: '100%',
      height: '100%',
      overflow: 'hidden',
    }}
  >
    <MapView
      ref={this.setRef}
      onPress={this.onPress}
      onLongPress={this.onLongPress}
      style={{ width: '100%', height: '100%' }}
      zoomControlEnabled
      provider={Platform.OS === 'ios' ? 'google' : 'osmdroid'}
      moveOnMarkerPress={false}
      customMapStyle={[
        {
          stylers: [
            {
              visibility: 'off',
            },
          ],
        },
      ]}
      rotateEnabled={false}
      scrollEnabled={allowScaling}
      pitchEnabled={allowScaling}
      zoomTapEnabled={allowScaling}
      zoomEnabled={allowScaling}
      cacheEnabled={false}
      initialRegion={region}
      onRegionChangeComplete={this.onRegionChange}
      maxZoomLevel={Platform.OS === 'ios' ? …
Run Code Online (Sandbox Code Playgroud)

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

5
推荐指数
1
解决办法
3152
查看次数

为什么升级到 0.63.3 后命令“react-native run-ios”构建失败?

我刚刚更新到 RN v0.63.3。react-native run-ios更改应用程序名称后,我在以前的反应本机版本上遇到了问题,并且项目/方案有不同的名称,从未解决该问题,每个人都说只需升级即可。

现在在 v0.63.3 上仍然存在构建失败的问题react-native run-ios。这次的错误是:

** 构建失败 **

以下构建命令失败:CompileC /Users/vorousjames/Library/Developer/Xcode/DerivedData/<OLD_NAME>-gdmnlxiprekjqhfiueouiidqhqnl/Build/Intermediates.noindex/<NEW_NAME>.build/Debug-iphonesimulator/<NEW_NAME>.build/Objects- Normal/x86_64/AppDelegate.o /Users/Desktop/Development/App/iOS/<OLD_NAME>/AppDelegate.m 正常 x86_64 Objective-c com.apple.compilers.llvm.clang.1_0.compiler (1 次失败)

从 Xcode 内部构建/运行没有问题。只有react-native run-ios

编辑:我想也许是因为我在全局安装了 cli,因为我只是调用react-native run-ios. 我相信使用全局安装。因此,由于它已经过时,我全局卸载并尝试将社区包与npx react-native run-ios. 现在它给出了另一个 comileC 错误,但有所不同。

** 构建失败 **

以下构建命令失败:CompileC /Users/Library/Developer/Xcode/DerivedData/App-gdmnlxiprekjqhfiueouiidqhqnl/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNFirebase.build/Objects-normal/x86_64/RNFirebaseMessaging.o /用户/桌面/开发/应用程序/node_modules/react-native-firebase/ios/RNFirebase/messaging/RNFirebaseMessaging.m正常x86_64目标-c com.apple.compilers.llvm.clang.1_0.compiler CompileC /Users/Library/Developer /Xcode/DerivedData/App-gdmnlxiprekjqhfiueouiidqhqnl/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNFirebase.build/Objects-normal/x86_64/RNFirebaseFirestore.o /Users/Desktop/Development/App/node_modules/react-native -firebase/ios/RNFirebase/firestore/RNFirebaseFirestore.m 正常 x86_64 Objective-c com.apple.compilers.llvm.clang.1_0.compiler (2 次失败)

这完全扼杀了我快速迭代的能力,欢迎任何建议

反应原生:0.63.3 反应原生-cli(全局):2.0.1 反应原生社区/cli:^4.8.0 Xcode:12.0.1 iOS:14.0.1

更新:

包.json:

{
    "name": "Aflare",
    "version": "0.0.1",
    "private": true,
    "scripts": {
        "android": "react-native …
Run Code Online (Sandbox Code Playgroud)

ios react-native react-native-ios react-native-cli

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

将 React Native 从 0.62.2 升级到 0.63.0 在空白屏幕上挂起

我正在尝试手动将 React Native 从 0.62.2 升级到 0.63.0。我跟着升级助手

应用程序构建没有错误,但在 android 和 ios 启动时显示白屏。

在此输入图像描述

依赖关系

"react": "16.13.1",  
"react-dom": "^16.13.1",  
"react-native": "0.63.0"
Run Code Online (Sandbox Code Playgroud)

我尝试清除缓存,删除node_modules和pod,然后运行npm install和pod install。没有任何帮助,我仍然有同样的问题。

react-native react-native-ios react-navigation

5
推荐指数
1
解决办法
1575
查看次数

错误:FIREBASE 致命错误:无法解析 Firebase url。请使用 https://&lt;YOUR FIREBASE&gt;.firebaseio.com 但数据库 url 不是 firebaseio.com expo

我正在为我的 ios 应用程序使用 Expo SDK,当我尝试在 firebase 数据库中写入数据但收到错误时。错误:FIREBASE 致命错误:无法解析 Firebase URL。请使用 https://.firebaseio.com *

我的 firebase 配置文件是

const firebaseConfig = {
  apiKey: "xxxxxx",
  authDomain: "xxxxxx.firebaseapp.com",
  databaseURL: "https://xxxxxxxxxxxxxx.europe-west1.firebasedatabase.app",
  projectId: "xxxxx",
  storageBucket: "xxxxxxx.appspot.com",
  messagingSenderId: "xxxxxxxxx",
  appId: "xxxxxxxxxx",
  measurementId: "xxxxxx"
};

Run Code Online (Sandbox Code Playgroud)

我存储数据的函数是


signUp = () => {
   const user = firebase.auth().currentUser;
   let userid = user.uid;

   firebase
     .database()
     .ref(`users/${userid}`)
     .set({
       firstname: this.state.firstname,
       lastname: this.state.lastname,
       password: this.state.password,
       email: this.state.email,
       dob: this.state.dob,
       postcode: this.state.postcode,
     })
     .then(() => {
       alert("user created");
     })
     .catch((err) => {
       alert("error");
     });
 }; …
Run Code Online (Sandbox Code Playgroud)

firebase react-native firebase-realtime-database react-native-ios expo

5
推荐指数
3
解决办法
7990
查看次数

在 React Native 库中使用本地 .xcframework 的 Podspec 文件应该是什么?

我创建了一个 React Native 库,它是在 React Native 项目中使用本机 iOS 框架的包装器。早些时候我使用过.framework,它运行良好。现在我在使用这个库时遇到问题.xcframework而不是.framework

我将此库添加为项目的依赖项,然后在运行时pod install出现以下错误:

[!] [Xcodeproj] 生成重复的 UUID:

当我打开项目并尝试构建它时,它在设备上成功构建,但在模拟器上失败。

以下是我在库项目中使用的 Podspec 文件:

Pod::Spec.new do |s|
  s.name         = "react-native-myLibrary"
  s.version      = "1.0.0"
  s.summary      = "react-native-myLibrary"
  s.description  = <<-DESC
                    react-native-myLibrary
                   DESC
  
  s.homepage     = "https://github.com/geektimecoil/react-native-onesignal"
  s.license      = "MIT"
  s.author       = { "author" => "author@domain.cn" }
  s.platform     = :ios, "10.0"
  s.source       = { :http => 'file:' + __dir__ + '/' }

  s.source_files = "**/*.{h,m,swift}"
  s.requires_arc = true
  s.vendored_frameworks = …
Run Code Online (Sandbox Code Playgroud)

ios cocoapods podspec react-native-ios xcframework

5
推荐指数
1
解决办法
7133
查看次数

使用视频的第一帧作为缩略图

我正在使用反应本机视频

它有一个名为的道具poster,运行良好。但我的要求是从视频中获取缩略图(视频的第一帧)。如果我不使用poster(接受网址),那么它会显示空白屏幕。

知道如何使用视频的第一帧作为缩略图吗?

谢谢你!!!

react-native react-native-ios react-native-video

5
推荐指数
1
解决办法
5936
查看次数

React Navigation:无法使用 createMaterialTopTabNavigator() 打开键盘

对于react-navigation/native (5.9.4)和 iOS(在 iPhone 8 上测试),我无法使用createMaterialBottomTabNavigator() (5.3.15)createMaterialTopTabNavigator() (5.3.15)

\n

当我使用这两个功能时,键盘不会在 iOS 上打开(或立即关闭)。这使得输入完全无法使用。

\n

在此输入图像描述

\n

我重新创建了一个非常简单的模型。使用 Snack Expo,在 Android 上,一切正常,在 iOS 上,键盘无法打开:

\n

https://snack.expo.io/xUeskyMm-

\n

在 中/Navigator/BottomTabNavigator,您可以更改取消注释/注释代码:

\n
const BottomTabNavigator = () => {\n  return (\n    <Tab.Navigator>\n      {/*\n      <Tab.Screen\n        name="GymTopTab"\n        component={GymTopTabNavigator}\n        options={{\n          tabBarLabel: "S\xc3\xa9ances",\n        }}\n      />\n      */}\n      <Tab.Screen\n        name="TrainingStack"\n        component={TrainingStackNavigator}\n        options={{\n          tabBarLabel: "S\xc3\xa9ances",\n        }}\n      />\n    </Tab.Navigator>\n  )\n}\n
Run Code Online (Sandbox Code Playgroud)\n

当我不使用时createMaterialTopTabNavigator()一切正常。createMaterialBottomTabNavigator()这就是为什么我认为当我和一起使用时会出现错误createMaterialTopTabNavigator()。但令我感到非常惊讶的是,如此基本的情况却造成了如此大的问题。

\n

react-native react-native-ios react-navigation

5
推荐指数
0
解决办法
270
查看次数

以下 Swift Pod 尚无法集成为静态库

每当我尝试pod install这样做时都会出现此错误

下载依赖项
安装 BVLinearGradient (2.5.6)
安装 CocoaAsyncSocket (7.6.5)
安装 DoubleConversion (1.1.6)
安装 FBLazyVector (0.64.0)
安装 FBReactNativeSpec (0.64.0)
安装 Flipper (0.75.1)
安装 Flipper-Boost-iOSX (1.76.0.1.11)
安装 Flipper-DoubleConversion (1.1.7)
安装 Flipper-Fmt (7.1.7)
安装 Flipper-Folly (2.6.9)
安装 Flipper-Glog (0.3.6)
安装 Flipper-PeerTalk (0.0.0) 4)
安装 Flipper-RSocket (1.4.3)
安装 FlipperKit (0.75.1)
安装 GoogleMaps (3.1.0)
安装 GooglePlaces (3.1.0)
安装 JGProgressHUD (2.2)
安装 MDFInternationalization (2.0.0)
安装 MaterialComponents (124.2.0) )
安装 MotionAnimator (4.0.1)
安装 MotionInterchange (3.0.0)
安装 OpenSSL-Universal (1.1.1100)
安装 Pulsator (0.6.0)
安装 RCT-Folly (2020.01.13.00)
安装 …

build ios swift react-native react-native-ios

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