How to solve the project .a file .o conflict

The project uses yuemengsdk.a now joined the Baidu libbaiduNaviSDK.a with conflict

We need to delete the file .o .a file

 

first step

First project did not play a good backup in case .. .. Where reasoning ~~

The second step

In the new folder to the desktop needs .a file in the new folder

 

 

cd to the directory schema to view the cup command line of the file as follows

fenghedeMacBook-Pro:合并 fenghe$ lipo -info libbaiduNaviSDK.a
Architectures in the fat file: libbaiduNaviSDK.a are: i386 armv7 x86_64 arm64 

We see supports four i386 armv7 x86_64 arm64 Here we introduce the next

.A significant because it contains four kinds of architecture, so we have to read them separately and split

.A execute the command line to read files arm64 architecture

lipo libbaiduNaviSDK.a -thin arm64 -output libbaiduNaviSDK_arm64.a

Then read the three other architectures the same way
the effect after completion of reading of the following 

Because we want to split the different types of architecture. After the split there will be a lot of files, so we will each architecture into the new folder, to prevent confusion after split

 

Then use the command line are different architectures split and delete duplicate files .o

cd to the next folder directory file arm64

ar -x libbaiduNaviSDK_arm64.a

Run the above command line in four folders directory

Finished on behalf of the split is completed. Then search error .o files and delete

Then merge files (before this time libbaiduNaviSDK.a file in the root directory can be deleted, because it will generate a new file after the merger.)

Executed in arm64 file directory

fenghedeMacBook-Pro:arm64 fenghe$ libtool -static -o ../libbaiduNaviSDK_arm64.a *.o

执行完毕后会在根目录下生成libbaiduNaviSDK_arm64.a文件,这就是合并完成的文件.  还需要在其他三个文件夹下执行对应的上述命令行  执行完毕效果如下

 

 

最后将所有架构类型的.a进行终极合并

cd 到根目录下 执行

fenghedeMacBook-Pro:合并 fenghe$ lipo -create -output libbaiduNaviSDK.a libbaiduNaviSDK_arm64.a libbaiduNaviSDK_armv7.a libbaiduNaviSDK_i386.a libbaiduNaviSDK_x86_64.a

执行完毕后会在根目录下生成新的.a文件.将其替换掉项目中的即可

 

欢迎大家加入我的iOS(OC/swift/flutter)技术群 不闲聊只技术交流 闲聊勿扰了

201708926

 

Guess you like

Origin www.cnblogs.com/baxiu/p/11276959.html