iOS错误集
2021-11-25 本文已影响0人
Engandend
1、dyld: Library not loaded: @rpath/EasyVaasVR.framework/EasyVaasVR
完整实例:
dyld: Library not loaded: @rpath/EasyVaasVR.framework/EasyVaasVR
Referenced from: /private/var/mobile/Containers/Bundle/Application/37429DB7-3C1B-49D2-B0B4-B58DE8464811/EVVRDemo.app/EVVRDemo
Reason: image not found
原因是需要在target->General->embedded Binaries 里面将报错的framework加进去
2、"_namexxxxxxx", referenced from: -[classxxx moviePlayBackFinish:] in classxxx.o
错误事例:
"_IJKMPMoviePlayerPlaybackDidFinishReasonUserInfoKey", referenced from:
-[EldenPlayerView moviePlayBackFinish:] in EldenPlayerView.o
错误原因:_namexxxxxxx 定义了但是没有实现 比如在。h文件定义了
extern NSString* const aStr;
但是没有在.m中实现
NSString *const aStr = @"11111111111";
解决办法:
1、在对应的.m文件中实现NSString *const aStr = @"11111111111";
2、在.h里面不定义,直接就实现NSString *const aStr = @"11111111111";
3、reason: '*** Collection 《xxArray: 0x608000055d50》 was mutated while being enumerated.'
错误示例:
for (id obj in _labelRoomNumber.layer.sublayers) {
if ([obj isMemberOfClass:[CAGradientLayer class]]) {
[obj removeFromSuperlayer];
}
}
[_labelRoomNumber.layer addSublayer:gradientLayer];
错误原因:
因为一边便利数组,又同时修改这个数组里面的内容,导致崩溃
解决方法:
这个就看怎么实现,比较多,比如先将符合条件的数据存起来,等遍历结束之后在去处理
可参考这篇文章
4、Apple Mach-O Linker (ld) Error Group
clang: error: linker command failed with exit code 1 (use -v to see invocation)
这种点不进去的错误,目前遇到的原因是
1、修改一个类名的时候和另一个类名相同,这种原因的话,需要自己去排查究竟是那个名字相同
2、可能是不支持bitcode 尝试在build setting 中搜索 “enable bitcode“ 将YES改为NO
5、/Users/xxxx/Pods/Target Support Files/Pods-xxx/Pods-xxx-frameworks.sh: line 132: ARCHS[@]: unbound variable
错误示例:
sent 598681 bytes received 70 bytes 1197502.00 bytes/sec
total size is 599078 speedup is 1.00
/Users/xxx/Pods/Target Support Files/Pods-xxx/Pods-xxx-frameworks.sh: line 132: ARCHS[@]: unbound variable
Command PhaseScriptExecution failed with a nonzero exit code
用真机可以运行, 模拟器运行报这个错。是由于setting中的设置错误。
修改后:TARGETS---->Build Settings -----搜索:VALID_ARCHS
添加模拟器支持架构:x86_64
完整结构为:arm64 arm64e armv7s x86_64
image.png