New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XCFrameworks slice selection fails in multiple ways #10026
Comments
Yes! great issue report. If we need to update the regex care to open a PR for it? Target branch |
@lowip also would be awesome to expand our test surface area with the sample xcframeworks to ensure no regressions. |
@dnkoutso I'm preparing a PR. |
This was merged. |
I believe this bug or at least a variation of it might still be occurring. I'm getting a build issue only on my Development configuration because Cocoapods is selecting the wrong slice of the XCFramework. This prevents me from building for a simulator but it works normally when building for a device. It correctly selected the correct slice at first as shown on the logs. But then notice that it's still looking for the x86_64 architecture in the ios-arm64_armv7 folder. I'm using Xcode 12.2 and Cocoapods 1.10 to generate this. |
@trevinwisaksana Did you find a solution to that? |
My solution was adding this to the bottom of the Podfile
|
@ManueGE did you add this to |
@perrosnk |
@ManueGE Thank you very much for your help. Unfortunately it doesn't work for me. It seems that xcode still tries to use the ios slice (instead of ios-simulator) of the XCFrameworks that doesn't contain the x86_64 architecture. I have no idea why that is the case! |
I haven't found a long term solution to this. But I found a stop gap one by deleting the |
I'm having a similar issue- on CircleCi/remote, it's building for simulator all the time, never for device. Locally, it builds for device, but on CircleCI, it builds for simulator. I see the warning, and the failure (when try to verify on upload with app store). This is Plaid/LinkKit xc framework. |
@trevinwisaksana I had this same issue with the AppCenter Cocoapod today. I fixed it by removing an recursive path ( The recursive path was causing XCode to add every folder into the Link step including (incorrectly) the architecture folders inside of the xcframework, and using those paths it would find the wrong architecture framework. You can tell if this is the case by looking at the Link step log
|
@tplester it works! Thank you so much for this! |
If you still facing this issue i had to exclude arm64 from build settings like this:
|
Saved my day! Big thanks. Turned out that I recursively added all folders in my entire project to search paths. 🙈 |
@markus-mohemian Thank you very much for sharing this |
@markus-mohemian I found out if I removed the ios arm 64 slice, it would finally pick the simulator one. After i realized this I could google the problem better (chat GPT was of NO help). You saved my day! Thanks. |
Report
What did you do?
Integrating a pod distributed as a xcframework.
What did you expect to happen?
The xcframework pod to be handled properly by Cocoapods and for the target to compile without errors.
What happened instead?
The shell script generated by copy_xcframework_script.rb does not handle all xcframeworks correctly.
Example 1
Given the following xcframework:
When compiling on a device or using the Any iOS Device destination. The pod's
copy_xcframework_script.rb
will select the simulator slice instead of the device slice.This leads to the following compilation error on the target:
Example 2
Given the following xcframework:
When compiling on a device or using the Any iOS Device destination. The pod's
copy_xcframework_script.rb
will fail to select a slice in the xcframework:As you can see, the slice
ios-arm64_armv7
contains all the architectures needed (armv7 arm64
). The script fails to select this slice due to the following regex:That regex fails to match the target architecture in the string
ios-arm64_armv7
. A possible fix for that regex is:"[_\-]${target_arch}([\/_\-]|$)"
Notes
In both examples, the xcframeworks were:
CocoaPods Environment
Stack
Installation Source
Plugins
Podfile
Project that demonstrates the issue
Example 1 - SampleXCFramework.zip
Example 2 - AppboyKit.xcframework.zip
The text was updated successfully, but these errors were encountered: