美文网首页
2019-03-18

2019-03-18

作者: biyu6 | 来源:发表于2018-10-18 14:26 被阅读0次

    1.Xcode10报错:library not found for -lstdc++.6.0.9

    错误提示: library not found for -lstdc++.6.0.9
    错误原因:苹果在XCode10 和 iOS12 中移除了libstdc++ 这个库,由libc++ 这个库代替

    解决方法:
    将 libstdc++.6、libstdc++、libstdc++6.0.9 三个文件拷贝到Xcode配置的路径
    三个文件的下载地址为: https://pan.baidu.com/s/1WmOuLKTzerIMYnTKlkOyzw 提取码: i4qg
    真机路径:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/
    模拟器路径:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/

    2.关于Architectures 的警告解决

    项目中的警告如下:


    warning.png

    具体警告:
    :-1: Mapping architecture arm64 to x86_64. Ensure that this target's Architectures and Valid Architectures build settings are configured correctly for the iOS Simulator platform. (in target 'WallMeet')
    :-1: Mapping architecture armv7s to i386. Ensure that this target's Architectures and Valid Architectures build settings are configured correctly for the iOS Simulator platform. (in target 'WallMeet')

    解决方法:
    网上查的大多数都是关于Architectures 和 Valid Architectures 的配置问题,先排除这种可能,如果你的配置是下面这样的话,那就是正确的:


    正确的配置.png

    排除了上面的情况,再接着往下:
    出现这种警告,的确是Architectures 和 Valid Architectures 的配置,如果上面的配置是正确的,再看看下面这个配置界面,我报错的原因就是多了方框中的这个配置,将方框中的配置全部删除后就可以了:


    我出错的原因.png

    正确的如下:


    正确配置.png

    3.linker command failed with exit code 1 (use -v to see invocation)

    错误详情:

    ld: bitcode bundle could not be generated because '/Users/biyu6/Documents/CodingCode/OnlineEdu/OnlineEdu/IJKMediaFramework.framework/IJKMediaFramework(IJKAVMoviePlayerController.o)' was built without full bitcode. All object files and libraries for bitcode must be generated from Xcode Archive or Install build file '/Users/biyu6/Documents/CodingCode/OnlineEdu/OnlineEdu/IJKMediaFramework.framework/IJKMediaFramework' for architecture armv7

    错误解决:

    关闭bitcode
    ”Build Settings”->”Enable Bitcode” 改为 NO


    修改.png

    PS:iOS中bitcode是可选项,watchOS中bitcode是必选项,MacOS不支持bitcode。

    错误的原因:

    一般这个问题出在引用第三方库上,有些第三方库不支持bitcode,在Archives打包时就会报这个错。

    当提交app到AppStore上时,Xcode会将程序编译为一个中间表现形式(bitcode)。然后AppStore会再将这个botcode编译为可执行的64位或32位程序。 bitcode允许苹果在后期重新优化程序的二进制文件,而不需要重新提交一个新的版本到AppStore上。

    相关文章

      网友评论

          本文标题:2019-03-18

          本文链接:https://www.haomeiwen.com/subject/pdzjzftx.html