xcode打包报错:Values of type 'NSInteger' should not be used as format arguments; add an explicit cast to

本文解决Xcode升级至9.3版本后出现的RN格式参数错误问题,提供三种解决方案:降级Xcode、升级RN版本及修改源码。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在xcode升级到Version 9.3 (9E145)之后RN的bug: Values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead

解决方法:
1. 降级xcode至9.2
2. 升级到rn 0.54以上
3. 用以下的方法改源码(个人使用的第三种)

原来是这样:
return [NSString stringWithFormat:@"%@|%g|%g|%g|%zd|%@",
    imageTag, size.width, size.height, scale, resizeMode, responseDate];
改为这样
return [NSString stringWithFormat:@"%@|%g|%g|%g|%lld|%@",
          imageTag, size.width, size.height, scale, (long long)resizeMode, responseDate];
就是把%zd -> %lld, 对应的值添加 (long long) 就行了



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值