- 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
本地腳本編譯出錯
- 選中項目 -> 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