NO_FLIPPER导致RN编译失败

问题描述

Xcode构建RN报错:

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_FlipperClient", referenced from:
      objc-class-ref in libreact-native-flipper.a(FlipperReactNativeJavaScriptPluginManager.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

问题分析

NO_FLIPPER没有设置成功导致react-native-flipper编译时没有被排除
React Native 0.71.1 当 NO_FLIPPER=1 时排除 react-native-flipper 以防止 iOS 构建失败

# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
 # because `react-native-flipper` depends on (FlipperKit,...) that will be excluded
 #
 # To fix this you can also exclude `react-native-flipper` using a `react-native.config.js`
 # ```js
 # module.exports = {
 #   dependencies: {
 #     ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),
 # ```

问题解决

通过设置NO_FLIPPER=1把Flipper从pods中排除后再构建RN
Disable Flipper for iOS

NO_FLIPPER=1 pod install --project-directory=ios

node版本过低导致RN编译失败

问题描述

Xcode编译RN项目失败:

Node found at: /usr/local/bin/node
/Users/couldhll/Desktop/Jesus/node_modules/yargs/node_modules/yargs-parser/build/index.cjs:1015
        throw Error(`yargs parser supports a minimum Node.js version of ${minNodeVersion}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);
        ^

Error: yargs parser supports a minimum Node.js version of 12. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions
    at Object.<anonymous> (/Users/couldhll/Desktop/Jesus/node_modules/yargs/node_modules/yargs-parser/build/index.cjs:1015:15)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/couldhll/Desktop/Jesus/node_modules/yargs/build/index.cjs:1:60637)
    at Module._compile (module.js:652:30)
Command PhaseScriptExecution failed with a nonzero exit code

问题分析

查了一下node的版本是8.11.3,需要的版本是12以上

/usr/local/bin/node -v
v8.11.3

问题解决

node(nvm安装)link到/usr/local/bin/node

ln -s $(which node) /usr/local/bin/node

Multiple commands produce报错

问题描述

iOS Build 报错:


Showing Recent Messages

Prepare build
note: Building targets in dependency order
error: Multiple commands produce '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/AntDesign.ttf'
    note: Target 'Jesus' (project 'Jesus') has copy command from '/Users/couldhll/Desktop/Jesus/node_modules/react-native-vector-icons/Fonts/AntDesign.ttf' to '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/AntDesign.ttf'
    note: That command depends on command in Target 'Jesus' (project 'Jesus'): script phase “[CP] Copy Pods Resources”
error: Multiple commands produce '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/Entypo.ttf'
    note: Target 'Jesus' (project 'Jesus') has copy command from '/Users/couldhll/Desktop/Jesus/node_modules/react-native-vector-icons/Fonts/Entypo.ttf' to '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/Entypo.ttf'
    note: That command depends on command in Target 'Jesus' (project 'Jesus'): script phase “[CP] Copy Pods Resources”
error: Multiple commands produce '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/EvilIcons.ttf'
    note: Target 'Jesus' (project 'Jesus') has copy command from '/Users/couldhll/Desktop/Jesus/node_modules/react-native-vector-icons/Fonts/EvilIcons.ttf' to '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/EvilIcons.ttf'
    note: That command depends on command in Target 'Jesus' (project 'Jesus'): script phase “[CP] Copy Pods Resources”
error: Multiple commands produce '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/Feather.ttf'
    note: Target 'Jesus' (project 'Jesus') has copy command from '/Users/couldhll/Desktop/Jesus/node_modules/react-native-vector-icons/Fonts/Feather.ttf' to '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/Feather.ttf'
    note: That command depends on command in Target 'Jesus' (project 'Jesus'): script phase “[CP] Copy Pods Resources”
error: Multiple commands produce '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/FontAwesome.ttf'
    note: Target 'Jesus' (project 'Jesus') has copy command from '/Users/couldhll/Desktop/Jesus/node_modules/react-native-vector-icons/Fonts/FontAwesome.ttf' to '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/FontAwesome.ttf'
    note: That command depends on command in Target 'Jesus' (project 'Jesus'): script phase “[CP] Copy Pods Resources”
error: Multiple commands produce '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/FontAwesome5_Brands.ttf'
    note: Target 'Jesus' (project 'Jesus') has copy command from '/Users/couldhll/Desktop/Jesus/node_modules/react-native-vector-icons/Fonts/FontAwesome5_Brands.ttf' to '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/FontAwesome5_Brands.ttf'
    note: That command depends on command in Target 'Jesus' (project 'Jesus'): script phase “[CP] Copy Pods Resources”
error: Multiple commands produce '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/FontAwesome5_Regular.ttf'
    note: Target 'Jesus' (project 'Jesus') has copy command from '/Users/couldhll/Desktop/Jesus/node_modules/react-native-vector-icons/Fonts/FontAwesome5_Regular.ttf' to '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/FontAwesome5_Regular.ttf'
    note: That command depends on command in Target 'Jesus' (project 'Jesus'): script phase “[CP] Copy Pods Resources”
error: Multiple commands produce '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/FontAwesome5_Solid.ttf'
    note: Target 'Jesus' (project 'Jesus') has copy command from '/Users/couldhll/Desktop/Jesus/node_modules/react-native-vector-icons/Fonts/FontAwesome5_Solid.ttf' to '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/FontAwesome5_Solid.ttf'
    note: That command depends on command in Target 'Jesus' (project 'Jesus'): script phase “[CP] Copy Pods Resources”
error: Multiple commands produce '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/Fontisto.ttf'
    note: Target 'Jesus' (project 'Jesus') has copy command from '/Users/couldhll/Desktop/Jesus/node_modules/react-native-vector-icons/Fonts/Fontisto.ttf' to '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/Fontisto.ttf'
    note: That command depends on command in Target 'Jesus' (project 'Jesus'): script phase “[CP] Copy Pods Resources”
error: Multiple commands produce '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/Foundation.ttf'
    note: Target 'Jesus' (project 'Jesus') has copy command from '/Users/couldhll/Desktop/Jesus/node_modules/react-native-vector-icons/Fonts/Foundation.ttf' to '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/Foundation.ttf'
    note: That command depends on command in Target 'Jesus' (project 'Jesus'): script phase “[CP] Copy Pods Resources”
error: Multiple commands produce '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/Ionicons.ttf'
    note: Target 'Jesus' (project 'Jesus') has copy command from '/Users/couldhll/Desktop/Jesus/node_modules/react-native-vector-icons/Fonts/Ionicons.ttf' to '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/Ionicons.ttf'
    note: That command depends on command in Target 'Jesus' (project 'Jesus'): script phase “[CP] Copy Pods Resources”
error: Multiple commands produce '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/MaterialCommunityIcons.ttf'
    note: Target 'Jesus' (project 'Jesus') has copy command from '/Users/couldhll/Desktop/Jesus/node_modules/react-native-vector-icons/Fonts/MaterialCommunityIcons.ttf' to '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/MaterialCommunityIcons.ttf'
    note: That command depends on command in Target 'Jesus' (project 'Jesus'): script phase “[CP] Copy Pods Resources”
error: Multiple commands produce '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/MaterialIcons.ttf'
    note: Target 'Jesus' (project 'Jesus') has copy command from '/Users/couldhll/Desktop/Jesus/node_modules/react-native-vector-icons/Fonts/MaterialIcons.ttf' to '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/MaterialIcons.ttf'
    note: That command depends on command in Target 'Jesus' (project 'Jesus'): script phase “[CP] Copy Pods Resources”
error: Multiple commands produce '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/Octicons.ttf'
    note: Target 'Jesus' (project 'Jesus') has copy command from '/Users/couldhll/Desktop/Jesus/node_modules/react-native-vector-icons/Fonts/Octicons.ttf' to '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/Octicons.ttf'
    note: That command depends on command in Target 'Jesus' (project 'Jesus'): script phase “[CP] Copy Pods Resources”
error: Multiple commands produce '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/SimpleLineIcons.ttf'
    note: Target 'Jesus' (project 'Jesus') has copy command from '/Users/couldhll/Desktop/Jesus/node_modules/react-native-vector-icons/Fonts/SimpleLineIcons.ttf' to '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/SimpleLineIcons.ttf'
    note: That command depends on command in Target 'Jesus' (project 'Jesus'): script phase “[CP] Copy Pods Resources”
error: Multiple commands produce '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/Zocial.ttf'
    note: Target 'Jesus' (project 'Jesus') has copy command from '/Users/couldhll/Desktop/Jesus/node_modules/react-native-vector-icons/Fonts/Zocial.ttf' to '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/Zocial.ttf'
    note: That command depends on command in Target 'Jesus' (project 'Jesus'): script phase “[CP] Copy Pods Resources”

Building targets in dependency order

Multiple commands produce '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/AntDesign.ttf'

Multiple commands produce '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/Entypo.ttf'

Multiple commands produce '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/EvilIcons.ttf'

Multiple commands produce '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/Feather.ttf'

Multiple commands produce '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/FontAwesome.ttf'

Multiple commands produce '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/FontAwesome5_Brands.ttf'

Multiple commands produce '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/FontAwesome5_Regular.ttf'

Multiple commands produce '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/FontAwesome5_Solid.ttf'

Multiple commands produce '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/Fontisto.ttf'

Multiple commands produce '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/Foundation.ttf'

Multiple commands produce '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/Ionicons.ttf'

Multiple commands produce '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/MaterialCommunityIcons.ttf'

Multiple commands produce '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/MaterialIcons.ttf'

Multiple commands produce '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/Octicons.ttf'

Multiple commands produce '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/SimpleLineIcons.ttf'

Multiple commands produce '/Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Products/Debug-iphoneos/Jesus.app/Zocial.ttf'

Computing target dependency graph and provisioning inputs

Create build description
Build description signature: e34cffb17530f18e248a8120033bffe3
Build description path: /Users/couldhll/Library/Developer/Xcode/DerivedData/Jesus-bixlpkqqeqxklgenquwktceekdsp/Build/Intermediates.noindex/XCBuildData/e34cffb17530f18e248a8120033bffe3-desc.xcbuild

问题分析

原因是react-native-vector-icons所使用的ttf字体文件被导入了两次:
一次是手动导入:通过项目导入
一次是自动导入:Pods-Jesus-resources.sh

问题解决

方法一:移除手动导入

移除项目中手动导入的字体文件

方法二:取消自动导入

react-native.config.js文件中加入如下代码:

module.exports = {
  dependencies: {
    'react-native-vector-icons': {
      platforms: {
        ios: null,
      },
    },
  },
};

Xcode变量看不了

问题描述:
堆栈上一层都正常,这一层监视通通挂了,任何变量看不了

(lldb) po self
error: :1:11: error: use of undeclared type '$__lldb_context'
extension $__lldb_context {
^~~~~~~~~~~~~~~

error: :18:5: error: use of unresolved identifier '$__lldb_injected_self'
$__lldb_injected_self.$__lldb_wrapped_expr_32(
^~~~~~~~~~~~~~~~~~~~~

(lldb) po viewController
error: :3:1: error: use of unresolved identifier 'viewController'
viewController
^~~~~~~~~~~~~~

Xcode Version 8.2 (8C38)

iOS9 Beta5的Extension下调用CoreSpotlight失败

在iOS9 beta4的Extension下调用CoreSpotlight注册spotlight成功。

而iOS9 beta5的Extension下调用失败,报如下错误:
2015-08-12 14:33:22.705 com.baidu.ime.BaiduInputMethodContainer.BaiduInputMethod[1027:70935] _BSMachError: (os/kern) invalid capability (20)
2015-08-12 14:33:22.706 com.baidu.ime.BaiduInputMethodContainer.BaiduInputMethod[1027:70935] _BSMachError: (os/kern) invalid name (15)
2015-08-12 14:33:22.735 com.baidu.ime.BaiduInputMethodContainer.BaiduInputMethod[1027:71045] [com.apple.corespotlight.log.index] Finished "index items"(2) with error:Error Domain=CSIndexErrorDomain Code=-1003 "(null)"

错误为连接不到CoreSpotlight远程进程:
CSIndexErrorCodeRemoteConnectionError = -1003, //There was an error trying to communicate with the remote process

复制目录除了.svn

问题描述
本地编译通过,而Jenkins编译不过,日志如下:
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/all-wcprops: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/entries: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/prop-base/about.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/prop-base/dictionary.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/prop-base/fuzzySound.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/prop-base/general.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/prop-base/handwrite.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/prop-base/keyboard.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/prop-base/keyboard_tick.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/prop-base/mohu.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/prop-base/Root.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/prop-base/shuangpin.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/prop-base/UserProtocol.html.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/text-base/about.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/text-base/dictionary.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/text-base/fuzzySound.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/text-base/general.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/text-base/handwrite.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/text-base/keyboard.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/text-base/keyboard_tick.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/text-base/mohu.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/text-base/Root.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/text-base/shuangpin.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/text-base/UserProtocol.html.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/en.lproj/.svn/all-wcprops: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/en.lproj/.svn/entries: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/en.lproj/.svn/prop-base/Root.strings.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/en.lproj/.svn/text-base/Root.strings.svn-base: Permission denied

问题分析
报的错是当cp命令时.svn目录没有权限。
其实.svn目录不应该copy。

问题解决
把脚本中的命令:cp -r config/ temp/
改为:rsync -rv --exclude=.svn config/ temp/

iOS9跨应用链接需要设置白名单

问题描述:今天输入法适配iOS9,发现分享都不能用了

问题分析
因为是跨应用链接,怀疑和iOS9的新安全机制有关
Log报错:2015-07-09 16:49:31.546 BaiduInputMethodContainer[339:27725] -canOpenURL: failed for URL: "sinaweibo://" - error: "(null)"

问题解决
在info.plist中,加入:

<key>LSApplicationQueriesSchemes</key>
<array>
<string>sinaweibo</string>
</array>

 

 

iOS9 beta2在iPad横屏下UITableView位置不正确

问题描述:设置项适配iOS9的时候发现UITableView的所有在iPad横屏下两边着很大的空白,如下图
TableViewDemo

问题分析
1.用UI视图看了下。UITableViewCell撑满整个屏幕是正确的。UITableViewCell的ContentView也是正确的。TextLabel不正确,你只能通过强行给TextLabel一个约束来修正。
2.设置了所有有关间距的属性,代码如下:
cell.indentationLevel=0;
cell.indentationWidth=0;
cell.separatorInset=UIEdgeInsetsZero;
cell.layoutMargins=UIEdgeInsetsZero;
cell.contentView.preservesSuperviewLayoutMargins=NO;
cell.preservesSuperviewLayoutMargins=NO;

tableView.contentInset=UIEdgeInsetsZero;
tableView.scrollIndicatorInsets=UIEdgeInsetsZero;
tableView.separatorInset=UIEdgeInsetsZero;
tableView.layoutMargins=UIEdgeInsetsZero;

[cell setNeedsLayout];
[cell setNeedsDisplay];
[cell layoutIfNeeded];

[tableView setNeedsLayout];
[tableView setNeedsDisplay];
[tableView layoutIfNeeded];
3.以上代码无效后,单独做了一个Demo:只放一个UITableView进去,问题同样存在,如下
TableViewDemo

问题结论
估计是iOS9 beta2的bug

环境:iPad Air2,iOS9 beta2,Xcode7.0 beta (7A120f)

iOS9默认网络访问都是SSL

问题描述:今天输入法适配iOS9,发现所有网络都不能访问了

问题分析
1.做了一个Demo,发现可以访问网络,访问的是http://www.baidu.com
2.调试设置项,发现所有返回的错误为“Error Domain=NSURLErrorDomain Code=-1200 "发生了 SSL 错误,无法建立与该服务器的安全连接。"”
3.把访问链接复制到浏览器中访问,发现有返回数据
4.仔细研究了一下错误发现所有的访问链接都变成了https://
5.在demo中证实所有iOS9会自动以SSL的方式访问所有网络链接

问题解决
在info.plist中,加入:

<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>yourserver.com</key>
<dict>
<!--Include to allow subdomains-->
<key>NSIncludesSubdomains</key>
<true/>
<!--Include to allow HTTP requests-->
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<!--Include to specify minimum TLS version-->
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.1</string>
</dict>
</dict>
</dict>

或者你希望所有都打开TLS,可以这样写:

NSAppTransportSecurity

<!--Include to allow all connections (DANGER)-->
NSAllowsArbitraryLoads

 

PS:官方文档:https://developer.apple.com/library/prerelease/ios/technotes/App-Transport-Security-Technote/