xcode 11.4 beta no longer allow non-universal frameworks

error: Building for iOS, but the linked framework 'xxxxx.framework' was built for tvOS + tvOS Simulator. (in target 'xyz' from project 'abc')

error: Building for iOS, but the linked framework 'yyyyy.framework' was built for tvOS + tvOS Simulator. (in target 'xyz' from project 'abc')

error: Building for iOS, but the embedded framework 'www_sim.framework' was built for iOS Simulator. (in target 'uvw' from project 'abc')


Any idea what to do here? turning the framework to optional doesn't work either.


We have frameworks that are built and use for simulator only, or tvOS only, or iOS only, is this no longer allowed in Xcode 11.4 going forward?

If so what is the workaround?

In my case, I faced this error:


xxxxxx.framework Building for iOS Simulator, but the linked and embedded framework was built for iOS.


In this case, I used a framework which doesn't contain binary for x86_64 (for simulator). I can build without that error if I choose real device as target.


In addition, I think Flutter team also faced the similar problem

https://flutter.dev/docs/development/ios-project-migration

In my case, we have a framework which is exported for devices only, so in previous versions of Xcode (11.3), I was importing and using it contitionally (#if !targetEnvironment(simulator)).


Now from Xcode 11.4, as I couldn't build the app for simulator, I've found a workaround with carthage's copy-frameworks run script.


  1. I removed the framework from both embedded and linked libraries.
  2. I've added a run script: https://imgur.com/99PniC8


Basically, it copies your framework to the application during build.

Please see this other thread for how to address this issue.

xcode 11.4 beta no longer allow non-universal frameworks
 
 
Q