1. General
Today, Xcode was upgraded to 12.5.1. When compiling the existing project, the problem of swift incompatibility reported by referring to the framework compiled by swift appeared again. According to previous experience, just pack it again with the latest version of Xcode, but my colleague recommended a configuration to avoid the problem of swift incompatibility in the later stage, but this configuration was set, But it triggered a series of changes.
2. Project configuration and script modification
2.1. Modify the build libraries for distribution configuration item
This upgrade will ‘build settings’ – & gt` Build Options`->` Build libraries for distribution ` is set to yes, which has solved the problem of incompatibility in the later stage (it is set temporarily and needs to be verified in the later stage).
two point two Modify project build system
Because ‘build libraries for distribution’ is set to yes, ‘project settings’ – & gt; under’ file ‘in the Project menu` Build system needs to be changed from ‘legacy build system’ to ‘new build system (default)’. Otherwise, packaging will fail with the following error.
two point three Modify the universal aggregate script file
Our project uses a universalaggregate script file to execute the other two script files. One is xxxxkitaggregate of IOS_ IOS, one is xxxxkitaggregate of tvos_ tvOS。 In the universalaggregate script, add ` – usemodernbuildsystem = no ‘after the two instructions respectively. If it is set to no, it means that the build system adopts’ legacy build system’, and if it is set to yes, it adopts’ new build system (default) ‘. As follows:
xcodebuild -target "XXXXKitAggregate_iOS" BUILD_DIR="${BUILD_DIR}" -UseModernBuildSystem=NO
xcodebuild -target "XXXXKitAggregate_tvOS" BUILD_DIR="${BUILD_DIR}" -UseModernBuildSystem=NO
Add ` – usemodernbuildsystem = no ‘to avoid disk read-write errors caused by simultaneous packaging of IOS and tvos
the error is as follows:
--error: error: accessing build database "xxx/build/XCBuildData/build.db": disk I/O error
Or:
accessing build database "/Users/xxxx/Work/Git/NLDFramework/XXXToolKit/build/XCBuildData/build.db": database is locked Possibly there are two concurrent builds running in the same filesystem location.
2.4 modify the packaging script (xxxxkitaggregate_ios, xxxxkitaggregate_tvos)
Add ‘RM – RF ${build_dir}’ before the ‘xcodebuild – target “XXXX’ command, and remove ‘clean’ from the ‘xcodebuild’ command, as shown in the following figure:
Before each build, delete the build file directory to avoid the following errors:
Could not delete `/Users/xxxx/Work/Git/NLDFramework/XXXMenuKit/build` because it was not created by the build system.
2.5 modify the configuration in Jenkins project
If the framework is packaged through Jenkins, you need to find the build configuration under the corresponding project configuration in Jenkins and check ‘allow failing build results’. Otherwise, Jenkins packaging will fail due to disk read-write exceptions. Check it, that is, ignore the exceptions and put the packaged framework in the specified location.
If not checked, Jenkins’s final output results are as follows:
When checked, Jenkins’s final output results are as follows:
Read More:
- [Solved] Xcode13.0 Package Error: Code signing “AipBase.framework“ failed.
- [Solved] Unity Import Xcode Project Error: iOS framework addition failed due to a CocoaPods installation failure.
- [Solved] Xcode error: cycle inside*******; building could produce unreliable results.
- How to Solve Xcode M1 simulator Error
- [Solved] Unity Publish WebGL Error: Unable to parse Build/webTest2.framework.js.gz
- [Solved] R Install XML package error: configuration failed for package ‘XML’
- When integrating redis with SSM framework, error creating bean with name ‘rediscontentserviceimpl’ defined in file
- [Solved] NPM Error: gyp: No Xcode or CLT version detected!
- [Go] Solve can’t load package: cannot find module providing package github.com/xxxxx
- Xcode debugging for the real iPhone Error: code signature version is no longer supported
- [Solved] dyld: Library not loaded: /System/Library/Frameworks/Network.framework/Network
- How to Solve “Status bar could not find cached time string image. Rendering in-process.” in Xcode
- Setting label malloc in MAC development_ error_ Break breakpoint (Xcode)
- [Solved] Xcode13.1 Upgrade Error: CocoaPods installed but not working Failed to build gem native extension
- Flutter Xcode Module not found or LibreSSL SSL_connect: SSL_ERROR_SYSCALL
- [Solved] Xcode ObservableObject Error: Unknown attribute ‘ObservableObject‘
- [Solved] latex Import ntheorem Package Error: Package ntheorem Error: Theorem style plain already defined.
- An error was reported when Maven package was running the packaged jar package: there is no main list attribute in xxx.jar, which can be solved by configuring Maven plugin
- Go build package error: TARGET_OS_MAC & IOMasterPort
- Vue Package Error: npm ERR! missing script: build