1.企業版
1.1. could not be downloaded at this time
a.Wi-Fi不穩定,建議換個穩定的Wi-Fi。或者使用4G,3G下載試試看
b.證書過期,進入蘋果開發者編輯一下描述文件
c.重啟手機 試試吧。假如好了呢。
1.2. iOS 9.0按鈕應用之后無法打開
a.進入 設置 -> 通用 -> 設備管理.找到應用 信任即可
1.3. 測試時 invalid mode 'kCFRunLoopCommonModes' provided to CFRunLoopRunSpecific - break on _CFRunLoopError_RunCalledWithInvalidMode to debug.
a.runloop 作用的太多 超過其限制(本人出現的問題是 tableView 的 reloadData太多。也就是說在tableView正在幫你繪制視圖時,你又連續發了好幾個reloadData的請求)
1.4. 合並代碼 編譯時 duplicate symbol _OBJC_IVAR_$_GLQuickCheckWorkViewController._encourageLabel in:
a.某個target的某個文件編譯了多次。需要在Build Phases 刪除掉一次。然后重新加回來。
1.5. 網絡請求失敗
a. 查看響應狀態碼 然后看看是哪端的問題 //400+一般為服務端的問題 。。。 500+一般表示服務端問題
b.檢查自己的url是否合法 (曾經有過url中出現空格 無法調用的現象)
1.6. 斷點后控制台無法使用命令 po 打印一些值
a.某個類有多個分類,然后設置了同一個屬性,並且這個屬性對應的類型還是不一樣的。因為一只提示某個屬性有問題
(曾經 我和另外一個同事同時寫了一個UIViewController的分類,他里面有一個屬性 a是NSInteger ,而我的屬性 a是NSString的。因而導致我每次斷點到某個控制器之后使用po都無效)
1.7. 換一些文件或者框架后編譯不通過
a.clean 一下,重新編譯
b.根據崩潰信息查看 查看其.a 文件的路徑是否正確
c.根據崩潰信息查看 使用lipo -info 查看.a , framework是否支持你需要支持的命令集
d.可能是你上次編譯成功的文件(cocopods中引入的文件產生了.a文件)和你這次編譯的文件產生了沖突。 找到編譯成功的app文件(xxx.project->Products->右鍵 選取show in finder),刪除相關文件。
1.8. Undefined symbols for architecture arm64: "_uregex_reset", referenced from:
a.arm64 是一種指令集 應該是要做個兼容
我出現的問題是debug模式下能編譯通過,在release下面不能編譯通過。后來才發覺在引入RegexKitLite 后 ,Other Linker Flags,release 下缺少了licucore。在后面加入 -licucore
1.9. warning
a.過期的方法 使用 下面的 方法幫你度過難關
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
代碼
#pragma clang diagnostic pop
b.int NSInteger long 使用的時候出現的警告
單個文件屏蔽 添加 arc和mrc 一樣在相應位置 添加量 -Wno-shorten-64-to-32
所有文件屏蔽 在build setting -> Other Warning Flags 中加入 -Wno-shorten-64-to-32
1.10. 連接代理時 一些https的請求無法請求成功 --- 錯誤信息:此服務器的證書無效。您可能正在連接到一個偽裝成“restapi.amap.com”的服務器,這會威脅到您的機密信息的安全。
a. 去掉代理應該就好了。
b. 改為http即可
注: 測試人員為了使用代理抓https的包,會安裝一些非正規的CA證書。有些IPhone手機會認證的,有問題會直接不請求。
1.11. this application is modifying the autolayout engine from a background thread,which can lead to engine corruption and weird crashes.This will cause an exception in a future release.
a. 不在執行main thread 中UI操作導致的。 (前幾個xcode編譯的好像會直接崩潰,現在只是會卡頓會,后面等主線程閑置就會正常操作了,不過在控制台會打印一段上面的文案)
1.12 Could not find a storyboard named 'Main' in bundle NSBundle
a. 個人在project無限刪Main.sb 都沒有成功。后來才意識到在info.plist 里面有個 Main storyboard file base name的配置,刪除即可
1.13 編譯報錯 This application’s application-identifier entitlement does not match that of the installed application. These values must match for an upgrade to be allowed.
a. application-identifier沖突了,卸載之后重新編譯run就好
1.14 打包報錯 WARNING ITMS-90725: "SDK Version Issue. This app was built with the iOS 11.4 SDK. Starting March 2019, all iOS apps submitted to the App Store must be built with the iOS 12.1 SDK or later, included in Xcode 10.1 or later."
a. 其實就一個警告而已 說2019年3月份以后就只能用XCode10.1以上版本打包了
1.15 運行時錯誤 libc++abi.dylib: terminate_handler unexpectedly threw an exception
a. appdelete 的 window.rootViewController 為nil,會崩潰
1.16 測試包獲取數據失敗,編譯情況下是可以的
a. 服務器獲取的數據是否用weak取接收了,改為strong接收即可
b. 修改scheme的run下面的編譯模式為release,release下的證書也改為develop證書及描述文件,斷點查看具體原因
2. 公司版
2.1.提交包到App Store,提示 framework只能兼容到iOS 8.0.
a. 剛開始我是拒絕的。我明明打動態庫的時候最低版本是7.0.各種嘗試。
不管怎么重新打包就是報同樣的錯誤,而當時有cocopods錯誤,網速還不給力。無奈,直接把源文件丟進去了,然后才好。
不知道是否是xcode8.0不給打包iOS8.0以下的庫。(當時 最低版本7.0是手寫的,非選取)
2.2.打包時報錯 lipo: can't write to output file
a. 磁盤內存不足,刪除一些不重要的東西后 重新打包即可(保證足夠的磁盤啊)
2.3.提交審核后,能再itunes中看到 但報警告: Your configuration home partition has fewer than 100 megabytes free; for best results Apple recommends increasing the amount of free space....
a.其實也是磁盤內存不足導致的。保證足夠的存儲空間吧少年,重新打個包吧。
2.4.審核之后直接拒絕 說是沒有按照 蘋果的2.5.2的規定
a.檢查是否使用了JSPatch
b.檢查是否使用了第三方框架(SDK中包涵了動態下載代碼)(umeng老版,bugtags,個推,阿里百川的熱修復,高德地圖)
提交審核之前去掉了bugtags,阿里的熱修復,以為這樣就沒事了,因為公司另幾個app去掉這兩個審核痛喲。然后審核之后還是被拒絕了,我是小心小心又小心,結局還是不是很愉快。
然后就是各種找問題,最后發覺是高德地圖,剛好3.8號重發了一版,而我們確未更新,第一次被拒絕感覺真不好。
2.5. 程序內部使用的商品,只能走內購。程序外部使用的商品,不能走內購
a.我們產品表示不服,提交了一版的支付寶支付。過了幾天直接被拒,並且還有截圖,fuck。
2.6. 寬高 無限大,導致繪制視圖的時候直接崩潰 NaN。
a.可使用函數 isnan(double) 可判斷。 使用 NaN ><= 0,結果都是 false。
2.7 presentedViewController 和 presentingViewController的混淆
若 [self presentViewController:vc animated:YES completion:nil];
則 self.presentedViewController = vc; vc.presentingViewController = self.navigationController(即self的棧底控制器)
2.8 xcode 某些時候無法打包 iTunes Store Operation Error , An error occurred uploading to the App Store.
a. 如果更新過系統,或者升級過JAVA的SDK,可能是JAVA版本過高或不匹配導致的 在home目錄下面
$ mv .itmstransporter/ .old_itmstransporter/
$ "/Applications/Xcode.app/Contents/Applications/Application Loader.app/Contents/itms/bin/iTMSTransporter"
2.9 審核失敗的跟蹤
a. 后台語音
We have started the review of your app, but we are not able to continue because we need additional information about your app.
然后我回了一封郵件,告訴審核者,我們的應用中使用了音頻的后台錄音,並沒有使用音頻的后台播放。然而還是被無情的拒絕了。
Your app declares support for audio in the UIBackgroundModes key in your Info.plist, but we were unable to play any audible content when the app was running in the background.
最后我選擇了關閉了后台的音頻選項 (Project -> Targets -> xxxxApp -> capabilities -> Background Models 關閉第一選項即可 audio,AirPlay,and Picture in Picture)
b. 內購 (提交的時候最好給出進行內購的步驟,即怎么進入內購UI,We have started the review of your app, but we are not able to continue because we cannot locate the in-app purchases within your app.)
app中第一次加入內購,必定會引起App Store審核組的高度重視。其實坑還是挺多,其中還出現過app1中加內購項目,然而他們竟然拒絕了我的app2(懷疑我們app2中有購買,卻沒有使用內購拒絕了我們).
c. app 描述不能出現敏感的東西 (以下apple給出的意思是我們描述中出現了網站,建議我們刪除他,而我們的web端也是有購買服務的)
We noticed that your app description references the following URL that links to external mechanisms for purchases or subscriptions to be used in the app:
聯系我們:
【官方網站】http://www.xxxxxx.com
【客服熱線】400888888
Next Steps
To resolve this issue, please remove any URL that links to external purchasing mechanisms from your app description.
2.10 使用蘋果私有方法被拒
1. Your app uses the "prefs:root=" non-public URL scheme, which is a private entity. The use of non-public APIs is not permitted on the App Store because it can lead to a poor user experience should these APIs change
使用8.0后出來的 UIApplicationOpenSettingsURLString 生成URL跳轉即可
2.11 xcode各個版本 打包的一些問題
xcode 9.2 打包后部分小屏幕手機5s 會產生部分本地圖片 形變扭曲 (換為 xcode9.1 , 9.3)
xcode 10.0 打包后ios9.3 手機直接崩潰了, 編譯運行啥事沒有,就是打包后會崩潰(換為 xcode 9.4)
注:很多人都是通過經驗去避免(有時去google什么的),其實更好的方式是去了解蘋果的審核文檔。不過筆者目前還是第一類人。
>>>>>>>> 持續更新 <<<<<<<<<<