在將ios項目進行Archive打包時,Xcode提示以下錯誤:
[BEROR]CodeSign error: Certificate identity ‘iPhone Distribution: ***.’ appears more than once in the keychain. The codesign tool requires there only be one.
原因:那么出現此問題的原因是多個證書之間沖突造成兩種解決方法如下:
解決辦法:打開mac系統的“實用工具”-“鑰匙串訪問”-“我的證書”中,會看到有證書名一模一樣的,那么請將早期的證書刪除掉,重啟Xcode;
在真機或者模擬器編譯程序的時候可能會遇到下面的錯誤:
Could not change executable permissions on the application.
原因:擁有相同的bundle Identifier已經在設備上運行
解決辦法:刪除設備中或者模擬器中的App。
編譯時遇到如下錯誤:
A valid provisioning profile matching the application's Identifier 'XXXX' could not be found
原因:缺少證書或者是在Code Signing Identity處沒有選擇對應的證書或者是證書不對應
解決辦法:重裝證書,檢查證書是否是否選擇是否對應。
編譯時遇到如下錯誤:
ld: library not found for -lmp3lameclang: error: linker command failed with exit code 1 (use -v to see invocation)
原因:一般是多人編輯同一個工程時其中一人沒將某個庫上傳導致的
解決辦法:上傳具體靜態庫
Xcode7之后真機測試更加方便,但是也會出現各種問題
Could not launch “******”
process launch failed: Security
原因:沒認證apple id
解決方法:打開手機設置-通用-描述文件與設備管理
找到開發商應用,點擊進入,信任要測試的應用。
This application's application-identifier entitlement does not match that of the installed application. These values must match for an upgrade to be allowed.
原因:測試機上有標識符相同的APP
解決方法:刪掉,刪掉,掉,。
編譯時遇到如下錯誤:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Auto Layout still required after executing -layoutSubviews. WSMeWishCell's implementation of -layoutSubviews needs to call super.'
原因:
解決方法:
在WSMeWishCell中,添加如下代碼:
+ (void)load
{
Method existing = class_getInstanceMethod(self, @selector(layoutSubviews));
Method new = class_getInstanceMethod(self, @selector(_autolayout_replacementLayoutSubviews));
method_exchangeImplementations(existing, new);
}
- (void)_autolayout_replacementLayoutSubviews
{
[super layoutSubviews];
[self _autolayout_replacementLayoutSubviews]; // not recursive due to method swizzling
[super layoutSubviews];
}
需要引入頭文件:#import<objc/runtime.h>
關于runtime的用法,大家可以查看我轉發的關于runtime簡介的一篇文章。Runtime簡介 - 簡書
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle? (loaded)' with name 'HTCareerButton''
原因:大部分是因為你XIb文件名稱錯誤
解決方法:在xib的Unilities界面的 Show the File Inspector界面,也就是第一個按鈕,找到name,查看名字是否匹配.