reactNative项目启动报错记录

598 阅读1分钟

问题1: normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'RCT-Folly' from project 'Pods')

运行yarn ios之后控制台报错,用Xcode运行后看到详细报错

No template named 'unary_function' in namespace 'std'; did you mean '__unary_function'?

点击项目project,在build settings搜索macro,找到如下配置

image.png

在debug和release中添加_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION

问题2: note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'FlipperKit' from project 'Pods')

报错后仔细查看Xcode报错内容

image.png

image.png

试了网上的方法 这个有用

  • 打开文件 ios/Pods/Flipper/xplat/Flipper/FlipperTransportTypes.h
  • 第 9 行补充 #include <functional>

image.png

问题3: could not build module UIKit

清下缓存(我重启就好了😄)

问题4: Use of bitwise '' with boolean operands

image.png

解决方法: 手动替换

image.png

问题5: Undefined symbol: nominal type descriptor for CoreGraphics.CGFloat

image.png 解决办法:

image.png

问题6: 报错没有bundle

解决办法:

image.png

问题7 上传textFlight 报错:x Validation failed

Invalid Executable. The executable"商城.app/Frameworks/OpenSSL.framework/OpenSSL' contains bitcode. (ID: )

image.png 解决办法: 还没有解决...bitcode设置了No 限制了IPHONEOS_DEPLOYMENT_TARGET为11 都不行,有没有大佬指点下

使用版本

image.png

追加: 上传TextFlight报缺少证明在info.plist中加一行设置

image.png

image.png

安卓打包问题:yarn bundle-android 报NDK错误

  • 如果运行看到 No toolchains found in the NDK toolchains folder for ABI with prefix: arm-linux-androideabi (blog.csdn.net/python_yjys…)

image.png