开发工程中遇到的BUG

0

Xcode7在建立项目的时候勾选此选项,
Snip20151008_2.png
建立出来的项目会报以下错误警告:
"Couldn't communicate with a helper application",
Snip20151008_4.png
html

我重启Xcode而后编译代码,经过Xcode自带commit提交,
Snip20151008_5.pnggit

仍是会出现下面的错误警告
Snip20151008_6.png
"Couldn't communicate with a helper application",
我就去了,helper application是什么啊?????
实在搞不懂了????
是我打开的方式不对吗?
web

一、Couldn’t communicate with a helper application in Xcode 7

问题一:segmentfault

Couldn't communicate with a helper application in Xcode 7数组

翻译:不能与助手应用程序通讯在Xcode7中(helper ->指的是git)xcode

解决:网络

终端输入:多线程

Xcrun git config --global user.email 邮箱app

xcrun git config --global user.name gitHub的你的名字iphone


二、网上下载的Demo运行时报错

问题二:

网上下载的Demo运行时报错

ld:library not find for -lpods-xxxxxx

clang: error: linker command failed with exit code 1 (use -v to see invocation)

解决:

1. 首先查看本地是否安装cocoapods, 若是没安装请先安装pod,

2. 若是安装cocoapods,请打开终端,cd ~/到你工程文件夹(或者将文件夹直接拖到终端中)

3. 使用命令行 pop install --verbose --no-repo-update

4. 请使用xxx.xcworkspace打开工程


三、Xcode升级致使插件失效

问题三:

Xcode升级致使插件失效

解决:

1. 在终端输入defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID查看xcode的UUID。

2. 找到xcode插件所在的目录:~/Library/Application Support/Developer/Shared/Xcode/Plug-ins。在plist文件中找到DVTPlugInCompatibilityUUIDs, 点击加号, 添加一个item, 对应的value值为输入刚才终端中得到的UUID,cmd + s保存。

3. 重启Xcode,弹出的对话框中选择Load Bundle

4. 若是误点Skip Bundle,找到该插件安装路径下,继续打开在 info.plist 删除与命令端里面一样的UUID号,通常都是会在最后一行,本身添加的那一行也要删除掉。保存以后重启Xcode,再次重复上面的步奏。在重启就再次出现了插件提示


四、Unable to add app id because the '10' APP ID limit in '7'days has been exceeded

问题四:

Unable to add app id because the '10' APP ID limit in '7'days has been exceeded

翻译:没法添加应用程序id,由于“10”应用程序id已经超过限制(7日)

解决:

此问题针对于真机测试:

在developer center 从新设置一遍本身的APP ID 而后将APP ID 做为 Bundle ID添加到工程

免证书进行xcode真机调试方法:http://www.jianshu.com/p/3b2be6454462


五、Undefined symbols for architecture armv7:ld: symbol(s) not found for architecture armv7

问题五:

5.1: Undefined symbols for architecture armv7:

"_compress2", referenced from:

+[UMANDeflated deflatedDataPrefixedWith:level:source:] in libMobClickLibrary.a(UMDeflated.o)

ld: symbol(s) not found for architecture armv7

clang: error: linker command failed with exit code 1 (use -v to see invocation)

解决:

检查项目友盟这个库的依赖呀.确认库已经导入并且在连接的二进制库里面.(就是build phases里面).

检查是否某些文件路径未加入进来或者写错了

把xx文件库+进来

5.2: *** does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture armv7

解决:友盟的二进制库不支持bitcode.而Xcode默认是要支持bitcode的,并且若是支持的话,其中全部的二进制库和framework都必须包含bitcode(工程build setting -> build options ->Enable Bitcode设置为关闭)


六、installation failed invalid argument

问题6

 installation failed invalid argument

翻译:安装失败,参数非法

缘由:我把Bundle indentifier 置为空了!

解决1:

一、Quit Xcode

二、Clean out ~/Library/Developer/Xcode/DerivedData manually

三、rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"

四、iOS Simulator > Reset Content and Settings

解决2:随便添加一个Bundle indentifier


七、看不见控件是什么缘由

缘由:

一、根本没有建立实例化这个控件

二、没有设置尺寸

三、控件的颜色跟父控件的背景色同样

四、透明度alpha<=0.01

五、hidden = YES

六、没有添加到父控件中

七、被其余控件挡住了

八、位置不对

九、父控件发生了以上变化

十、特殊状况

*UIIamgeView没有设置image属性,或者设置的图片名不对

*UILabel没有设置文字,或者文字颜色和父控件的背景色同样

*UITextField没有设置文字,或者没有设置边框样式borderStyle

*UIPageControl没有设置总页数,不会显示小圆点

*UIButton内部imageView和titleLabel的frame被篡改了,或者没有内容

建议:

一、最好设置背景色和尺寸

二、控件的颜色尽可能不要跟父控件的背景色同样


八、在Archive项目时,出现了“Your build settings specify a provisioning profile with the UUID “”, however, no such provisioning profile was found”的出错。一直提示指定UUID的provisioning profile找不到

问题8

在Archive项目时,出现了“Your build settings specify a provisioning profile with the UUID “”, however, no such provisioning profile was found”的出错。一直提示指定UUID的provisioning profile找不到

解决:

1.找到项目中的**.xcodeproj文件,点击右键,show package contents(打开包内容)。

2.打开后找到project.pbxproj文件,用文本编辑器打开。其实就是右键,点击open就行了。

3.打开这个文件后,按command+F,在这个文件中查找“PROVISIONING_PROFILE",找到和这个“

PROVISIONING_PROFILE = "487F3EAC-05FB-4A2A-9EA0-31F1F35760EB";

"PROVISIONING_PROFILE[sdk=iphoneos*]" = "487F3EAC-05FB-4A2A-9EA0-31F1F35760EB";”相似的都删除。

4.而后保存文件,从新打开项目。xcode会提示你从新下载安装provisioning profile文件。下载后安装上就能够。


九、真机运行时,提示The executable was signed with invalid entitlements.

1.在工程中添加文件new file,选择plist文件,添加后名称为Entitlements.plist。

2.点击Entitlements.plist进行编辑,删除全部Root下的Key,而后添加一个Boolean类型,名称为get-task-allow的Key,Value为YES。

3.在Targets中的Build Setting选项卡中的Code Signing Entitlements的值设为Entitlements.plist,从新Build便可解决。


十、the file couldn't be opened because you don't have permission to view it

解决方法一:changed the value of the "Compiler for C/C++/Objective-C" to Default Compiler.

解决方法二:Project---Build Setting中 修改这一项,变成Default Compiler(Apple LLVM 6.0)

解决方法三:command + shift + k

解决方法四:xcode页面command +','调出设置页面点击最后一个'Location选项',点击第一个小箭头 会跳转到一个文件夹-->>删除文件夹-->>command+shift+K Claen一下-->> command + R


十一、error: [__NSArrayI objectAtIndex:]: index 1 beyond bounds [0 .. 0]

@interface ...

@property (nonatomic, readonly, strong) NSMutableArray *videos;

@end

@implementation ...

//懒加载初始化

- (id)init {

self = [super init];

if (self) {

_videos = [NSMutableArray new];

}

return self;

}


十二、UIWebView 加载https站点出现NSURLConnection/CFURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9843)

http://www.itnose.net/detail/6042798.html


1三、在使用百度地图时,使用的时候下面一句报错了~BMKMapPoint *pionts = new BMKMapPoint[index];用下面这句也报错    delete []points;

解决方案:将把文件后缀从m改为了mm。

分析:变态的百度静态库中采用ObjectC++实现,以上两句时ObjectC++的特性。若是把文件后缀改成mm,则xcode会用ObjectC++的方式来编译文件。


1四、setValue:forUndefinedKey: this class is not key value coding-compliant for the key

要设置tableviewCell的customClass,而不是file‘s owner的custom class


1五、_BSMachError: (os/kern) invalid capability (20) \

_BSMachError: (os/kern) invalid name (15) \

缘由:是本身在alertAction中添加了时间,可是并未采用延时机制。

[alertVC addAction:[UIAlertAction actionWithTitle:@"如今升级" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {

//这里添加了多线程,消除警告

dispatch_after(0.2, dispatch_get_main_queue(), ^{

NSURL *appStoreUrl = [NSURL URLWithString:[NSString stringWithFormat:kAppStore_APPVersionUrl,APP_ID]];

[[UIApplication sharedApplication] openURL:appStoreUrl];

NSLog(@"连接--%@",appStoreUrl);

});

}]];


1六、command/usr/bin/codesign failed with exit code 1- code sign error

http://stackoverflow.com/questions/29242485/command-usr-bin-codesign-failed-with-exit-code-1-code-sign-error


1七、ld: 4 duplicate symbols for architecture x86_64

问题  ld: 4 duplicate symbols for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

解决: "duplicate"和"symbols"。duplicate的中文意思是“重复的、复制的”,而symbols的意思是“符号”。也就是可能在你工程中引入了重复的东西。

第一种状况:在工程中重复导入了某一个类或文件,这通常出如今你添加第三方库的时候比较多,在不知道的状况下又导入了一次相同的类。

第二种状况:工程中在#import引入头文件的时候,将#import "XXX.h" 写成了#import "XXX.m"。错误的引入.m头文件


1八、layoutSubviews何时调用

layoutSubviews在如下状况下会被调用:

一、init初始化不会触发layoutSubviews

二、addSubview会触发layoutSubviews

三、设置view的Frame会触发layoutSubviews,固然前提是frame的值设置先后发生了变化

四、滚动一个UIScrollView会触发layoutSubviews

五、旋转Screen会触发父UIView上的layoutSubviews事件

六、改变一个UIView大小的时候也会触发父UIView上的layoutSubviews事件


1九、-[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[2]

字典不能传空值


20、-[__NSDictionaryM objectAtIndexedSubscript:]: unrecognized selector sent

__NSDictionaryM  没法将值传到下标索引对象,就是数组越界,而且不是数组,而是字典,因此,遇到这种crash

两种状况:

1.首先看看你 indexPath.row 用的有没有问题;

2.看看你请求下来的数据类型对不对。

2一、Error Domain=kCLErrorDomain Code=2 “The operation couldn’t be completed. (kCLErrorDomain error 2.)”

网络错误,CLGeocoder须要一个网络链接,不该该每分钟发送多个地理编码请求.geocoder断绝但愿保护本身免受被请求从一个设备过载。你只是必须限制你发送的请求数

2二、NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: NSBundle

方法一:

1. Right Click - Delete and Remove Reference

2. 从新引入文件

方法二:重命名该文件

2三、objc_msgSend()报错Too many arguments to function call ,expected 0,have3

Build Setting--> Apple LLVM  - Preprocessing--> Enable Strict Checking of objc_msgSend Calls  改成 NO

2四、void SendDelegateMessage(NSInvocation *): delegate (webView:decidePolicyForNewWindowAction:request:

- (void)dealloc {

_webview.delegate = nil;

[_webview stopLoading];

}

2五、too many errors emitted, stopping now解决办法 / 莫名其妙的错误:could not build module ‘Foundation’

让整个pch文件的内容在这两行代码之内

#ifdef __OBJC__

#endif

2六、Host is down -sendto(2) '192.168.1.2' port 53

看看本身的网络吧骚年,DNS和路由器IP不对应。

2七、[NSISObjectiveLinearExpression coefficientForVariable:]: unrecognized selector sent to instance 0x1cd93850

- (void) viewWillDisappear: (BOOL) animated {

[super viewWillDisappear: animated];

// Force any text fields that might be being edited to end so the text is stored

[self.view.window endEditing: YES];

}

。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。

持续更新中。。。

。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。

做者:JJ骏 连接:https://www.jianshu.com/p/39bb64d8397f 來源:简书 著做权归做者全部。商业转载请联系做者得到受权,非商业转载请注明出处。
相关文章
相关标签/搜索