我已经构建了一个在 android 中运行良好的 React Native 应用程序......但是当我尝试在 ios 中构建时出现以下错误:Undefined symbols for architecture x86_64
它似乎以某种方式链接到 Flipper,详细错误如下:
link with file built for iOS Simulator-arm64
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_FlipperKitNetworkPlugin", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_FlipperKitReactPlugin", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_SKDescriptorMapper", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_FlipperClient", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_RNCPushNotificationIOS", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_FlipperKitLayoutPlugin", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_RCTRootView", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_RCTBridge", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_SKIOSNetworkAdapter", referenced from:
objc-class-ref in …Run Code Online (Sandbox Code Playgroud) 当我有一个本机项目时......当我运行pod install它时,它给了我以下错误
Invalid `Podfile` file: cannot load such file -- /myPath/node_modules/react-native/scripts/react_native_pods
Run Code Online (Sandbox Code Playgroud)
这是我的 podfile
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, '10.0'
target 'xs' do
config = use_native_modules!
use_react_native!(:path => config["reactNativePath"])
target 'xsTests' do
inherit! :complete
# Pods for testing
end
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable these next few lines.
use_flipper!
post_install do |installer|
flipper_post_install(installer)
end
end
target 'xs-tvOS' do
# Pods for xs-tvOS …Run Code Online (Sandbox Code Playgroud) 当我尝试运行 pod install 时,程序到达时会生成错误,Installing Flipper-Glog (0.3.6)
以下是完整的错误消息:
Installing Flipper-Glog (0.3.6)
[!] /bin/bash -c
set -e
#!/bin/bash
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
set -e
PLATFORM_NAME="${PLATFORM_NAME:-iphoneos}"
CURRENT_ARCH="${CURRENT_ARCH}"
if [ -z "$CURRENT_ARCH" ] || [ "$CURRENT_ARCH" == "undefined_arch" ]; then
# Xcode 10 beta sets CURRENT_ARCH to "undefined_arch", this leads to incorrect linker arg. …Run Code Online (Sandbox Code Playgroud) 在此先感谢您的帮助; 我宁愿成为RN和Android的新手(我使用create-native init来创建项目).
问题1:当我第一次ctrl+ M,然后选择"调试JS远程"它试图[ http://10.0.2.2:8081/debugger-ui]但无限期挂起.
问题2.当我最终放弃并反而手动访问[ http:// localhost:8081/debugger-ui /]时,我无法将AVD从"白屏死机"中恢复.我试过"停止远程JS Bebugging","重新加载"等......但最终必须使用"react-native run-android"刷新
问题3:一旦我最终[ http:// localhost:8081/debugger-ui /]显示所需的"调试器会话#0活动",我将进入开发工具 - >源 - >网络 - > debuggerWorker. js .....我没有看到列出的文件夹/文件.见截图.
RN很难,无法调试!
这是一个尝试使用 Redux 的非常简单的页面……请参阅下面的代码。
但是我收到错误 object is not a constructor (evaluating 'new ctor(props context)')
import React, {Component} from 'react';
import {Text, View} from 'react-native';
import {connect} from 'react-redux';
const mapStateToProps = state => ({
userId: state.auth.userId,
});
class Message extends Component {
render() {
return (
<View>
<Text>Text here</Text>
</View>
);
}
}
export default connect(
mapStateToProps,
null,
)(Message);
Run Code Online (Sandbox Code Playgroud) 首先,我创建一个Blob文件
RNFetchBlob.fs.readFile(localImgUrl2, 'base64')
.then(base64ImageStr => Blob.build('image.png', base64ImageStr, { type: 'image/png;BASE64' }))
Run Code Online (Sandbox Code Playgroud)
......然后我尝试上传到Firebase
.then((data) => {FBStorageRef.put(data, { contentType: mime })})
Run Code Online (Sandbox Code Playgroud)
...但这给了我错误
Firebase Storage: Object 'profilePics/image.png' does not exist
Run Code Online (Sandbox Code Playgroud)
我相信它FBStorageRef与.....有关系,我的云存储完全空了,我想创建一个名为profilePics ....的文件夹,其中的文件我想调用image.png
const FBStorageRef = Firebase.storage().ref('/profilePics/image.png');
Run Code Online (Sandbox Code Playgroud)
它说那profilePics/image.png doe not exist是真的.....但这就是为什么我想正确上传它的原因:)
我刚刚react-native-vector-icons从 7.1 版升级到 8.0 版......现在我收到以下错误:
unable to resolve module `./tab-bar-item-ios` from `node_modules\react-native-vector-icons\lib\create-icon-set.js`
None of these files exist:
* node_modules\react-native-vector-icons\lib\tab-bar-item-ios(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx).........etc
Run Code Online (Sandbox Code Playgroud)
我使用 Windows 计算机在真实的 Android 设备上进行测试。有任何想法吗?
React Native调试器(Chrome开发工具)可以正常工作几个月,但是现在当我添加一个新文件时,它没有在“源”选项卡中显示。当我在现有文件中编辑代码时,它可以识别,但是在我添加文件时则不能。
有任何想法吗?
我已经意识到与特定应用无关。我用初始化命令创建了一个全新的应用程序,问题仍然存在。
我还将RN从0.55.4升级到0.59.5。这没有什么变化,仍然看到相同的问题。
还重新安装了Chrome,没有运气。
还重新安装了NPM,以防链接到打包程序。
只要有能力解决此问题的人,将很高兴获得30加元的奖励
对于任何可以解决此问题的人,其价值都将增加到50美元。
我完全震惊,这是世界上最好的技术人才无法解决的事情(但不是)
我刚刚从 RN 0.55.4 升级到 0.59.3.....现在出现以下错误:
错误:无法从...\node_modules\react-native\Libraries\Utilities\HMRClient.js 解析模块metro/src/lib/bundle-modules/HMRClient:模块metro/src/lib/bundle-modules/HMRClient 确实急速模块图中不存在
HMRClient.js 文件确实包含以下 require 语句: const MetroHMRClient = require('metro/src/lib/bundle-modules/HMRClient');.....而且我在任何地方都看不到以“metro”开头的路径,所以我想我需要以某种方式添加它。还有另一个 require 语句如下:const invariant = require('invariant');....也不存在文件名“invariant”。
Facebook 表示这个问题已在 0.53.0 master 中修复,但看起来又回到了 https://github.com/facebook/react-native/issues/17742
下面是我的 package.json
{
"name": "xs",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"flow": "flow",
"flow start": "flow start",
"flow stop": "flow stop",
"flow status": "flow status",
"flow coverage": "flow coverage"
},
"dependencies": {
"firebase": "^5.11.1",
"flow": "^0.2.3",
"flow-bin": "^0.65.0",
"prop-types": "^15.6.1",
"react": "16.8.3",
"react-native": "0.59.3", …Run Code Online (Sandbox Code Playgroud) 我刚刚升级到 React Native 0.63.3..... 我也升级了 Android studio4.1.1和 gradle 插件到4.1.0. 当我尝试构建时
出现错误cannot find symbol class ReactInstanceManager。
错误在文件中MainApplication.java......请参阅下面的代码。
出现错误是与行initializeFlipper(this,getReactNativeHost().getReactInstanceManager());。似乎是说我提供com.facebook.react.ReactInstanceManager....但是程序想要的是ReactInstanceManager.
它说Get the current ReactInstanceManager instance, or create one.
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
}
/**
* Loads Flipper in React Native templates. Call this in the onCreate method with something like
* initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
*
* @param context …Run Code Online (Sandbox Code Playgroud) react-native ×10
clang ×1
cocoapods ×1
firebase ×1
flipper ×1
objective-c ×1
pod-install ×1
podfile ×1
react-redux ×1
xcode ×1