99热99这里只有精品6国产,亚洲中文字幕在线天天更新,在线观看亚洲精品国产福利片 ,久久久久综合网

歡迎加入QQ討論群258996829
麥子學院 頭像
蘋果6袋
6
麥子學院

怎么解決Xcode報錯

發(fā)布時間:2016-06-20 15:17  回復(fù):0  查看:3129   最后回復(fù):2016-06-20 15:17  

在開發(fā)中,我們時常遇到Xcode開發(fā)工具報錯的情況,遇到這種情況該怎么解決呢?這里匯總了幾個解決辦法。

1. An App ID with Identifier 'com.XXX.XXX’ is not available. Please enter a different string.
宗旨:移除鑰匙串中的開發(fā)證書,重新導(dǎo)入
1) 完全關(guān)閉Xcode;
2) 找到鑰匙串,將鑰匙串(Keychain)中的對應(yīng)證書移除;
3) 再次打開Xcode,通過Preferences - View Details - download新的證書;
4) 選擇正確的appID,運行項目。

 

2. <code livecodeserver="">The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.</code>
解決方法1
1) Info.plist中添加NSAppTransportSecurity類型Dictionary。
2) NSAppTransportSecurity下添加NSAllowsArbitraryLoads類型Boolean,值設(shè)為YES
3) 注意,單元測試下面也有一個Info.plist,修改那個文件是沒有作用的!
解決方法2
讓有的域名支持https的話也可以這么配置:

怎么解決Xcode報錯

3. “Your build settings specify a provisioning profile with the UUID “”, however, no such provisioning profile was found” 
解決:命令行分別輸入下面語句,刪除所有的Profiles
cd ~/Library/MobileDevice/Provisioning\\\\ Profiles/
rm *.mobileprovision

4. Please verify that your device’s clock is properly set, and that your signing certificate is not expired
1) 關(guān)閉項目,找到項目文件XXXX.xcodeproj,在文件上點擊右鍵,選擇顯示包內(nèi)容Show Package Contents)。會新打開一個Finder
2) 在新打開的Finder中找到project.pbxproj,并且打開,找到所有包含報錯的UUID‘XXX’的行(包含UUID后面的一串數(shù)字的行,可能不包含"UUID"),整行刪除。
3) 保存,重新啟動項目,再編譯,就OK了。

 

5. @2x@3x圖片無法提交SVN
原因:add a "@" character at the end of all "@2x" files while checking in and your problem with subversion will be solved.
in other words, "svn add blahblah@2x.png@" (where blahblah is the true name of the Retina high rez image files) at the terminal and then explicitly commit that. In other words, don't add these files from Xcode, use the command line in the Terminal.
Subversion can have troubles with files with "@" in the filename.
命令行解決步驟:
svn add image_file_name\\\\@3x.png@
svn commit -m “add your comment here"

 

6. CodeSign error: no provisioning profile at path '/Users/zhht-2015/Library/MobileDevice/Provisioning Profiles/79693141-f98b-4ac4-8bb4-476c9475f265.mobileprovision'
1) 關(guān)閉Xcode,找到項目中的**.xcodeproj文件,點擊右鍵,show package contents(打開包內(nèi)容)
2) 打開后找到project.pbxproj文件,用文本編輯器打開。其實就是右鍵,點擊open就好了。
3) 打開這個文件后,按command+F,在這個文件中查找“PROVISIONING_PROFILE",找到這個
PROVISIONING_PROFILE = "79693141-f98b-4ac4-8bb4-476c9475f265";
并刪除。
4) 然后保存文件,重新打開項目。xcode會提示你重新下載安裝provisioning profile文件。下載后安裝上就可以。

下面的是我重啟Xcode后自動默認的,之前的設(shè)置都被重置了,也正是這個問題導(dǎo)致我做APNS推送時注冊deviceToken成功和失敗的函數(shù)都不回調(diào),要么就是注冊成功了發(fā)送消息成功了但是接收不到。我按照默認設(shè)置重新運行后推送測試可以了。

怎么解決Xcode報錯

 

7. [NSBundle mainBundle] pathForResource: ofType: nil
資源沒有真正添加到bundle中,需要在項目設(shè)置中,build phases —> copy bundle resources 點擊 重新添加即可。

 

 
原文來自:簡書/Restar

您還未登錄,請先登錄

熱門帖子

最新帖子

?