Cordova - XCode10编译热更新插件错误解决方法!

时间:2023-03-08 17:19:37
Cordova - XCode10编译热更新插件错误解决方法!

操作系统:OSX10.14

XCode:10.1

热更新插件:https://github.com/nordnet/cordova-hot-code-push

这个热更新插件,在安卓下编译,没有问题,可以顺利编译,但是在最新版的XCode下编译,却出现错误了!

错误信息:ld: library not found for -lstdc++.6

错误截图:

Cordova - XCode10编译热更新插件错误解决方法!

看错误提示,就是缺少“lstdc++.6”的库,于是搜索解决方法,最终解决了!

解决方法:把缺少的库放到对应目录中。

库下载地址:https://codeload.github.com/MonkeyHZT/libstdc-6.0.9/zip/master

下载完毕之后,解压缩目录,里面有4个文件夹,在OSX里的shell窗口中,分别执行下面四条命令,每次执行完一条命令,打开命令索引对应的文件夹,把里面文件拷贝到命令打开的文件夹中。

1,

open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/

拷贝文件夹1的文件到这个命令打开的目录中。

2,

open /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/

拷贝文件夹2的文件到这个命令打开的目录中。

3,

open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/

拷贝文件夹3的文件到这个命令打开的目录中。

4,

open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/

拷贝文件夹4的文件到这个命令打开的目录中。

随后打开XCode,打开热更新工程,编译吧,应该解决问题了!

libc++是啥?https://www.cnblogs.com/sunylat/p/9938303.html

参考:

https://github.com/MonkeyHZT/libstdc-6.0.9