代码环境:
RN: 0.44+
Xcode 9.3
打包时会报下面几种错误:
/node_modules/react-native/Libraries/Image/RCTImageCache.m:28:55: Enum values with underlying type ‘NSInteger’ should not be used as format arguments; add an explicit cast to ‘long’ instead
针对上述问题,解决方案有3种:
1.Xcode降级到8.3;
2.将RN版本升级到最高;
3.手动fixed问题: %zd 替换为 %ld ; eventLag 替换为 (long)eventLag
return [NSString stringWithFormat:@”%@|%g|%g|%g|%ld|%@”,
imageTag, size.width, size.height, scale, (long)resizeMode, responseDate];
RCTLogWarn(@”Native TextInput(%@) is %ld events ahead of JS - try to make your JS faster.”, self.text, (long)eventLag);