In mixing swift and oc project,target is static framework and enabled swift library evolution.
In Xcode12.0, everything is fine. When you upgrade to Xcode12.5, the project compiler error with:
Error Log
language
Showing All Messages
Prepare build
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Analyzing workspace
note: Using build description from disk
note: Build preparation complete
Build target TestFramework of project TestFramework with configuration Debug
....
/Users/zhangyu81/Library/Developer/Xcode/DerivedData/TestFramework-bnulduitccqmyadwwhoycushfino/Build/Products/Debug-iphoneos/TestFramework.framework/Modules/module.modulemap:9:12: error: header 'TestFramework-Swift.h' not found
header "TestFramework-Swift.h"
^
/Users/zhangyu81/Library/Developer/Xcode/DerivedData/TestFramework-bnulduitccqmyadwwhoycushfino/Build/Intermediates.noindex/TestFramework.build/Debug-iphoneos/TestFramework.build/Objects-normal/arm64/TestFramework.swiftinterface:6:19: error: could not build Objective-C module 'TestFramework'
@_exported import TestFramework
^
/Users/zhangyu81/Library/Developer/Xcode/DerivedData/TestFramework-bnulduitccqmyadwwhoycushfino/Build/Intermediates.noindex/TestFramework.build/Debug-iphoneos/TestFramework.build/Objects-normal/arm64/TestFramework.swiftinterface:1:1: error: failed to verify module interface of 'TestFramework'; it may have been damaged or it may have triggered a bug in the Swift compiler when it was produced
// swift-interface-format-version: 1.0
^
Command VerifyModuleInterface failed with a nonzero exit code
Build failed 2021/5/24, 5:07 PM 4.1 seconds
Build Setp: Compile Swift source files: Verify swiftinterface (arm64):
- Command VerifyModuleInterface failed with a nonzero exit code
Reason?
Enable BUILD_LIBRARY_FOR_DISTRIBUTION will trigger swiftinterface verification after all Swift compilation is completed, and the verification will use ModuleMap, but the "SWIFT. H" file referenced in ModuleMap has not been copied into the binary of Target, so the trigger error: "header 'TestFramework-Swift.h' not found"
Is it a Swift compiler bug? Thanks any reply
Post
Replies
Boosts
Views
Activity
It’s invalid by setting Other Linker Flags to compile
library dependencies with simulator on Xcode12 beta4 and after IDE,but it's ok on devices. By the way, this problem always exist untils Xcode12Beta6.
By Xcode10.2 Release Note Information with https://developer.apple.com/documentation/xcode-release-notes/xcode-10_2-release-notes
New Features
Implicit Dependencies now supports finding dependencies in Other Linker Flags for linked frameworks and libraries specified with -framework, -weak_framework, -reexport_framework, -lazy_framework, -weak-l, -reexport-l, -lazy-l, and -l. (7879587)