During the development of iOS programs, it is common to encounter the reuse of class names that refer to third-party libraries, resulting in conflicts.
Solution Solutions
1. Use the command to remove the same package from the. A library
2. Add the-dead_strip entry in the Compile link item
Additional notes:
-dead_strip: Delete the extra library symbols;
-all_load: Let the linker load all the found target files into the executable file;
-force_load: The thing that's done is the same as-all_load, but-force_load needs to specify the path to the library file to be loaded all
Use the command to remove the same package from the. A library as follows:
1. Create a temporary folder (for storing the. o files after each platform decompression), copy the. A library to the Temp folder
2. Create a subdirectory Armv7:mkdir armv7
3, remove the ARMV7 platform package: Lipo Xxx.a-thin armv7-output armv7/xxx-armv7.a
4. Query the list of files contained in the library (to see if there are any. o files that need to be removed): Ar-t armv7/xxx-armv7.a
5. Extract the object file (ie. o suffix file): cd armv7 && ar XV xxx-armv7.a
6. Find the conflicting. o suffix file, delete: RM xxx.o
7. RePack the object file (you can use the "4" command to confirm the successful removal before this operation): CD. && ar RCS xxx-armv7.a armv7/*.o
8, the other several platform (I386,ARM64,X86_64) package in accordance with the "2-7" operation
9. Re-merge. A file: Lipo create xxx-armv7.a xxx-i386.a xxx-arm64.a xxx-x86_64.a-output xxx.a
10, copy to the project overwrite source file: CP xxx.a Project source file path
A workaround that references third-party libraries in iOS projects to cause conflicts