MacOS15+Xcode版本16+对ReactNative项目进行编译和上传到APPStore的踩坑记录
作者:Kovli
重要通知:红宝书第5版2024年12月1日出炉了,感兴趣的可以去看看,https://u.jd.com/saQw1vP
红宝书第五版中文版
红宝书第五版英文原版pdf下载(访问密码: 9696)
1、编译报错如下
项目名/ios/Pods/FlipperKit/iOS/FlipperKit/FlipperPlatformWebSocket.mm:57:46 Called object type 'facebook::flipper::SocketCertificateProvider' (aka 'int') is not a function or function pointer
项目名/ios/Pods/Headers/Private/Flipper/FlipperTransportTypes.h:24:14 No template named 'function' in namespace 'std'
项目名/ios/Pods/FlipperKit/iOS/FlipperKit/FlipperPlatformWebSocket.mm:158:18 Called object type 'facebook::flipper::SocketEventHandler' (aka 'int') is not a function or function pointer
解决方案如下:
把下面的代码复制一下
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == 'Flipper'
file_path = 'Pods/Flipper/xplat/Flipper/FlipperTransportTypes.h'
system("chmod +w " + file_path)
contents = File.read(file_path)
unless contents.include?('#include <functional>')
File.open(file_path, 'w') do |file|
file.puts('#include <functional>')
file.puts(contents)
end
end
end
end
end
放到post_install do |installer|下面
例如原podfile里有如下代码
post_install do |installer|
react_native_post_install(
installer,
# Set `mac_catalyst_enabled` to `true` in order to apply patches
# necessary for Mac Catalyst builds
:mac_catalyst_enabled => false
)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
# Add these lines for Xcode 14 builds
installer.generated_projects.each do |project|
project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
end
end
end
# End of added lines
end
复制后代码如下
post_install do |installer|
react_native_post_install(
installer,
# Set `mac_catalyst_enabled` to `true` in order to apply patches
# necessary for Mac Catalyst builds
:mac_catalyst_enabled => false
)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
# Add these lines for Xcode 14 builds
installer.generated_projects.each do |project|
project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
end
end
end
installer.pods_project.targets.each do |target|
if target.name == 'Flipper'
file_path = 'Pods/Flipper/xplat/Flipper/FlipperTransportTypes.h'
system("chmod +w " + file_path)
contents = File.read(file_path)
unless contents.include?('#include <functional>')
File.open(file_path, 'w') do |file|
file.puts('#include <functional>')
file.puts(contents)
end
end
end
end
# End of added lines
end
即可编译成功
2 上传APPStore时报错如下
Asset validation failed
Invalid Executable. The executable '项目名.app/Frameworks/hermes.framework/hermes' contains bitcode. (ID:
解决方案如下:
复制以下代码
bitcode_strip_path = `xcrun --find bitcode_strip`.chop!
def strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
framework_path = File.join(Dir.pwd, framework_relative_path)
command = "#{bitcode_strip_path} #{framework_path} -r -o #{framework_path}"
puts "Stripping bitcode: #{command}"
system(command)
end
framework_paths = [
"Pods/LogRocket/LogRocket.xcframework/ios-arm64/LogRocket.framework/LogRocket",
"Pods/hermes-engine/destroot/Library/Frameworks/macosx/hermes.framework/hermes",
"Pods/hermes-engine/destroot/Library/Frameworks/macosx/hermes.framework/Versions/Current/hermes",
"Pods/hermes-engine/destroot/Library/Frameworks/universal/hermes.xcframework/ios-arm64/hermes.framework/hermes",
"Pods/hermes-engine/destroot/Library/Frameworks/universal/hermes.xcframework/ios-arm64_x86_64-maccatalyst/hermes.framework/hermes"
]
framework_paths.each do |framework_relative_path|
strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
end
到podfile文件的post_install do |installer|下面
例如原代码如下:
post_install do |installer|
react_native_post_install(
installer,
# Set `mac_catalyst_enabled` to `true` in order to apply patches
# necessary for Mac Catalyst builds
:mac_catalyst_enabled => false
)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
# Add these lines for Xcode 14 builds
installer.generated_projects.each do |project|
project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
end
end
end
installer.pods_project.targets.each do |target|
if target.name == 'Flipper'
file_path = 'Pods/Flipper/xplat/Flipper/FlipperTransportTypes.h'
system("chmod +w " + file_path)
contents = File.read(file_path)
unless contents.include?('#include <functional>')
File.open(file_path, 'w') do |file|
file.puts('#include <functional>')
file.puts(contents)
end
end
end
end
# End of added lines
end
复制后如下:
post_install do |installer|
bitcode_strip_path = `xcrun --find bitcode_strip`.chop!
def strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
framework_path = File.join(Dir.pwd, framework_relative_path)
command = "#{bitcode_strip_path} #{framework_path} -r -o #{framework_path}"
puts "Stripping bitcode: #{command}"
system(command)
end
framework_paths = [
"Pods/LogRocket/LogRocket.xcframework/ios-arm64/LogRocket.framework/LogRocket",
"Pods/hermes-engine/destroot/Library/Frameworks/macosx/hermes.framework/hermes",
"Pods/hermes-engine/destroot/Library/Frameworks/macosx/hermes.framework/Versions/Current/hermes",
"Pods/hermes-engine/destroot/Library/Frameworks/universal/hermes.xcframework/ios-arm64/hermes.framework/hermes",
"Pods/hermes-engine/destroot/Library/Frameworks/universal/hermes.xcframework/ios-arm64_x86_64-maccatalyst/hermes.framework/hermes"
]
framework_paths.each do |framework_relative_path|
strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
end
react_native_post_install(
installer,
# Set `mac_catalyst_enabled` to `true` in order to apply patches
# necessary for Mac Catalyst builds
:mac_catalyst_enabled => false
)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
# Add these lines for Xcode 14 builds
installer.generated_projects.each do |project|
project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
end
end
end
installer.pods_project.targets.each do |target|
if target.name == 'Flipper'
file_path = 'Pods/Flipper/xplat/Flipper/FlipperTransportTypes.h'
system("chmod +w " + file_path)
contents = File.read(file_path)
unless contents.include?('#include <functional>')
File.open(file_path, 'w') do |file|
file.puts('#include <functional>')
file.puts(contents)
end
end
end
end
# End of added lines
end
即可上传APPStore提审
Tips: 如果有如下警告:
Upload Symbols Failed
The archive did not include a dSYM for the hermes.framework with the UUIDs
无需理会,不影响上传和提审,如果要去掉这个警告,请升级RN版本
MacOS15+Xcode版本16+对ReactNative项目进行编译和上传到APPStore的踩坑记录的更多相关文章
- 关于RequestParam在不同的Spring版本上,接口在controller重载时注解可能失效的踩坑记录
先抛背景: 我项目中的Spring版本是2.0.3.RELEASE. api-demo负责暴露接口,service-demo负责实现功能.接口参数的@RequestParam和@RequestBody ...
- 你真的了解字典(Dictionary)吗? C# Memory Cache 踩坑记录 .net 泛型 结构化CSS设计思维 WinForm POST上传与后台接收 高效实用的.NET开源项目 .net 笔试面试总结(3) .net 笔试面试总结(2) 依赖注入 C# RSA 加密 C#与Java AES 加密解密
你真的了解字典(Dictionary)吗? 从一道亲身经历的面试题说起 半年前,我参加我现在所在公司的面试,面试官给了一道题,说有一个Y形的链表,知道起始节点,找出交叉节点.为了便于描述,我把上面 ...
- myEclipse配置java版本(环境、项目、编译)
从别的地方导入一个项目的时候,经常会遇到eclipse/Myeclipse报Description Resource Path Location Type Java compiler level d ...
- MySQL切换版本踩坑记录(包括恢复数据方法)
踩坑起因:在创建数据库时, 字段:create_time datetime DEFAULT CURRENT_TIMESTAMP, 报异常--Error Code: 1067 - Invalid def ...
- windows 下 react-native(v0.56) Android 环境搭建踩坑记录
debugservicereact-native 安装官网 https://reactnative.cn/docs/getting-started.html 根据官网步骤一步步执行下去.还能碰到一些问 ...
- mpvue微信小程序项目踩坑记录
1.mpvue入门教程, http://mpvue.com/mpvue/quickstart.html # . 先检查下 Node.js 是否安装成功 $ node -v v8.9.0 $ npm - ...
- Codding.net 与 Visual Studio 项目的创建和上传 push 403错误
1.在codding项目里创建一个项目,记住http 箭头的链接 2.克隆-----第一个框放入上面保存的链接, 下面的框选择一个空文件夹,选好后 克隆就OK 3.在 第2步NewRepo2 文件夹里 ...
- React-Native踩坑记录二
1.Image组件的borderRadius画圆有平台兼容性问题,在IOS下会失效 解决方法有几种 (1)在外面包裹一层View,对View组件使用borderRadius就可以了,这是我的做法 (2 ...
- MVC5项目转.Net Core 2.2学习与填坑记录(1)
流程都是自己摸索,错误地方随便指正... 老项目过于臃肿,并且所有请求都是提交到一个api中,这样当api挂掉的时候,基本所有的项目都瘫痪掉了. 在4月底的时候,下决心将项目用微服务进行重写,刚开始的 ...
- Mysql 8+ 版本完全踩坑记录
问题是这样 刚霍霍了一台腾讯云服务器需要安装mysql 然后就选择了8+这个版本. 安装步骤网上有的是. 我只写最主要的部分 绝对不出错 外网可访问 .net java都可以调用 其实不指望有人看 就 ...
随机推荐
- GUETSEC
1. GUETSEC栈溢出 可以看到它看起来好像有四个栈溢出,我们逐个点进去 __isoc99_scanf("%20s", v1):限制了读取20个字符串(但其实无法完全杜绝缓冲区 ...
- (二)Springboot + vue + 达梦数据库构建RBAC权限模型前后端分离脚手架保姆级教程(后端项目)
XX后台管理系统 Springboot + vue + dm8 的前后端分离项目,后端项目 https://spring.io https://start.aliyun.com 1. 创建项目 初始化 ...
- 鸿蒙NEXT开发案例:经纬度距离计算
[引言] 在鸿蒙NEXT平台上,我们可以轻松地开发出一个经纬度距离计算器,帮助用户快速计算两点之间的距离.本文将详细介绍如何在鸿蒙NEXT中实现这一功能,通过简单的用户界面和高效的计算逻辑,为用户提供 ...
- 【Amadeus原创】idea实现java前后端代码自动化调试
代码结构: 1,meeting-server 后端 springBoot maven 2,metting-ui 前端 nodejs 3,两个文件夹都在early-meeting文件夹中 如何在 ...
- 【Amadeus原创】群晖关闭局域网发现
套件中心-媒体服务器,卸载.
- IOS跳转到系统相册及一些其他的URL Scheme
IOS跳转到系统相册及一些其他的URL Scheme APP 间的跳转主要通过 UIApplication.shared.openURL(url) 这种方法来实现的,但iOS10 后又稍加不同,iOS ...
- nanoFramework
nanoFramework 01: Getting started with nanoFramework! 08: .NET nanoFramework GPIO, I2C, SPI and othe ...
- 实用干货分享(3)- Git常用操作干货分享
官方学习地址 https://git-scm.com/book/zh/v2 简单的代码提交流程 1. git status 查看工作区代码相对于暂存区的差别: 2. git add . 将当前目录下修 ...
- PM的正交解调法
1.PM的模拟调制过程 PM信号是一种相位调制信号,其携带的信息保存在其信号的相位中,通过改变载波的相位来实现基带数据的传输. 其函数表达式如下: \[s(t) = A*cos(w_c*t + K ...
- Spring JDBCTemplate 增删查功能 (简单易懂)
需要的外部jar包: mysql-connector-javadruid 配置druid <!--配置数据库连接池--> <bean id="dataSource" ...