Podspec私有库集成遇到的错误(二)

Podspec私有库集成遇到的错误(二)

2023年6月24日发(作者:)

Podspec私有库集成遇到的错误(⼆)ERROR | [iOS] xcodebuild: Returned an unsuccessful exit uild编译没有通过私有库中依赖私有库本地验证、远端验证pod lib lint c --sources=索引仓库地址,/CocoaPods/ --verbose --allow-warningsUnable to find a specification for `HYVideoPlayerKit` depended upon by `HYEditVideoKit`Framework not found EasyDarkMode删除重新编译Build Settings 找到Other Linker Flags中找到你的那个XXXX框架然后删除,重新编译就可以成功。异常:XCode编译出错异常:ld: framework not found Kernel clang: error: linker command failed 解决办法:Targets->Build Setting->Linking->Match-o-Type ,修改为Static Library,再次编译,编译成功。Command /bin/sh failed with exit code 1本地脚本编译出错1. 选中项⽬ -> TARGETS->Build Phases-> “Bundle React Native code and images”2.勾选 “Run script only when installing”“CFBundleExecutable” is not specified“CFBundleExecutable” specifies a file that is not executableHYPhotoLibraryKit_ does not contain a valid , so it cannot be installed on “Bill”的iPhone (2)(“CFBundleExecutable” specifies a file that is not executable): warning: directory not found for option '-F/Users/jiangweidong/Library/Developer/Xcode/DerivedData/HYPhotoLibraryKit-ffxhyajjfaekfggrljgbkkndupve/Build/Products/Debug-iphoneos/EasyDarkMode'ld: warning: directory not found for option '-F/Users/jiangweidong/Library/Developer/Xcode/DerivedData/HYPhotoLibraryKit-ffxhyajjfaekfggrljgbkkndupve/Build/Products/Debug-iphoneos/HYBasicToolKit'ld: warning: directory not found for option '-F/Users/jiangweidong/Library/Developer/Xcode/DerivedData/HYPhotoLibraryKit-ffxhyajjfaekfggrljgbkkndupve/Build/Products/Debug-iphoneos/HYPhotoLibraryKit'ld: warning: directory not found for option '-F/Users/jiangweidong/Library/Developer/Xcode/DerivedData/HYPhotoLibraryKit-ffxhyajjfaekfggrljgbkkndupve/Build/Products/Debug-iphoneos/HYVideoPlayerKit'ld: warning: directory not found for option '-F/Users/jiangweidong/Library/Developer/Xcode/DerivedData/HYPhotoLibraryKit-ffxhyajjfaekfggrljgbkkndupve/Build/Products/Debug-iphoneos/SDWebImage'ld: warning: directory not found for option '-F/Users/jiangweidong/Library/Developer/Xcode/DerivedData/HYPhotoLibraryKit-ffxhyajjfaekfggrljgbkkndupve/Build/Products/Debug-iphoneos/XHNetworkCache'ld: framework not found EasyDarkModeclang: error: linker command failed with exit code 1 (use -v to see invocation)很奇怪,为什么已经从项⽬中删除了⽂件和⽂件夹还是报这个警告呢?去掉警告的办法如下:1.选择⼯程, 编译的 (targets)2.选择 Build Settings 菜单3.查找 Library Search Paths 和 Framework Search Paths, 删掉编译报warning的路径即OKld: framework not found ***进⼊Build Settings搜索OTHER LINKER FLAGS-framework这个标志是给你带.framework的⽂件使⽤的,所以你需要找出来那些不需要-framework的框架,把它下⾯的-framework删除掉。dyld: Library not loaded: @rpath/ork/EasyDarkModeReferenced from: /private/var/containers/Bundle/Application/92D0BF75-B0DF-48AD-9439-A70DD4D8DD59/HYPhotoLibraryKit_/HYPhotoLibraryKit_ExampleReason: image not founddyld: launch, loading dependent librariesDYLD_INSERT_LIBRARIES=/Developer/usr/lib/:/Developer/Library/PrivateFrameworks/ork/解决⽅案:在Podfile中,注释use_frameworks!后,重新执⾏pod install。podspec 验证的时候 报错ERROR | [iOS] xcodebuild: Returned an unsuccessful exit | xcodebuild: clang: error: linker command failed with exit code 1 (use -v to see invocation)如果私有库添加了静态库或者dependency⽤了静态库那么执⾏pod lib lint还有pod spec lint时候需要加上—user-libraries选项否则会出现'The 'Pods' target has transitive dependencies错误。pod spec 验证发布时的参数Usage: $ pod lib lint [PODSPEC_PATHS ...] Validates the Pod using the files in the working s: --quick Lint skips checks that would require to download and build the spec --allow-warnings Lint validates even if warnings are present --subspec=NAME Lint validates only the given subspec --no-subspecs Lint skips validation of subspecs --no-clean Lint leaves the build directory intact for inspection --fail-fast Lint stops on the first failing platform or subspec --use-libraries Lint uses static libraries to install the spec --use-modular-headers Lint uses modular headers during installation --use-static-frameworks Lint uses static frameworks during installation --sources=/ The sources from which to pull dependent pods (defaults to /). Multiple sources must be comma-delimited --platforms=ios,macos Lint against specific platforms (defaults to all platforms supported by the podspec). Multiple platforms must be comma-delimited --private Lint skips checks that apply only to public specs --swift-version=VERSION The `SWIFT_VERSION` that should be used to lint the spec. This takes precedence over the Swift versions specified by the spec or a `.swift-version` file --include-podspecs=**/*.podspec Additional ancillary podspecs which are used for linting via :path --external-podspecs=**/*.podspec Additional ancillary podspecs which are used for linting via :podspec. If there are --include-podspecs, then these are removed from them --skip-import-validation Lint skips validating that the pod can be imported --skip-tests Lint skips building and running tests during validation --test-specs=test-spec1,test-spec2,etc List of test specs to run --analyze Validate with the Xcode Static Analysis tool --configuration=CONFIGURATION Build using the given configuration (defaults to Release) --allow-root Allows CocoaPods to run as root --silent Show nothing --verbose Show more debugging information --no-ansi Show output without ANSI codes --help Show help banner of specified command–use-libraries使⽤静态库,如果在⼯程中使⽤到了静态库,但不在编译的时候加上这句话,就不能编译通过。如果私有库中存在.a⽂件,那么必须加上这个后缀。–allow-warnings允许警告,警告可能会导致编译不能通过,⼀般需要加上它。–sources=BIFaceSDK,BIEncrypt说明库的依赖关系,这⾥说明了库依赖于BIFaceSDK,BIEncrypt这两个pods。–skip-import-validation和–skip-tests这两个命令可以跳过部分验证环节,如果发现⼯程怎么都lint不过,那么可以尝试⼀下这个。需要注意的地⽅:–skip-import-validation和–skip-tests这样操作之后,确实可以实现pod的更新,但是最终⼯程中的pod可能会发⽣丢失部分⽂件,找不到索引等意外。因此,还是要谨慎操作哈!经典错误 - ERROR | [iOS] xcodebuild: Returned an unsuccessful exit 这次报错事因为再依赖三⽅库中有静态库,⽽三⽅的阿⾥云只⽀持真机架构所以在 .podspec中添加指定的架构_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' } _target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }这个问题真的是很令⼈头疼,折腾了两天,也看了⽹上的⼀些解决办法,包括StackOverFlow,有成功的也有不成功的,成功的我也觉得不是最佳。我就去翻CocoaPods GitHub Issues,终于让我翻到了。Undefined symbols for architecture i386 even though it's omitted from VALID_ARCHS #8129Fix linting when armv7 is included but i386 isn't #81598129这个问题在 CocoaPods .2 版本得到了修复1. 先升级到CocoaPods Beta版$ sudo gem install -n /usr/local/bin cocoapods --pre2. 编辑podspec,加⼊ pod_target__target_xcconfig = { 'VALID_ARCHS' => 'arm64 armv7 x86_64' }什么是 pod_target_xcconfig ?Any flag to add to the final private pod target xcconfig file.要添加到最终私有pod⽬标xcconfig⽂件的任何标志。Showing Recent Errors OnlyUndefined symbol: _Decoder_Interface_init私有库中包含有第三⽅的静态库。解决办法需要在 podspec中添加:静态库的绝对路径ed_libraries = 'HYKeyboardKit/Classes/RecordAudio/BlazeiceAudio/voiceConvert/lib/*.{a}'

发布者:admin,转转请注明出处:http://www.yc00.com/news/1687607349a24197.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信