【问题标题】:React native 0.63.4 ios 14 no static imagesReact native 0.63.4 ios 14 无静态图片
【发布时间】:2021-05-20 04:09:22
【问题描述】:

我尝试使用 Xcode 12.4 (12D4e) 构建版本并响应本机 0.63.4 并且未显示本地图像但 url 图像。

我找到了很多关于此的主题和解决方案,但没有任何效果,我被困了 3 天。

  • 我的项目的每张图片都有这个警告:

    [框架] CUICatalog:提供的资产名称无效:'(null)'

  • 我的 main.jsbundle 和 assets 文件夹在同一个文件夹中,并在 Xcode -> Build Phases -> Copy Bundle Ressources 中列出

  • 由于我的反应原生版本> 0.62.2,ios 14 上的The bug with RCTUIImageViewAnimated.m 应该可以解决(我也检查了文件,一切正常)

  • 我试过了

但我无法在真实设备、模拟器上正确构建版本或在 testflight 上存档。调试模式工作正常。我错过了什么??

【问题讨论】:

  • 你是否在文件 react-native/Libraries/Image/RCTUIImageViewAnimated.m 中添加了 else 块
  • 你看过我的帖子了吗? react native 0.62.2 修复了这个问题,我还是检查了
  • @Jigneshmayani 我忘了准确,我的项目的每个图像都有这个错误:[框架] CUICatalog:提供的资产名称无效:'(null)'
  • 可能重复(也没有答案):stackoverflow.com/questions/67529743/…

标签: ios xcode react-native xcode12


【解决方案1】:

我不久前遇到过这个问题,请查看this

  1. 转到node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m

  2. 找到

   if (_currentFrame) { 
     layer.contentsScale = self.animatedImageScale; 
     layer.contents = (__bridge id)_currentFrame.CGImage; 
   } 
  1. 并替换为
 if (_currentFrame) {
    layer.contentsScale = self.animatedImageScale;
    layer.contents = (__bridge id)_currentFrame.CGImage;
  } else {
    [super displayLayer:layer];
  }

【讨论】:

  • 感谢您的回答,但请阅读 OP。它清楚地表明这不是要点 3 中的问题。
猜你喜欢
  • 1970-01-01
  • 2018-08-21
  • 2022-01-01
  • 2015-12-17
  • 1970-01-01
  • 1970-01-01
  • 2020-08-10
  • 2018-04-20
  • 1970-01-01
相关资源
最近更新 更多