Xcode编译错误和警告汇总

1、error: macro names must be identifiers YourProject_prefix.pch

原因: 因为你弄脏了预处理器宏,在它处于<Multiple Values>的时候修改了它

解决方法: Configiration选择All Configirations,清空它 然后分别重新定义你的Debug,Release,Distributin预处理器宏吧

2、warning: no rule to process file ‘$(PROJECT_DIR)/LoadingView.h‘ of type sourcecode.c.h for architecture armv6

原因: Target里Compile Sources里含有头文件 了,那里面不需要头文件

解决方法: 从Target里Compile Sources里删除头文件

3、Command /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Plug-ins/iPhoneOS Build System Support.xcplugin/Contents/Resources/copypng failed with exit code 1

原因: png图像文件拷贝失败,看看信息上面提示Can‘t find哪个文件,一般都是从文件系统里删除文件而没有通过Xcode删除造成的,Xcode的项目配置文件依然纪录着这个文件的引用

解决办法: 给文件系统里增加相应的文件,或者从Xcode的Groups & Files删除它,或者从Target的Copy Bundle Resources里删除它

4、Code Sign error: The identity ‘iPhone Developer: Your Name‘ doesn‘t match any valid certificate/private key pair in the default keychain

原因: 签名错误

解决办法: Target -> Get Info -> Build -> Code Signing -> 修改签名

记得左上角的Configuration类型要跟当前Build类型对应(Debug, Release, Distribution),否则改了也白改

5、could not create bundle folder for versioned model *.moda(好像是这个后缀名的这个文件)

原因:编译一次会产生一个新的

解决办法:应该把编译产生出来的moda文件都删了,然后clean下工程,重新build即可

6、error:There are no valid certificate/private key pairs in the default keychain

7、error:Cannot assign to ‘self‘ outside of a method in the init family

原因:只能在init方法中给self赋值,Xcode判断是否为init方法规则:方法返回id,并且名字以init     +大写字母开头+其他  为准则。例如:- (id) initWithXXX;

出错代码:- (id) Myinit{

self = [super init];

……

}

解决方法:- (id) initWithMy

{

self = [super init];

}

8、Storyboards are unavailable on iOS 4.3 and prior

解决办法:需要清除~/Library/Developer/Xcode/DerivedData中对应当前项目的文件夹,然后重新编译就没问题了,这应该是Xcode4.5.1的一个bug。

9、Application windows are expected to have a root view controller at the end of application launch

解决方法:在ios5以上版本,应用程序加载时,需要一个 root view controller ,所以需要编写代码

_rootViewController = [[RootViewController alloc] init];

self.window.rootViewController = _rootViewController;

10、error: failed to attach to process ID 0

解决方法:

1)delete the App directy under ~/Library/Developer/Xcode/DerivedData

2) start Xcode, in the menubar Project -> Clean

时间: 2024-08-05 15:07:14

Xcode编译错误和警告汇总的相关文章

Xcode编译错误和警告汇总&lt;转&gt;

1.error: macro names must be identifiers YourProject_prefix.pch 原因: 因为你弄脏了预处理器宏,在它处于<Multiple Values>的时候修改了它 解决方法: Configiration选择All Configirations,清空它 然后分别重新定义你的Debug,Release,Distributin预处理器宏吧 2.warning: no rule to process file '$(PROJECT_DIR)/Loa

Xcode编译异常和警告汇总(持续更新中)

1.Method definition for 'xxx' not found xxx的方法没有实现 出现原因.h声明了xxx方法但是.m没有实现xxx方法 解决方法:在类的.m文件实现xxx方法 2. Instance variable ‘xxx' accessed in class method  在类方法中访问了'xxx’实例变量 出现原因:在类方法中使用了实例变量 解决方法:如果真得需要在类方法中使用某个变量,可以把这个变量定义成全局变量,而不要实例变量,如在类方法外面定义变量(就是定义

ios Xcode编译错误

[BEROR]CodeSign error: code signing is requiredfor product type 'Application' in SDK 'iOS 7.1' xcode编译出现这个错误,我的做法是,附图 ios Xcode编译错误

关于Linux下C编译错误(警告)cast from &#39;void*&#39; to &#39;int&#39; loses precision

char *ptr; //此后省略部分代码 if( (int)ptr==-1 ) //出错地方 那句话的意思是从 void* 到 int 的转换丢失精度,相信看到解释有些人就明白了, 此问题只会出现在X64位的Linux上,因为在64位的机器上指针占用8个字节,int 占用四个字节,所以才会出现这样的问题, 解决方法: (long)ptr == -1 就好了 关于Linux下C编译错误(警告)cast from 'void*' to 'int' loses precision

xcode 编译错误 note: please rebuild precompiled header &#39;/Users/wdl/Library/Developer/Xcode/DerivedData/ModuleCache/97F16MVNSP3M/UIKit-35TDUEIBFI6H.pcm&#39;

在真机调试时遇到 atal error: file '/Applications/Xcode6.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIWebView.h' has been modified since the precompiled hea

linker command failed with exit code 1 (use -v to see invocation),经典Xcode编译错误的出现和解决!

linker command failed with exit code 1 (use -v to see invocation)这个肯定是个xcode编译运行的时候经典的报错了. 这个问题曾经在我的项目编译和运行的时候多次出现,但是从来没有记录过.现在就想每次出现对它进行一下记录,这样为以后出现同样的问题的时候让自己也有个更加快速的方法找到解决之路. linker command failed with exit code 1 (use -v to see invocation)有很多种情况,

xcode编译错误

1.xcode无效文件的编译错误. 问题: clang: error: no such file or directory: '/Users/admin/client/trunk/sengoku_sc/sengoku/libs/plugin/plugins/facebook/platform/ios/DynamicFacebook.mm' 解决办法:这个是因为资源找不到的原因,选择project > Build Phases >打开 "Compile Sources" an

xcode 编译错误找不到 libz.dylib

图片对应的是libxml2.dylib  (libz.dylib 遇到的编译错误跟这个类似) 解决方法是在引入库的地方调整原先 比如libz.dylib 的目录: ======================= ================================== 解决方法: target---build phases--- link binary with libraries---添加---add ohter---command+shift+G----/usr/lib/ ---

Xcode编译错误:code object is not signed at all

当你在编译某个项目的时候需要用到代码签名(Code Signing)的时候,出现了以下错误.如下图所示: 这个时候解决的办法就是:设置一个签名标志位的值为:--deep.如下图所示: 这样就可以成功编译了.