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

  • ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code.xcodebuild
    编译没有通过

私有库中依赖私有库

本地验证、远端验证

pod lib lint HYVideoPlayerKit.podspec --sources=索引仓库地址,https://github.com/CocoaPods/Specs.git --verbose --allow-warnings
Unable 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 with e.......
解决办法:

Targets->Build Setting->Linking->Match-o-Type ,修改为Static Library,再次编译,编译成功。

https://blog.csdn.net/qq_40697071/article/details/99055070



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 executable

HYPhotoLibraryKit_Example.app does not contain a valid Info.plist, so it cannot be installed on “Bill”的 iPhone (2)
(“CFBundleExecutable” specifies a file that is not executable)



ld: 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 EasyDarkMode
clang: error: linker command failed with exit code 1 (use -v to see invocation)

https://blog.csdn.net/longshihua/article/details/78054446

很奇怪,为什么已经从项目中删除了文件和文件夹还是报这个警告呢?

去掉警告的办法如下:

1.选择工程, 编译的 (targets)

2.选择 Build Settings 菜单

3.查找 Library Search Paths 和 Framework Search Paths, 删掉编译报warning的路径即OK



ld: framework not found ***

进入Build Settings
搜索OTHER LINKER FLAGS
-framework这个标志是给你带.framework的文件使用的,所以你需要找出来那些不需要-framework的框架,把它下面的-framework删除掉。



dyld: Library not loaded: @rpath/EasyDarkMode.framework/EasyDarkMode
Referenced from: /private/var/containers/Bundle/Application/92D0BF75-B0DF-48AD-9439-A70DD4D8DD59/HYPhotoLibraryKit_Example.app/HYPhotoLibraryKit_Example
Reason: image not found
dyld: launch, loading dependent libraries
DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib

解决方案:在Podfile中,注释use_frameworks!后,重新执行pod install。



podspec 验证的时候 报错

  • ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code.
  • NOTE | 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错误。

https://www.jianshu.com/p/bdb1db6c9db4/

pod spec 验证发布时的参数

Usage:

    $ pod lib lint [PODSPEC_PATHS ...]

      Validates the Pod using the files in the working directory.

Options:
 --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=https://cdn.cocoapods.org/     The sources from which to pull dependent
                                             pods (defaults to
                                             https://cdn.cocoapods.org/). 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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章