react-native 0.63 适配 Xcode 15 iOS 17.0+

iOS 17.0 Simulator(21A328)下载失败

App Store 更新到 Xcode15 后,无法运行模拟器和真机。需要下载iOS 17对应的模拟器。Xcode中更新非常容易中断失败,可以在官网单独下载iOS 17模拟器文件,例如:iOS_17.0.1_Simulator_Runtime.dmg(7GB),官方下载链接:developer.apple.com/download/al...https://link.juejin.cn/?target=https%3A%2F%2Fdeveloper.apple.com%2Fdownload%2Fall%2F%3Fq%3DXcode

选择对应版本的 Simulator Runtime 下载即可,下载完成后执行如下命令进行安装:

bash 复制代码
sudo xcode-select -s /Applications/Xcode.app
xcodebuild -runFirstLaunch
xcrun simctl runtime add "/Users/songlcy/Downloads/iOS_17.0.1_Simulator_Runtime.dmg"

WkwebsiteDataStore: type argument 'nw_proxy_config_t' is neither an Objective-C object nor a block type

找到 WkwebsiteDataStore.h 文件,将 170000 修改为 180000 :

Assertion failed: (false && "compact unwind compressed function offset doesn't fit in 24 bits"), function operator(), file Layout.cpp, line 5758.

打开 Build Settings,找到 Other Linker Flags,在当下添加 -ld64

react-native-fast-image

修改 FFFastImageView.m 文件:

diff 复制代码
diff --git a/node_modules/react-native-fast-image/ios/FastImage/FFFastImageView.m b/node_modules/react-native-fast-image/ios/FastImage/FFFastImageView.m
index 9c0f1d3..e71f92f 100644
--- a/node_modules/react-native-fast-image/ios/FastImage/FFFastImageView.m
+++ b/node_modules/react-native-fast-image/ios/FastImage/FFFastImageView.m
@@ -71,11 +71,11 @@ - (void)setImageColor:(UIColor *)imageColor {
 
 - (UIImage*)makeImage:(UIImage *)image withTint:(UIColor *)color {
     UIImage *newImage = [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
-    UIGraphicsBeginImageContextWithOptions(image.size, NO, newImage.scale);
-    [color set];
-    [newImage drawInRect:CGRectMake(0, 0, image.size.width, newImage.size.height)];
-    newImage = UIGraphicsGetImageFromCurrentImageContext();
-    UIGraphicsEndImageContext();
+    UIGraphicsImageRenderer *renderer = [[UIGraphicsImageRenderer alloc] initWithSize:image.size];
+    newImage = [renderer imageWithActions:^(UIGraphicsImageRendererContext * _Nonnull rendererContext) {
+        [color setFill];
+        [newImage drawInRect:CGRectMake(0, 0, image.size.width, newImage.size.height)];
+    }];
     return newImage;
 }
 

持续更新中...

相关推荐
zh_xuan3 天前
启动RN服务端口被占用
android·react native
墨狂之逸才4 天前
在 React Native 中集成 MinIO 对象存储(图片/文件上传服务)
react native
chenbin___4 天前
鸿蒙RN position: ‘absolute‘ 和 zIndex 的兼容性问题(转自千问)
前端·javascript·react native·harmonyos
未名编程4 天前
React Native WebView 加载远程页面显示错误内容的深层原因及解决方案
javascript·react native·react.js
chenbin___5 天前
检查hooks依赖的工具(转自千问)
开发语言·前端·javascript·react native·react.js
chenbin___5 天前
鸿蒙(HarmonyOS)支持 useNativeDriver的详细说明(转自千问)
前端·javascript·react native·react.js·harmonyos
黑臂麒麟5 天前
React Hooks 闭包陷阱:状态“丢失“的经典坑
javascript·react native·react.js·ecmascript
fix一个write十个6 天前
NativeWind v4 与 React Native UI Kit或三方库样式隔离指南
前端·react native
2601_949593656 天前
小白入门ReactNative for OpenHarmony项目鸿蒙化三方库:react-native-fast-image
react native·react.js·harmonyos
sealaugh326 天前
react native(学习笔记第二课) 英语打卡微应用(1)-开始构建
笔记·学习·react native