Release版本只在iOS9 2及以下閃退

2021-08-01 04:41:54 字數 1688 閱讀 9254

title: xcode8打包的swift3專案在ios9.2及以下閃退

type: categories

date: 2017-05-16 14:07:30

categories: swift

用xcode8打包的swift3的專案,只在ios9.2及以下的release版本中crash,真機測試所有版本都沒問題。而且給出的錯誤報告,也是隨機的且還是系統私有的庫。

列舉幾個ios9.2中收到的錯誤報告:

#1

coreui

-[cuistructuredthemestore renditionwithkey:usingkeysignature]

#2corefoundation

-[nscache setobject:forkey:cost:]

#3corefoundation

-[_cfxnotificationobserverregistration find:]

#4 uikit

_initiallizetouchtapcount

#5coregraphics

subimageprovidercopyimageblockset

最終丟擲的異常為:

exc_bad_access kern_invalid_address
這些錯誤報告中有反覆出現的類:uiimageasset、uiassetmanager

原因:專案中的的color space格式不對。

具體就是專案中使用了含有 非srgb顏色空間的。我的專案中就因為有幾張是adobe rgb型別的,導致ios9.2.1的手機系統在開啟使用了這幾張的頁面crash。

解決:可參考:

方法一:

檢視專案中的格式:檢視方法,手動替換掉所有adobe rgb顏色空間的為srgb

方法二:

在專案中執行指令碼:

#!/bin/bash

directory=$1

echo "------------------------------"

echo "passed resources with xcassets folder argument is <$directory>"

echo "------------------------------"

echo "processing asset:"

find "$directory" -name '*png' -print0 | while read -d $'\0' file;

do echo "---------$file"

sips -m "/system/library/colorsync/profiles/srgb profile.icc"

"$file" --out "$file"

done

echo "------------------------------"

echo "script successfully finished"

echo "------------------------------"

iOS 9適配須知

昨天更新了xcode 7,準備ios 9的適配,查閱了相關文件,還是遇到不少坑,特整理下。1 編譯執行發現錯誤,類似如下錯誤 ld users framework sdks polymerpay library mobstat lib sdk.a forsdk.o does not contain ...

解決適配iOS9

1 在ios9下,系統缺省會攔截對http協議介面的訪問,因此無法獲取http協議介面的資料。解決 暫時退回到http協議。具體方法 然後給它新增乙個key nsallowsarbitraryloads,型別為boolean型別,值為yes 2 ios 9新建專案預設需要支援bitcode,而不支援...

適配iOS 9系統

問題描述 在ios9下,系統缺省會攔截對http協議介面的訪問,因此無法獲取http協議介面的資料。對sharesdk來說,具體表現可能是,無法授權 分享 獲取使用者資訊等。還可能造成我們的編輯介面裡傳http之類的網路的時候,我們的編輯介面不會顯示截圖,解決的辦法或者全面關閉https,允許使用h...