错误及经验记录

1.今天用sharesdk分享时遇一错误,老是报"尚未设置微信url scheme"的错误,错误号-22006,参考了网上的一个帖子,得到解决方案如下:

这个是因为微信找不到 schemme 因为文档是要集成到plist文件里面的  但是解决的时候可以写到 工程-》info-》urltype添加一个url scheme把 这个问题就解决了。
原贴地址:http://blog.sina.com.cn/s/blog_79fded950101eci0.html

不过我的小有不同就是微信的scheme也有,检查发现和appdelegate里注册的不一样,修改完成解决!

2.今天遇到一个奇怪的问题,用AVAudioPlayer音频播放器播放音频的时候,突然无法播放,一直报如下错误:
Error : >aq> 1605: failed (-66680); will stop (11025/0 frames)
调了半天未果,原来是模拟器抽风了,把程序卸掉,xCode、模拟器关掉重启,然后就正常了

3.

用DDXML类。在他的代码,他设置ISA几处地方报错,xcode4.6后正式弃用。替代应该是object_setClass功能。但是,当我更换它,我得到一个警告:函数隐式声明“object_setClass'无效C99中。 
if(nodePtr->type == XML_ELEMENT_NODE)
{
self->isa = [DDXMLElement class];
//object_setClass(self, [DDXMLElement class]);
}
else if(nodePtr->type == XML_DOCUMENT_NODE)
{
self->isa = [DDXMLDocument class];
//object_setClass(self, [DDXMLDocument class]);
}

原因是未声明#include <objc/runtime.h>头文件

4.std::ios_base::Init::Init()”,referenced from 错误  

“std::ios_base::Init::Init()”,referenced from 错误 - 过☆客 - 过☆客

要解决这个问题,有二种办法:
1)将XCode?工程中Build Setting -> Apple LLVM compiler Language 标签下的C++ Language Dialect 和 C++ Standard Library 属性值修改为 Compiler Default 即可。
2)如果遇上一些工程,改变Apple LLVM compiler Language会导致其他的编译错误,所以,还有一种解决办法是在Build Phases -> Link binary with Libraries中加一个libstdc++.6.dylib就好了。
我使用的是第二种方法,调好了
 
5.解决RegexKitLite编译报错 
错误缩略 "_u_strlen", referenced from:
“_uregex_start”, referenced from:

解决办法:
在项目的编译设置中找到Other Linker Flags,然后在后面字段空白处双击,添加“-licucore”就可以了。

原文请参考 http://li-bonan.blog.163.com/blog/static/1355647702012844324498/

 

6.不知道是软件坑爹还是怎么回事,mac下的sqliteManager
先上图:


    ****************************************************


红色的NULL区域当时都是没填写的,自动生成的空字段,用is not null却判断不行

 

7.今天导入自己封装的第三方库的时候,遇到很多Dsymutil Warning的警告
解决方法是将build setting中的Debug infomation format设置为DWARF
 
 
8.导入第三方库的时候遇到了objc_msgsend对象报Too many arguments to function call的错误,仔细查看发现是OBJC_OLD_DISPATCH_PROTOTYPES是 非的,
解决方法是选中项目 Build Settings 将ENABLE_STRICT_OBJC_MSGSEND设置为 NO 即可
 
9.Xcode6.1 发布 出现 The ipa is invalid. It does not include a Payload Directory 错误(原文地址)

尝试搜索了网上的解决方案,均没有结果,于是自己想出了一种方案,试了试居然搞定了。

方法为:通过普通的archieve方式export出ipa包,然后将此包解压缩,把其中的Applications文件夹中的应用程序复制出来,然后新建一个文件夹叫Payload,然后将刚才的应用程序复制到该文件夹中,然后打包该文件成.zip文件,并修改后缀名成ipa,然后将此包通过Application Loader上传即可。

猜测可能是xcode6的bug,可能是自己生产ipa包的时候没有使用Payload文件夹。

 

10.xcode添加swift运行出现如下错误

yld: Library not loaded: @rpath/libswiftCore.dylib
  Referenced from: /Users/andy/Library/Developer/CoreSimulator/Devices/724FF0C3-6622-4D12-865A-90244C8C63C1/data/Containers/Bundle/Application/30D8974B-ED1A-4F3A-8958-E9B7AA8901A9/App.app/PlugIns/Today.appex/Today
  Reason: image not found

通过修改Build settings -> "Embeded content contains Swift Code" -> YES,如果还是有这个错误,修改runpath添加@executable_path/Frameworks

11.最近使用CocoaPods来添加第三方类库,无论是执行pod install还是pod update都卡在了Analyzing dependencies不动原因在于当执行以上两个命令的时候会升级CocoaPods的spec仓库,加一个参数可以省略这一步,然后速度就会提升不少。加参数的命令如下:

pod install --verbose --no-repo-update

pod update --verbose --no-repo-update

12.Images.xcassets: None of the input catalogs contained a matching app icon set named "AppIcon".

Images.xcassets: None of the input catalogs contained a matching app icon set 

named "AppIcon".

解决方法:工程-build setting- 搜索asset- 删除 AppIcon

 

13“_BZ2_bzDecompressInit”, referenced from: _matroska_decode_buffer in libavformat.a(matroskadec.o)
“_BZ2_bzDecompress”, referenced from:
_matroska_decode_buffer in libavformat.a(matroskadec.o)
“_BZ2_bzDecompressEnd”, referenced from: _matroska_decode_buffer in libavformat.a(matroskadec.o)

请在build Phases--》link Binary with Libraries中引入libbz2.1.0.lib

14.程序启动崩溃

 

objc[31779]: Class PLBuildVersion is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices (0x11bd66998) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibraryServices.framework/PhotoLibraryServices (0x11bb88880). One of the two will be used. Which one is undefined.

 

这个错误很多地方会报,一些第三方SDK也会报。经过查看堆栈,是由字体引起,查阅文章后发现可能是由于使用了未定义字体,经排查是项目将原有放置在应用内使用的字体改为网络下载,plist配置文件删除字体过程中,未删除完全,删除解决

 

posted @ 2015-01-16 13:58  PFY  阅读(797)  评论(0编辑  收藏  举报