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] Jenkins-ERROR: Error cloning remote repo ‘origin‘
- jenkenis ERROR: Error fetching remote repo ‘origin‘ [How to Solve]
- Using Jenkins to compile APK Error [How to Solve]
- Vue Package Error: npm ERR! missing script: build
- [Solved] pod Error: back off restarting failed container
- [Solved] Android x relies on AAR errors: Failed to transform…
- [Solved] MariaDB Add Datas Error: SQL error [1366] [22007]: (cIncorrect string value: ‘\xE5\xBC\xA0\xE4\xB8\x89’ for column
- Jenkins Error: code=exited, status=127 [How to Solve]
- Android r compiles OTA times error: ExternalError: Invalid ro.product.property_source_order
- [Solved] The method getContextPath() from the type HttpServletRequest refers to the missing type String
- [Solved] Nacos Startup Error: [db-load-error]load jdbc.properties error
- [Solved] Nginx Certificate Fill Path Error: SSL: error:0200107B:system library:fopen:Unknown error:fopen
- [Solved] Vite Project jenkins Auto Package Error: failed to load config from ../vite.config.js You installed esbuild on
- [Solved] Xcode error: cycle inside*******; building could produce unreliable results.
- [Solved] dyld: Library not loaded: /System/Library/Frameworks/Network.framework/Network
- ArchLinux starts error after modifying MariaDB database path Can’t create test file /xxxxx/xxxxx-test
- The problem of error reporting caused by fluent swift
- Jenkins reported an error when running the docker permission in the shell script
- [Solved] UE4 Android Package Error: failed for task :permission_library:compileDebugJavaWithJavac
- jitpack.io ERROR: No build artifacts found [How to Solve]