顯示具有 xcode 標籤的文章。 顯示所有文章
顯示具有 xcode 標籤的文章。 顯示所有文章

2016年4月15日 星期五

APPNAME was compiled with optimization - stepping may behave oddly; variables may not be available

Hope this article can help who meets same problem.


Description:

If you use third party static libraries, such as libav, ffmpeg in your app.
If you use cross compiler to build third party libraries.

In my environment, I have these third party library and use command line to build libav.a libwebrtc.a etc.. and put .a file into my xcode LIBRARY_LINK_PATH.

After I update my libraries to Xcode, I got runtime error :

"myapp was compiled with optimization - stepping may behave oddly; variables may not be available"


Solution:
When we use library in xcode, we have to update include files as well. In my case, I change some include file but forgot to update it to app project.

Even you use incorrect header file, xcode don't found it. So it can pass compile and crash until you access the new functions. Then, it shows error.

Please update .a and .h in the same time.


Yang





2015年10月21日 星期三

[Developer] Xcode 7, iOS 9+ default deny insecure http loader

iOS 9.0+

這個問題大概是升級到 XCODE 7 最容易遇到的問題。

主要是為了安全性。在目前的網路時代中,有很多各式各樣的 Man in middle 攻擊能隨意的置換、攔截 HTTP的封包,沒有 HTTPS已經無法保證你的結果。甚至連一些早期的加密方式 SSLv3 (POODLE),攻擊者能有效的擷取傳輸資訊。在 Mobile這種高度依賴 HTTP傳輸的程式,APPLE決定從 IDE著手,希望大家能重視這件事。

當然,程式要先能動再談安全性。若要將這個設定關掉可以參考

https://developer.apple.com/library/prerelease/ios/technotes/App-Transport-Security-Technote/

在 Project 的 plist 中增加
NSAppTransportSecurity -> dict
    NSExceptionDomains -> dict  (單一設定 domain)
    NSAllowsArbitraryLoads -> boolean (全開)

以下為設定範例:

<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>mydomain.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
<key>crashlytics.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>