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都可以调用 其实不指望有人看 就 ...
随机推荐
- 从零开始学java(第一天)
上班日学习时间很短,而且很多事情会耽搁,就会写的比较少 近几期的笔记以复习为主,后面会逐渐拓展对我个人来说的新知识 1. 复习了一下typore的语法,方便以后记笔记用 # MarkDown学习(# ...
- 销讯通CRM客户关系管理系统的功能拆分
随着技术的发展,CRM系统(客户关系管理)成为企业不可或缺的工具,本文从医药行业角度简要谈谈CRM系统的功能. 从业务的理解来说,从医药行业来说,CRM客户管理系统的有以下几部分功能: 01 客户的分 ...
- 企业IT基础资源管理的“帮帮团”上线啦——源启云原生基础设施管理平台
为助力企业提升基础资源一体化管理和交付效率,以更先进的基础设施管理方式来满足现代企业业务持续扩展和复杂化的需要,中电金信运用基础设施即代码(Infrastructure as Code,简称IaC)技 ...
- 【金TECH频道】企业架构转型组合拳来袭,助力金融机构一臂之力
当前,数字化转型已经成为时代共性课题在政策和技术的双重指引下金融机构逐渐走向差异化竞争的格局面对转型阵痛以契合.明晰的战略规划及企业架构调整来辅助业务变革成为助力企业数字化转型的有效路径金融机构也纷纷 ...
- 使用 JDK19 虚拟线程实现5百万持久连接
使用Project Loom 虚拟线程实现5M 持久连接| 黑客新闻 记得十几年前 erlang 火的时候,单机 20万连接.100万连接不停刷新,后来 golang 也开始炫耀,抛开连结构化错误处理 ...
- web应用模式、API接口、接口测试工具postman、restful规范
目录 一.web 应用模式 二.API接口 API概念 三.接口测试工具postman postman介绍 postman下载与使用 四.如何在浏览器中测试 五.restful规范(重要,不难) 概念 ...
- 在.NET Core中使用异步多线程高效率的处理大量数据的最佳实践
目录 一.引言 二.假设场景 三.解决方案 四.示例代码 一.引言 处理大量数据是一个常见的需求,传统的同步处理方式往往效率低下,尤其是在数据量非常大的情况下.本篇将介绍一种高效的多线程异步处理大数据 ...
- ChannelInboundHandlerAdapter和SimpleChannelInboundHandler区别
ChannelInboundHandlerAdapter和SimpleChannelInboundHandler是我们在使用Netty处理Handler时候很常用的两个继承类,虽然说二者实现的功能大致 ...
- 【转载】Spring Cloud Gateway限流详解
https://www.imooc.com/article/290828/ Spring Cloud Gateway限流详解 2019.08.11 12:56 7257浏览 Spring Clou ...
- Qt编写机器码秘钥控制/日期防篡改/离线使用/硬件标识/运行时间/数量控制/批量更新秘钥
一.前言说明 搞软件开发一直追求精益求精的目标,从第一版的秘钥生成器到今天这个版本,经历了十年的时间,最初的版本做的非常简陋,就是搞了个异或加密,控制运行时间,后面又增加设备数量的控制,然后就是到期时 ...