React Native 0.63.4 ios 14 无静态图片 [英] React native 0.63.4 ios 14 no static images
问题描述
我尝试使用 Xcode 12.4 (12D4e) 构建一个版本并响应本机 0.63.4,本地图像未显示,但 url 图像显示.
I try to build a release with Xcode 12.4 (12D4e) and react native 0.63.4 and local images are not shown but url images are.
我找到了很多关于此的主题和解决方案,但没有任何效果,我被困了 3 天.
I found many topics and solutions about that but nothing work, i'm stuck for 3 days.
我对我的项目的每个图像都有这个警告:
I have this warning for each images of my project:
[framework] CUICatalog:提供的资产名称无效:'(null)'
[framework] CUICatalog: Invalid asset name supplied: '(null)'
我的 main.jsbundle 和 assets 文件夹在同一个文件夹中并在 Xcode 中列出 ->构建阶段 ->复制捆绑资源
My main.jsbundle and assets folder are in the same folder and listed in Xcode -> Build phases -> Copy Bundle Ressources
由于我的本机版本,ios 14 上的 RCTUIImageViewAnimated.m 错误应该可以解决 >0.62.2(我也检查了文件,一切正常)
The bug with RCTUIImageViewAnimated.m on ios 14 is supposed to be resolved due to my react native version > 0.62.2 (i checked the file too and everythings ok)
我试过了
<Image source={{ uri: Image.resolveAssetSource(Logo)}}
<Image source={{ uri: Image.resolveAssetSource(Logo)}}
但我无法在真实设备、模拟器上正确构建版本或在 testflight 上存档.调试模式工作正常.我错过了什么??
But i'm unable to correctly build a release on real device, simulator or archiving it on testflight. Debug mode is working fine. What i'm missing ??
推荐答案
我不久前遇到了这个问题,请查看 这个.
I ran into this a while ago, check out this.
转到
node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
查找
if (_currentFrame) {
layer.contentsScale = self.animatedImageScale;
layer.contents = (__bridge id)_currentFrame.CGImage;
}
- 并替换为
if (_currentFrame) {
layer.contentsScale = self.animatedImageScale;
layer.contents = (__bridge id)_currentFrame.CGImage;
} else {
[super displayLayer:layer];
}
这篇关于React Native 0.63.4 ios 14 无静态图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!