This content originally appeared on DEV Community and was authored by Agapov Alexey
TL;DR:
❌ error:
The package access level used on 'method' requires a package name; set it with the compiler flag -package-name
If you don't have SPM, here is the fix in .podspec
file:
s.pod_target_xcconfig = {
'OTHER_SWIFT_FLAGS' => '-package-name MyPackage'
}
MyPackage
should be your Package/Pod name.
We still have a large codebase on Swift that is managed by Cocoapods.
Tons of modules.
We don't want to use SPM as our main package manager, so we have to fix an error with package access modifier.
The fix is adding a flag with -package-name MyPackage
inside build settings. But you probably want to do it in source of cocoapods generation, not in Xcode itself.
# MyPackage.podspec
s.pod_target_xcconfig = {
'OTHER_SWIFT_FLAGS' => '-package-name MyPackage'
}
This content originally appeared on DEV Community and was authored by Agapov Alexey
Agapov Alexey | Sciencx (2024-10-15T09:12:52+00:00) How to use Swift package access modifier with Cocoapods. Retrieved from https://www.scien.cx/2024/10/15/how-to-use-swift-package-access-modifier-with-cocoapods/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.