zoukankan      html  css  js  c++  java
  • Xcode7.1与iOS9之坑

    一、更改http为https

    两种方案:

    1. 公司后台服务器更改;
    2. 作为开发者,可在Xcode暂时退回到http协议.  开发者更改方法如下:
      • 在Info.plist中添加App Transport Security Settings (或NSAppTransportSecurity), 类型Dictionary。
      • 在App Transport Security Settings下添加Allow Arbitrary Loads (或NSAllowsArbitraryLoads), 类型Boolean,值设为YES. 

    二、使用ShareSDK第三方登录或分享,对iOS9适配  

    可参考官方文档详细介绍:  http://wiki.mob.com/ios9-对sharesdk的影响(适配ios-9必读)

    包括:https协议支持,关闭bitcode支持,添加Scheme白名单.

    3. Xcode7报错:Assertion failure in -[UIApplication _runWithMainScene:transitionContext:completion:]

    从iOS9开始,Xcode7需要所有UIWindow在  makeKeyAndVisible 之前必须有一个rootViewController,否则报以上错误。 

    解决方案:UIViewController  *emptyView = [[UIViewController  alloc  ]  init  ];

         self.  window.  rootViewController = emptyView;

         [self  .  window makeKeyAndVisible];

    4.Xcode7打开旧项目FrameWork文件夹下的.dylib库缺失,添加方法

    项目Target中Link Binary With Libraries  点击下方 “+”添加,  显示搜索页面,在此搜.dylib搜不出来(只能搜到同名的.tbd), 需点击 Add Other,出现文件目录页面 (正常情况通过Finder同样找不到.dylib文件,因该文件是隐藏文件。需按快捷键 CMD+Shift+G,输入  /usr/lib 后进入隐藏界面,然后添加需要的.dylib即可。 

    5.Xcode7 真机测试,出现"unavailable"字样,Could not find developer disk image

    stackoverflower答案:  点击查看

    解决方案:

    先关闭Xcode.再从Xcode 6.4中,拷贝8.4 (12H141)文件夹到Xcode 7的对应目录下.

    Xcode 6.4路径为:

    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport

    Xcode 7路径为:

    /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport

    重新打开Xcode 7,打开项目,需要等一会,等到菊花不转了,才能运行。

    6.App上传Appstore错误

    ERROR ITMS-90049:"This bundle is invalid. The bundle identifier contains disallowed characters. [See the section of the Application Programming Guide entitled The Application Bundle.]"

    解决方案:  

    在项目导航栏搜索Info.plist文件

    查找第三方的info.plist文件,如ShareSDK中的腾讯Bundle文件下的Info.plist文件。

    在该文件下添加或者修改以下几个字段:

    • Bundle version
    • Bundle identifier
    • Bundle versions string, short

    需要和系统自带的Info.plist文件一样。 如下图

    7.  App上传Appstore错误

    “  invalid package Applications built with SDK 9.0 or later must be packaged as proper IPA files.  ”

    解决方案:

    按照错误提示原先上传的是.zip文件,现在需要上传 .ipa文件。也就是需要将打包成的app在打包成ipa文件就可以了。

    具体步骤:

    1、新建文件夹 Payload 

    2、将xcode编译好的app放在Payload文件夹中

    3、压缩Payload文件夹为 .zip文件,然后重命名为 .ipa  重新上传即可

    附快捷shell脚本:  将脚本放在Release-iphones文件夹下,运行该脚本就可将app转换为ipa。

    #!/bin/bash
    APPNAME="appName"
    ZIPNAME="zipName"
    IPANAME="ipaName"
    
    mkdir ./ipa/Payload
    cp -r ./${APPNAME}.app ./ipa/Payload
    cd ipa
    zip -r ${ZIPNAME} *
    mv ${ZIPNAME}.zip ${IPANAME}.ipa
    

    8.  App上传Appstore错误

    ERROR ITMS-90535 Unexpected CFBundleExecutable Key. 

    解决方案:

    1,用XCode 6.4的Product -> Archive,再提交到AppStore。

    2,在Stackoverflow上也有相关的解决办法,就是把无用的CFBundle删除掉。  点击查看

    在工程里面搜索info.plist,可以先搜索info,找到第三方的info.plist文件,删除里面的Executable file对应的一整行,包括值。

    例如:  找到腾讯的info.plist  

    删除箭头指向的一行,即可.

    9.  未解决问题,哪位大神看到

    <1> 真机运行启动时崩溃,并非100%出现,出现率在80%左右,不清楚是什么原因,有知道的解答一下或者给个思路

    dyld`gdb_image_notifier:

    ->   0x2be590cc  <  +0  >: bx     lr

    在网上看到的答案:

    选 Project,然后进 BuildPhases,然后进 LinkBinaryWithLibraries. 找到 GLKit.Framework ,把它的 status 更改为 optional 就 ok.(如果没有GLKit.Framework, 添加一个再设置)

    因bug无法重现,无法验证以上方法是否可行.

    <2>Xcode7.1真机测试启动崩溃,模拟器正常,添加Enable Address Sanitizer调试,崩溃在启动页.  

    暂时解决办法: 用Xcode 6.3.2运行打包即可.

    libclang_rt.asan_ios_dynamic.dylib`__asan::AsanDie:

    ->  0x5e8240 <+0>:   push   {r4, r5, r7, lr}  //代码崩溃在此行

    0x5e8242 <+2>:   add    r7, sp, #0x8

    0x5e8244 <+4>:   dmb    ish

    打印信息如下:

    AddressSanitizer debugger support is active. Memory error breakpoint has been installed and you can now use the 'memory history' command.

    ==891==Shadow memory range interleaves with an existing memory mapping. ASan cannot proceed correctly. ABORTING.

    ==891==ASan shadow was supposed to be located in the [0x3ffff000-0x5fffffff] range.

    ==891==Process memory map follows:

    0x3af88000-0x3af89000    /usr/lib/libgcc_s.1.dylib

    0x3da44000-0x434ec000    /usr/lib/libgcc_s.1.dylib

    0x36556000-0x3655f000    /System/Library/PrivateFrameworks/MobileBluetooth.framework/MobileBluetooth

    0x3cf7c000-0x3cf7d000    /System/Library/PrivateFrameworks/MobileBluetooth.framework/MobileBluetooth

    0x3da44000-0x434ec000    /System/Library/PrivateFrameworks/MobileBluetooth.framework/MobileBluetooth

    0x34a47000-0x34a4e000    /System/Library/PrivateFrameworks/BluetoothManager.framework/BluetoothManager

    0x3c671000-0x3c673000    /System/Library/PrivateFrameworks/BluetoothManager.framework/BluetoothManager

    0x3da44000-0x434ec000    /System/Library/PrivateFrameworks/BluetoothManager.framework/BluetoothManager

    ........省略中间部分

    0x3b1a3000-0x3b2f5000    /usr/lib/libicucore.A.dylib

    0x3d91a000-0x3d92c000    /usr/lib/libicucore.A.dylib

    0x3da44000-0x434ec000    /usr/lib/libicucore.A.dylib

    0x3b92b000-0x3b9c2000    /usr/lib/libsqlite3.dylib

    0x3d977000-0x3d979000    /usr/lib/libsqlite3.dylib

    0x3da44000-0x434ec000    /usr/lib/libsqlite3.dylib

    0x005b0000-0x00604000    /var/mobile/Applications/D0115D17-C682-41AD-8E5C-D9DA83CF1053/wojsww.app/Frameworks/libclang_rt.asan_ios_dynamic.dylib

    0x00604000-0x00a60000    /var/mobile/Applications/D0115D17-C682-41AD-8E5C-D9DA83CF1053/wojsww.app/Frameworks/libclang_rt.asan_ios_dynamic.dylib

    0x00a60000-0x00aa0000    /var/mobile/Applications/D0115D17-C682-41AD-8E5C-D9DA83CF1053/wojsww.app/Frameworks/libclang_rt.asan_ios_dynamic.dylib

    0x005ad000-0x005ae000    /Library/MobileSubstrate/MobileSubstrate.dylib

    0x005ae000-0x005af000    /Library/MobileSubstrate/MobileSubstrate.dylib

    0x005af000-0x005b0000    /Library/MobileSubstrate/MobileSubstrate.dylib

    0x00010000-0x00014000    /var/mobile/Applications/D0115D17-C682-41AD-8E5C-D9DA83CF1053/wojsww.app/wojsww

    0x00014000-0x00370000    /var/mobile/Applications/D0115D17-C682-41AD-8E5C-D9DA83CF1053/wojsww.app/wojsww

    0x00370000-0x003f4000    /var/mobile/Applications/D0115D17-C682-41AD-8E5C-D9DA83CF1053/wojsww.app/wojsww

    0x003f4000-0x005ac000    /var/mobile/Applications/D0115D17-C682-41AD-8E5C-D9DA83CF1053/wojsww.app/wojsww

    ==891==End of process memory map.

    AddressSanitizer report breakpoint hit. Use 'thread info -s' to get extended information about the report.

    菜鸟不知原因,望大神解答.  

  • 相关阅读:
    while练习
    运算符
    作业
    [新手必看] 17个常见的Python运行时错误
    作业
    day04
    作业
    算法模板——线段树2(区间加+区间乘+区间求和)
    1798: [Ahoi2009]Seq 维护序列seq
    1708: [Usaco2007 Oct]Money奶牛的硬币
  • 原文地址:https://www.cnblogs.com/starainDou/p/5213327.html
Copyright © 2011-2022 走看看