A workaround that references third-party libraries in iOS projects to cause conflicts

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.