Egret社区
xcode打包ios时候, Build Settings Other Linker Flags **增加参数-ObjC** , 报符号冲突。 去掉链接选项-ObjC后,不再报错。 但第三方平台提供的api必须添加-ObjC。 尴尬。  具体报错如下:不要怕,这其实就是MakeFile, 具体可以看到Ld命令倒数第6行,只链接一次[color=rgba(0, 0, 0, 0.85)]-lEgretNativeIOS ,并没有多次链接这个库。

[color=rgba(0, 0, 0, 0.85)]Ld /Users/zouzhiqiang/Library/Developer/Xcode/DerivedData/ios-template-cvttvzjsuozuicfnshjqcxwcdssq/Build/Products/Debug-iphonesimulator/demo.app/demo normal x86_64 (in target 'demo' from project 'ios-template')
[color=rgba(0, 0, 0, 0.85)]    cd /Users/zouzhiqiang/Downloads/demo_ios
[color=rgba(0, 0, 0, 0.85)]    /Users/zouzhiqiang/Downloads/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -target x86_64-apple-ios9.0-simulator -isysroot /Users/zouzhiqiang/Downloads/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk -L/Users/zouzhiqiang/Library/Developer/Xcode/DerivedData/ios-template-cvttvzjsuozuicfnshjqcxwcdssq/Build/Products/Debug-iphonesimulator -L/Users/zouzhiqiang/Downloads/demo_ios/egret-libs -L/Users/zouzhiqiang/Downloads/demo_ios/AdSDK/JSAdSDK -L/Users/zouzhiqiang/Downloads/demo_ios/AdSDK/ThirdAdSDK/GDTAdSDK_V_4.11.8 -F/Users/zouzhiqiang/Library/Developer/Xcode/DerivedData/ios-template-cvttvzjsuozuicfnshjqcxwcdssq/Build/Products/Debug-iphonesimulator -F/Users/zouzhiqiang/Downloads/demo_ios -F/Users/zouzhiqiang/Downloads/demo_ios/AdSDK/JSAdSDK -F/Users/zouzhiqiang/Downloads/demo_ios/AdSDK/ThirdAdSDK/BUAdSDK_v_3.1.0.0 -F/Users/zouzhiqiang/Downloads/demo_ios/AdSDK/ThirdAdSDK/GoogleAdSDK_v_7.58.0 -filelist /Users/zouzhiqiang/Library/Developer/Xcode/DerivedData/ios-template-cvttvzjsuozuicfnshjqcxwcdssq/Build/Intermediates.noindex/ios-template.build/Debug-iphonesimulator/demo.build/Objects-normal/x86_64/demo.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/zouzhiqiang/Library/Developer/Xcode/DerivedData/ios-template-cvttvzjsuozuicfnshjqcxwcdssq/Build/Intermediates.noindex/ios-template.build/Debug-iphonesimulator/demo.build/Objects-normal/x86_64/demo_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -stdlib=libc++ -fobjc-arc -fobjc-link-runtime -ObjC -dead_strip -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/zouzhiqiang/Library/Developer/Xcode/DerivedData/ios-template-cvttvzjsuozuicfnshjqcxwcdssq/Build/Intermediates.noindex/ios-template.build/Debug-iphonesimulator/demo.build/demo.app-Simulated.xcent -lGDTMobSDK -framework JSAdSDK -weak_framework GoogleMobileAds -framework CoreServices -framework SafariServices -lc++ -lresolv.9 -framework JSAdSDK -lGDTMobSDK -lsqlite3 -framework GoogleAppMeasurement -lxml2 -framework BUAdSDK -lz -framework AssetsLibrary -framework GoogleUtilities -framework Photos -framework AVFoundation -framework GoogleMobileAds -framework AdSupport -framework SystemConfiguration -framework CoreTelephony -framework CoreLocation -framework nanopb -weak_framework GoogleAppMeasurement -framework CoreGraphics -framework CoreMotion -framework CoreMedia -framework MediaPlayer -framework WebKit -framework QuartzCore -framework Accelerate -lEgretNativeIOS -framework nanopb -framework AudioToolbox -framework BUAdSDK -framework CFNetwork -framework MessageUI -framework Security -framework StoreKit -framework OpenGLES -framework JavaScriptCore -licucore -framework BUFoundation -framework GoogleUtilities -framework BUFoundation -liconv -framework Foundation -framework OpenAL -Xlinker -dependency_info -Xlinker /Users/zouzhiqiang/Library/Developer/Xcode/DerivedData/ios-template-cvttvzjsuozuicfnshjqcxwcdssq/Build/Intermediates.noindex/ios-template.build/Debug-iphonesimulator/demo.build/Objects-normal/x86_64/demo_dependency_info.dat -o /Users/zouzhiqiang/Library/Developer/Xcode/DerivedData/ios-template-cvttvzjsuozuicfnshjqcxwcdssq/Build/Products/Debug-iphonesimulator/demo.app/demo

[color=rgba(0, 0, 0, 0.85)]duplicate symbol '_OBJC_CLASS_$_CryptoUtil' in:
[color=rgba(0, 0, 0, 0.85)]    /Users/zouzhiqiang/Downloads/demo_ios/egret-libs/libEgretNativeIOS.a(VersionController.o)
[color=rgba(0, 0, 0, 0.85)]    /Users/zouzhiqiang/Downloads/demo_ios/egret-libs/libEgretNativeIOS.a(___src_util_m.o)
[color=rgba(0, 0, 0, 0.85)]duplicate symbol '_OBJC_METACLASS_$_CryptoUtil' in:
[color=rgba(0, 0, 0, 0.85)]    /Users/zouzhiqiang/Downloads/demo_ios/egret-libs/libEgretNativeIOS.a(VersionController.o)
[color=rgba(0, 0, 0, 0.85)]    /Users/zouzhiqiang/Downloads/demo_ios/egret-libs/libEgretNativeIOS.a(___src_util_m.o)
[color=rgba(0, 0, 0, 0.85)]ld: 2 duplicate symbols for architecture x86_64
[color=rgba(0, 0, 0, 0.85)]clang: error: linker command failed with exit code 1 (use -v to see invocation)

[color=rgba(0, 0, 0, 0.85)]请egret官方有啥办法吗








分享到 :
0 人收藏

1 个回复

倒序浏览
panqiangqiang  初学乍练 | 2020-7-27 18:38:28
基本解决了, 自己总结下吧, 目标:删除两个.o文件中的某个,测试后发现需要删除的是 __src_util_m.o 。删除与重组过程参考 https://www.cnblogs.com/baxiu/p/11276959.html
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|京网文[2014]0791-191号|京ICP证150115号|Egret社区 ( 京ICP备14025619号 )

Powered by Discuz! X3.4 © 2001-2019 Comsenz Inc.

返回顶部