IOS运维报错,常见报错的消除格局

2019-05-03 22:30 来源:未知

fsurczqtrxdfujfaheklacpbsecc/Build/Products/Debug-iphonesimulator/libRCTJCoreModule.a(RCTJCoreModule.o)) was built for newer iOS version (10.3) than being linked (8.0)

问题1:ARC与MRC混编

Undefined symbols for architecture x86_64:

可以给ARC项目添加MRC标记(-fno-objc-arc),也可以给MRC项目添加ARC标记(-fobjc-arc)

"_sqlite3_bind_int64", referenced from:

 

___27-[WXOMTAStore storeConfig:]_block_invoke in libRCTWeChat.a(MTAStore.o)

 

___40-[WXOMTAStore storeEvent:hasTrySent:CB:]_block_invoke in libRCTWeChat.a(MTAStore.o)

问题2:OC委托报错   Existing instance variable 'middleMan' for property 'middleMan' with assign 

"_sqlite3_bind_text", referenced from:

@interface Student : NSObject { id<Question> delegate; } 改为: 

___27-[WXOMTAStore storeConfig:]_block_invoke in libRCTWeChat.a(MTAStore.o)

@interface Student : NSObject { __unsafe_unretained id<Question> delegate; }

___40-[WXOMTAStore storeEvent:hasTrySent:CB:]_block_invoke in libRCTWeChat.a(MTAStore.o)

 

"_sqlite3_clear_bindings", referenced from:

 

___27-[WXOMTAStore storeConfig:]_block_invoke in libRCTWeChat.a(MTAStore.o)

问题3:xcode6 使用MJRefresh,Too many arguments to function call, expected 0, have * 

___40-[WXOMTAStore storeEvent:hasTrySent:CB:]_block_invoke in libRCTWeChat.a(MTAStore.o)

 

"_sqlite3_close", referenced from:

将XCode升级到6后,报Too many arguments to function call, expected 0, have *,在XCode5.1里能编译通过的,到xcode6就报错

-[WXOMTAStore closeDB] in libRCTWeChat.a(MTAStore.o)

 

-[WXOMTADataConfigHolder closeDB] in libRCTWeChat.a(MTADataConfigHolder.o)

objc_msgSend(self.beginRefreshingTaget, self.beginRefreshingAction, self);

"_sqlite3_exec", referenced from:

 

-[WXOMTAStore updateDatabase:] in libRCTWeChat.a(MTAStore.o)

Too many arguments to function call, expected 0, have *

_execute_query in libRCTWeChat.a(MTAStore.o)

 

_execute_update in libRCTWeChat.a(MTAStore.o)

问了下度娘,

"_sqlite3_finalize", referenced from:

 

___27-[WXOMTAStore storeConfig:]_block_invoke in libRCTWeChat.a(MTAStore.o)

选中项目 - Project - Build Settings - ENABLE_STRICT_OBJC_MSGSEND 将其设置为 NO 即可;

___40-[WXOMTAStore storeEvent:hasTrySent:CB:]_block_invoke in libRCTWeChat.a(MTAStore.o)

 

"_sqlite3_free", referenced from:

 

-[WXOMTAStore updateDatabase:] in libRCTWeChat.a(MTAStore.o)

问题4:Undefined symbols for architecture i386: 问题

_execute_query in libRCTWeChat.a(MTAStore.o)

 

_execute_update in libRCTWeChat.a(MTAStore.o)

 Undefined symbols for architecture i386:

"_sqlite3_open", referenced from:

 

-[WXOMTAStore getDB] in libRCTWeChat.a(MTAStore.o)

  "_sqlite3_backup_finish", referenced from:

-[WXOMTADataConfigHolder getDB] in libRCTWeChat.a(MTADataConfigHolder.o)

 

"_sqlite3_prepare_v2", referenced from:

      _loadOrSaveDb in FMDatabase InMemoryOnDiskIO.o

___27-[WXOMTAStore storeConfig:]_block_invoke in libRCTWeChat.a(MTAStore.o)

 

___40-[WXOMTAStore storeEvent:hasTrySent:CB:]_block_invoke in libRCTWeChat.a(MTAStore.o)

  "_sqlite3_backup_init", referenced from:

"_sqlite3_reset", referenced from:

 

___27-[WXOMTAStore storeConfig:]_block_invoke in libRCTWeChat.a(MTAStore.o)

      _loadOrSaveDb in FMDatabase InMemoryOnDiskIO.o

___40-[WXOMTAStore storeEvent:hasTrySent:CB:]_block_invoke in libRCTWeChat.a(MTAStore.o)

 

"_sqlite3_step", referenced from:

  "_sqlite3_backup_step", referenced from:

___27-[WXOMTAStore storeConfig:]_block_invoke in libRCTWeChat.a(MTAStore.o)

 

___40-[WXOMTAStore storeEvent:hasTrySent:CB:]_block_invoke in libRCTWeChat.a(MTAStore.o)

      _loadOrSaveDb in FMDatabase InMemoryOnDiskIO.o

ld: symbol(s) not found for architecture x86_64

 

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

  "_sqlite3_bind_blob", referenced from:

 

 

 

      -[FMDatabase bindObject:toColumn:inStatement:] in FMDatabase.o

 

 

 

  "_sqlite3_bind_double", referenced from:

 

 

 

      -[FMDatabase bindObject:toColumn:inStatement:] in FMDatabase.o

 

 

 

  "_sqlite3_bind_int", referenced from:

 

 

解决方式::

      -[FMDatabase bindObject:toColumn:inStatement:] in FMDatabase.o

 

 

韦德娱乐1946网页版 1

  "_sqlite3_bind_int64", referenced from:

 

 

添加 libsqlite3.dylib

      -[FMDatabase bindObject:toColumn:inStatement:] in FMDatabase.o

 

 

步骤:1、按照上图步骤找出当前页面

  "_sqlite3_bind_null", referenced from:

2、Link Binary With Libraries 下拉至最后,点击

 

3、选择Add Other...

      -[FMDatabase bindObject:toColumn:inStatement:] in FMDatabase.o

4、CMD SHIFT G 然后输入 /user/lib 点击GO

 

韦德娱乐1946网页版 2

  "_sqlite3_bind_parameter_count", referenced from:

 

 

5、选择 libsqlite3.dylib 进行添加

      -[FMDatabase executeQuery:withArgumentsInArray:orDictionary:orVAList:] in FMDatabase.o

韦德娱乐1946网页版 3

 

      -[FMDatabase executeUpdate:error:withArgumentsInArray:orDictionary:orVAList:] in FMDatabase.o

 

  "_sqlite3_bind_parameter_index", referenced from:

 

      -[FMDatabase executeQuery:withArgumentsInArray:orDictionary:orVAList:] in FMDatabase.o

 

      -[FMDatabase executeUpdate:error:withArgumentsInArray:orDictionary:orVAList:] in FMDatabase.o

 

 

 

 

 

这个错误的发生原因一般是“XXX”这个文件(类库)虽然引入了工程中,但是由于种种原因(常见于多人开发,svn同步不规范)导致“XXX”并未被添加到project.pbxproj这个文件中。

 

解决方法是点击工程,在targets界面中找到Build Phases,根据提示信息“XXX”来判断缺少什么文件,一般如果缺少自定义的文件,XXX会是缺少的类名,那么就在Complie Sources中加入该文件。如果缺少类库,则在Link Binary With Libraries中加入该类库。

 

而上面问题是因为少在Link Binary With Libraries  中加入 libsqlite3.dylib ,添加后就可以编译通过。

 

Xcode 7 缺少 *.dylib库的解决方法

Xcode7中 Link Binary With Libraries 没有 *.dylib库,只能找到对应的 *.tbd,但不能代替使用,通过查找资料,尝试后得到以下两种解决方法。

 

1.Link Binary With Libraries 手动添加

首先点击 “ ”

 

韦德娱乐1946网页版 4

显示搜索添加页面,点击 Add Other

 

韦德娱乐1946网页版 5

出现文件目录页面,快捷键 CMD Shift G (Go to the folder),输入/usr/lib,添加你需要的 *.dylib。

 

韦德娱乐1946网页版 6

2.Build Phases 配置

project -> Build Phases ->Linking -> Other Linker Flag

 

添加 -l< 所需 dylib 的名称 >  

 

例如:libsqlite3.dylib  -> -lsqlite3  

 

问题5:在编译RegexKitLite的时候,报错如下:

 

Undefined symbols for architecture i386:

 

"_uregex_open", referenced from:

 

_rkl_getCachedRegex in RegexKitLite.o

 

"_uregex_groupCount", referenced from:

 

_rkl_getCachedRegex in RegexKitLite.o

 

"_uregex_setText", referenced from:

 

_rkl_setCachedRegexToString in RegexKitLite.o

 

 

 

解决办法:

 

在项目的编译设置中找到Build settings->Linking->Other Linker Flags,然后在后面字段空白处双击,

 

添加“-licucore”就可以了。

 

韦德娱乐1946网页版 7

 

 

 问题6: "_OBJC_CLASS_$_MFMessageComposeViewController", referenced from:

 

   l_OBJC_$_CATEGORY_MFMessageComposeViewController_$_BlocksKit in BlocksKit(BlocksKit)

 

原因:

 

这是编译器找不到符号定义,通常这意味着某些framework没有加入项目中

 

解决参考:

 

解读信息,是因为找不到叫MFMessageComposeViewController的ObjC类。

 

查找MFMessageComposeViewController的信息,得知其定义在MessageUI.framework中,将其加入到项目中即可;

 

问题7:"_OBJC_CLASS_$_CTTelephonyNetworkInfo", referenced from:

 

解决方法:在build phases里加一下 CoreTelephony.framework就可以了

 

 

 

问题8: Xcode  "_deflate", referenced from:

 

解决办法:添加libz.dylib类库

 

 

问题9:iOS真机调试的时候报错:/libUPPayPlugin.a(UPJSON.o)' 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 arm64 error: linker command failed with exit code 1 (use -v to see invocation)

解决办法:看看是不是bitcode开着呢,把bitcode改为no

 

 

问题10:XCTest/XCTest.h not found on old projects built in Xcode

问题描述:

 

fatal error: 'XCTest/XCTest.h' file not found#import  解决方法: 在报错的Target中的Building settings中FRAMEWORK_SEARCH_PATHS添加$(PLATFORM_DIR)/Developer/Library/Frameworks

 

问题11:添加第三方类库造成的linker command failed with exit code 1 (use -v to see invocation)的错误调试

 linker command failed with exit code 1 (use -v to see invocation)这个错误貌似遇见并不止一次,当我想用某个第三方类库的时候(如SBJson),我直接把类库文件copy到工程目录里面,然后一编译就出现这样错误(并不是一定会出这样错误),开始以为是网上下载的类库本身问题,所以重新找类库或者其他方式将它添加进去,只要不出错就行,也一直没有深入了解根本问题,今天在给工程添加一个FMDB(SQLIte第三方类库)文件编译时又出现这种错误,一开始以为工程问题,但是新建工程后还是出现这个问题,经过网上查找,得到了解决办法;

 

 

 

[cpp] view plain copy

  1. Undefined symbols for architecture i386:  
  2.   "_OBJC_CLASS_$_FMDatabase", referenced from:  
  3.       objc-class-ref in ViewController.o  
  4. ld: symbol(s) not found for architecture i386  
  5. clang: error: linker command failed with exit code 1 (use -v to see invocation)  

 

 

 

 

韦德娱乐1946网页版 8

 

 

 

在网上得到解决办法是:

 

在工作左边导航栏Target-->Build Phases-->compile Sources中,第三库库的所有.m文件都添加到里面,然后编译通过了;

 

 

 

 

 

 

添加.m文件

 

 

 

 

根据对比可以看见 in FMDBTest,FMDBTest的Target里添加进去了了一些.m文件

 

韦德娱乐1946网页版 9

 

 

 

对于以上错误,根据网友解答我的理解是

 

我们在使用这些第三方类库文件时直接将其拖拽到工程之中,编译的的时候Xcode也没有自动引用,所以造成这样错误,这就需要我们手动添加。假如我们在工程中新建某个文件就不会出现这样问题;

 

 

问题12:关于导入文件错误:too many errors emitted, stopping now [-ferror-l  

解决方法:build settings 里 Compile Sources As选项改为Objective C 。

 

 

 

问题13:dyld: Library not loaded: @rpath/XCTest.framework/XCTest

  Referenced from: /var/containers/Bundle/Application/B5212ED6-4ECE-4BCC-A52A-689CBD400E44/02

  • 韦德娱乐1946网页版,album.app/02 - album

 

  Reason: image not found

 

解决方法:多加了两个m文件,下图中m文件删除即可

 

 

 

 

问题14:Unsupported compiler 'com.apple.compilers.llvmgcc42' selected for architecture 'armv7'

解决方法:

Change your compiler for C/C /ObjectiveC Go to Build Settings->Build OPtions->compiler for C/C /ObjectiveC; select Default(Apple LLVM5.0)

 

TAG标签: 韦德娱乐1946
版权声明:本文由韦德娱乐1946_韦德娱乐1946网页版|韦德国际1946官网发布于韦德娱乐1946网页版,转载请注明出处:IOS运维报错,常见报错的消除格局