Unity-Technologies / arfoundation-samples

Example content for Unity projects based on AR Foundation
Other
3.03k stars 1.13k forks source link

kCGColorSpaceLinearGray in unityARKit.a caused our app to crash #772

Closed weacw closed 3 years ago

weacw commented 3 years ago

Our app was support iOS9 , there are some users use it. ARFoundation is part of our app. And it's an option feature. We mean ARFoundation does not need to support iOS9.

Let iOS9 ignore kCGColorSpaceLinearGray! Because we found kCGColorSpaceLinearGray is start iOS10+.

How did we discover that kCGColorSpaceLinearGray is in unityARKit.a We used the nm and grep commands

nm UNITY_LIBUNITYARKIT.A_PATH  -arch arm64 | grep '_kCGColorSpaceLinearGray'
Binary file ./Libraries/com.unity.xr.arkit/Runtime/iOS/Xcode1200/libUnityARKit.a matches

iShot2021-03-23 17 58 49

Closed issue: https://github.com/Unity-Technologies/arfoundation-samples/issues/706#issue-772025813

tdmowrer commented 3 years ago

The only place this is used is already guarded by an API_AVAILABLE macro (which would normally be the fix for an issue like this). I also suspect kCGColorSpaceLinearGray is not the only problem, just the first one you are hitting.

Since we have no plans to formally support iOS 9, and we are already using the normal compatibility guards, there is not much else we can do.

weacw commented 3 years ago

Thank you for your reply. Launching app was crashed, and throw exception for 'kCGColorSpaceLinearGray'. image

Can we using On-demand reference to load unityarkit.a ?

tdmowrer commented 3 years ago

Can we using On-demand reference to load unityarkit.a ?

Do you mean an on-demand resource? libUnityARKit.a is a static library; it is linked into the app executable and cannot be installed or loaded on demand.

weacw commented 3 years ago

Can we using On-demand reference to load unityarkit.a ?

Do you mean an on-demand resource? libUnityARKit.a is a static library; it is linked into the app executable and cannot be installed or loaded on demand.

Emmmm... What can we sovle this problem. I found this post [https://www.programmersought.com/article/3081601659/] Does it help me?