简体   繁体   中英

Target Integrity Issue: "Building for iOS, but the embedded framework 'X.framework' was built for iOS Simulator"

Our organization distributes iOS pre-compiled dynamic frameworks using the method which we understood to be previously canonical prior to Xcode 11.4. It involved building two pre-compiled frameworks, one for device and one for simulator, and then having the correct one used at runtime. The latter involved modifying "Other Linker Flags" to select only the framework which should be used depending on how "Any iOS Simulator SDK" and "Any iOS SDK" were set, and adding a new run script phase to the Build Phases which strips out the simulator slices from device builds.

When moving to Xcode 11.4, we now encounter the target integrity error:

"Building for iOS, but the embedded framework 'X.framework' was built for iOS Simulator."

We gather than migrating to XCFramework is one way to solve this problem. But for those people who wish (or need) to continue for now to use earlier versions of the pre-compiled frameworks build as dynamic frameworks, what can be changed in the project settings to overcome this error?

had the same issue and I could eventually solve it by launching the "Clean Build Folder" from the "Product" dropdown.. Here is a screenshot just in case, hope it solve your issue too!

Through talking with Apple we concluded that this flaw was by design, and that a migration from dynamic frameworks to xcframeworks was essentially required. If there's a technical way around this problem, we never found it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM