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
1.10.0.beta.2 - XCFrameworks + static libs error #10058
Comments
@omarzl thanks for the great report. A PR landed for 1.10.0.rc.1 https://github.com/CocoaPods/CocoaPods/pull/10027/files that changes the regex, does that fix the issue? Can you try it? |
@dnkoutso Thank you for the response, I just tested it and its working fine!
Regarding the |
Sorry I am not sure what to recommend for |
This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem 👍 |
Just ran into this today, probably have a fix. FYI @dnkoutso |
Checking with those that might know more about what is causing the problem, if there is a good chance this will fix the issue called out in #10204 ? |
@igor-makarov Hi,After I saw this problem, I tried it. If I use a swift dynamic xcframework, there will still be problems. I noticed that the SWIFT_INCLUDE_PATHS in the Pods-xxx-config.xcconfig file uses "${PODS_CONFIGURATION_BUILD_DIR}/libname", which is correct It should be to use "${PODS_XCFRAMEWORKS_BUILD_DIR}/libname", I modified the demo of the author of this issue:CocoaPodsSupport 2.zip |
Report
What did you do?
We are migrating some code to static libraries using xcframeworks and we want to distribute it via Cocoapods.
In the demo there is a StaticLib folder with an xcframework that has only one class and its podspec, also there is an Example project with its Podfile.
I added the xcframework to the
vendored_frameworks
and after runningpod install
I noticed that it is setup in the Library Search PathsBut if I try to compile it gives me a
No such module 'StaticLib'
error, I found out that Xcode can't find theStaticLib.swiftmodule
so I modified theSWIFT_INCLUDE_PATHS
using thes.user_target_xcconfig
in theStaticLib.podspec
I read this PR #9720 but it only says that the
${HEADER_SEARCH_PATHS}
adds the static library headers but mine is not Obj-C, its pure Swift.Also its good to say that I built the xcframework using the xcodebuild command:
I would like to ask if I am doing something wrong or its missing something at Cocoapods code to include the
SWIFT_INCLUDE_PATHS
part, I could leave it like that and it works but maybe its not the correct way.Also I noticed another issue, when I try to run the project in a device it gives me this error:
The xcframework has a correct slice for
arm64
but theStaticLib-xcframeworks.sh
script can't find it.I changed line 50 from:
local target_arch_regex="[_\-]${target_arch}[\/_\-]"
to:
local target_arch_regex="[_\-]*${target_arch}[\/_\-]*"
And it compiles, copies the slice to the XCFrameworkIntermediates folder and it runs correctly, maybe the regex should be modified?
CocoaPods Environment
Stack
Installation Source
Plugins
Podfile
Project that demonstrates the issue
DemoProject.zip
The text was updated successfully, but these errors were encountered: