Cordova: Build Without “-all_load”

*爱你&永不变心* 提交于 2019-12-23 23:26:10

问题


I am having an issue while building an iOS app with Cordova and a third-party plugin that ships with a native SDK. Cordova requires Linker Flag "-all_load" which other SDK is not happy about.

I read this post about "-all_load" flag: Alternative for all_load in XCode's Other Linker Flags sounds like I might be able to use "-force_load" instead and specify the "object file" that Cordova wants.

I do not know much about the Cordova's internals. Has anyone had the same problem and was successfully able to compile Cordova with "force_load"? Could you provide your Cordova specific "force_load" syntax?


回答1:


The problem here is that libraries containing categories did not properly load in earlier versions of Xcode. As of 4.6 they should be loading, and you should be able to just use the linker flag "-ObjC", which tells the linker to examine the libraries for such things.

If for some reason the -ObjC flag does not work, the syntax for the force load is"

-force_load $(BUILT_PRODUCTS_DIR)/libxyz.a



回答2:


Thanks to pointers from @David H, I was able to replace the Other Linker Flags "-all_load" switch by:

-force_load $(BUILT_PRODUCTS_DIR)/libCordova.a

Cordova now compiles and starts fine without breaking my other libraries that do not like "-all_load"



来源:https://stackoverflow.com/questions/16683090/cordova-build-without-all-load

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!