IOS常見錯誤分析解決(一直更新) 你值得收藏-綜合貼

-來自收藏總結 綜合了好多的常見錯誤

1:clang failed with exit code 254

 一:檢測代碼中 是否 有 NSLog 打印了 返回 void 的值.


2:Verify exit code of build task with internal identifier 'CopyPNGFile 123.png'


一:將出錯的png,用PhotoShop重新轉換一次,  如果PhotoShop打不開,改後綴爲Jpg 試試. 轉換時,請使用 :存儲爲Web或設備所使用的格式格式轉換成 PNG-24這樣的圖片大小比較合適


3:

一:確定靜態庫中是否有自定義的類文件,如果一個也沒有,就會出現這種錯誤,這也是爲什麼新建的靜態庫都包含一個默認的類.

4:  _OBJC_CLASS_$_UIMainKpiXML", referenced from:

1:檢測類文件是否已經指定了Project Target 


2:檢測類文件是否在Bulid Phases 中的 Compile Source 是否包含了這個類文件


以上兩步都檢查完成以後,如果編譯還報錯誤,請嘗試徹底關閉XCode  再次編譯試試.

5: for architecture armv7s



以下摘自: http://stackoverflow.com/questions/12570116/what-is-the-difference-between-arm7-and-arm7s

Yes you are right about armv7s is about the iPhone 5. Here some summary info I found on the web:

  • ARMv6 ISA (used by the ARM11 core in the iPhone 2G and iPhone 3G)
  • ARMv7 (used by modern ARM cores, iPhone 3GS, iPhone 4 and 4S)
  • ARMv7s (new A6 SoC for iPhone 5).

注:錯誤含義表示 指定的framework 不支持對 armv7s 的支持, 也就不支持搭載A6處理器的iPhone 5. 

如果在編譯framework或者靜態庫的工程中依舊編譯時,可能是以下設置導致,設置爲NO即可



6: Local declaration of '' hides instance variable

1:私有變量與屬性變量同名所致


7:Instance variable '' accessed in class method


1:在靜態方法不能使用到類的屬性變量,否則就報上面的錯誤

8:ld: symbol(s) not found for architecture i386


1:裏面意思說:"_stroyboard" 這個屬性在目標類中 根本就沒聲明!


那就聲明一下咯? 注:XCode4.5 會默認聲明瞭,但是隻是針對自定義類,系統類還沒有. 所以,小心


  1. @synthesize storyboard;  

9:PerformSelector may cause a leak because its selector is unknown   

通過如下代碼解決產生的編譯器警告


  1. #pragma clang diagnostic push
  2. #pragma clang diagnostic ignored "-Warc-performSelector-leaks"
  3.     [self performSelector:nextView];  
  4. #pragma clang diagnostic pop

來源:(http://www.ooso.net/archives/620)

10:unable to open executable

1:檢測同一個靜態庫或工程中是否有兩個或以上的想同類文件存在

2:刪除模擬器中的應用,刪除DerivedData文件夾 重新啓動XCode.


11: Property's synthesized getter follows Cocoa naming convention for returning 'owned' objects

不要在頭文件聲明變量命名是以new copy開頭

參考:http://kongbei888.blog.163.com/blog/static/24326613201261902510652/


12:ld: file not found:

1:指向的靜態庫沒有找到



14: _utf8_countTrailBytes

add library libicucore.dylib


15:Stray "@"  in program

工程使用的編譯器版本過低所致. 修改編譯器版本至最新版本,如下圖:


參考:http://stackoverflow.com/questions/12821938/stray-in-program-with-nsdictionary-definition



16.解決真機調試iPad Air設備時的錯誤:architecture not supported的辦法

1.將Build Settings 中Architectures ——> Valid Architectures的arm64刪掉,只留armv7、armv7s

2.同上,將Architectures ——>Architectures改爲 $(ARHS_STANDARD)armv7,armv7s

3.把Build Active Architecture Only 改爲NO

4.編譯即可

17.編譯時出現:Not supported ARM architecture

解決辦法:在./configure 時加入 -D__ARM_ARCH_5TEJ__

另外一篇:Android常見錯誤分析

18.Couldn't register xxx.xx.xx with the bootstrap server. Error: unknown error code.
This generally means that another instance of this process was already running or is hung in the debugger.
每個在xcode下用ios模擬器做開發的開發者都應該會遇到過上面所示的錯誤,目前找到最行之有效的解決辦法是重啓手機。不行了也順便把電腦重啓下。 建議以後記得stop就行了 不要正運行着就直接卸載了程序

本文一直更新希望大家踊躍回覆自己知道的常見error  來參與本文的更新^_^


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章