IOS常見錯誤分析解決

1:clang failed with exit code 254

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

2:Verify exit code of build task with internal identifier ‘CopyPNGFile 123.png’
這裏寫圖片描述

一:將出錯的png,用PhotoShZ喎�”http://www.2cto.com/kf/ware/vc/” target=”_blank” class=”keylink”>vcNbY0MLXqru70ru0ziwgIMjnuftQaG90b1Nob3C08rK7v6osuMS689e6zqpKcGcgytTK1C4g16q7u8qxLMfryrnTwyA6PHN0cm9uZz605rSizqpXZWK78snosbjL+cq508O1xCYjMjY2ODQ7yr08L3N0cm9uZz4mIzI2Njg0O8q916q7u7PJPHN0cm9uZz4gUE5HLTI0PC9zdHJvbmc+1eLR+bXEzbzGrLTz0KGxyL3Pus/KyjwvcD4KPHA+Cjxicj4KPC9wPgo8cD4KPHN0cm9uZz4zOjwvc3Ryb25nPjwvcD4KPHA+CjxpbWcgc3JjPQ==”http://www.2cto.com/uploadfile/2014/0509/20140509112551421.png” alt=”\”>

這裏寫圖片描述

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

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 會默認聲明瞭,但是隻是針對自定義類,系統類還沒有. 所以,小心

@synthesize storyboard;

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

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

#pragma clang diagnostic push
#pragma clang diagnostic ignored “-Warc-performSelector-leaks”
[self performSelector:nextView];
#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就行了 不要正運行着就直接卸載了程序

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