Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/114.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 架构x86_64的Firebase未定义符号_Ios_Firebase - Fatal编程技术网

Ios 架构x86_64的Firebase未定义符号

Ios 架构x86_64的Firebase未定义符号,ios,firebase,Ios,Firebase,我正在使用firebase作为我在iOS中工作的项目的一部分,当我试图针对iPhone6或7模拟器编译代码进行测试时,我偶然发现了以下链接错误 Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_GTMSessionUploadFetcher", referenced from: objc-class-ref in FirebaseStorage(FIRStorageUploadTask_d5061b1e2b5f1b

我正在使用firebase作为我在iOS中工作的项目的一部分,当我试图针对iPhone6或7模拟器编译代码进行测试时,我偶然发现了以下链接错误

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_GTMSessionUploadFetcher", referenced from:
      objc-class-ref in FirebaseStorage(FIRStorageUploadTask_d5061b1e2b5f1bb249816cc5fc42ff62.o)
  "_OBJC_CLASS_$_GTMLogger", referenced from:
      objc-class-ref in FirebaseMessaging(GIPReachability_ae5504e4a6a28a1d8997c6f38e8bff8b.o)
  "_kGTMSessionUploadFetcherStandardChunkSize", referenced from:
      -[FIRStorageUploadTask enqueue] in FirebaseStorage(FIRStorageUploadTask_d5061b1e2b5f1bb249816cc5fc42ff62.o)
  "_GTMFetcherStandardUserAgentString", referenced from:
      -[FIRAuthBackendRPCIssuerImplementation init] in FirebaseAuth(FIRAuthBackend_ea73237c278bd1b78e1c76db2a16775a.o)
  "_OBJC_CLASS_$_GTMSessionFetcher", referenced from:
      objc-class-ref in FirebaseStorage(FIRStorageDownloadTask_c390366e83519f6636ca985ecb70e5d0.o)
      objc-class-ref in FirebaseStorage(FIRStorage_691ea9ac7cb4d224d37df2ff8a911989.o)
  "_OBJC_CLASS_$_GTMSessionFetcherService", referenced from:
      objc-class-ref in FirebaseAuth(FIRAuthBackend_ea73237c278bd1b78e1c76db2a16775a.o)
      objc-class-ref in FirebaseStorage(FIRStorage_691ea9ac7cb4d224d37df2ff8a911989.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我使用的是Xcode 8.2.1、swift 3.0,我的项目中还有以下Pod文件

pod 'Braintree'
pod 'Firebase/Auth'
pod 'Firebase/Database'
pod 'Firebase/Core'
pod 'Firebase/Storage'
pod 'Firebase/Messaging'
pod 'Firebase/RemoteConfig'
pod 'GeoFire', :git=>'https://github.com/firebase/geofire-objc.git'
pod 'ObjectMapper', '~> 2.2'
我已经做了一个pod更新,以防有些东西过时,但没有运气。当我使用iPhone4或5模拟器时,代码编译并运行良好

编辑:

我已将Build Active architectures设置为No,在有效的体系结构中,我列出了arm64、armv7、armv7s,现在Objectmapper失败,即使文件中声明了
import Objectmapper

 Use of undeclared type 'Mappable'
任何帮助都将不胜感激!先谢谢你


乔治。

这似乎是衍生数据的一个小故障。我退出了Xcode,删除了
/Users/USER\u NAME/Library/Developer/Xcode/PROJECT\u NAME


重新启动Xcode,编译并按预期工作,无需仅更改活动体系结构中的任何内容。

对于我来说,我只是将Firebase framework安装到Xcode,由于其他无法解决的问题,没有使用CoCoPoads。构建后,会出现类似的错误,如上文所述,“未找到架构x86_64的符号”。(可能是因为我在VMWare上使用Xcode)

然后我必须手动转到通用链接框架和库并添加:

libsqlite3.tbd、libz.tbd、libc++.tbd


我尝试了这个问题的解决方案,但没有任何效果。还发现了SO和GitHub问题中的其他线程。没有任何帮助。我使用的是Xcode 9.2,Swift 4,最新版本的可可豆。这对我有用

首先,我的pod文件只包含一个firebase pod,因为我目前只使用分析,但是如果您使用更多,解决方案应该是相同的。
吊舱“火力基地/核心”

其次,与文档状态一样,确保将-ObjC添加到其他链接器标志中。我在项目级和目标级构建设置中都这样做了。他们是不同的

第三,也是最重要的一点,在项目级构建设置和其他链接器标志中,添加以下内容

-框架

“FirebaseCore”

-框架

“FirebaseAnalytics”

-框架

“FirebaseInstanceID”

-框架

“FirebaseNanoPB”

-框架

“FirebaseCoreDiagnostics”

-框架


“nanopb”

也有同样的问题,对我来说,问题是我手动导入了FirebaseMessaging框架,方法是下载整个Firebase SDK,然后手动将消息框架导入到项目中(我没有使用Cocoapods或Carthage)。我没有在同一个文件夹“Protobuf.framework”中导入另一个框架。一旦添加Protobuf并确保目标成员包括我的项目目标,它就成功了。

刚刚发现了一个类似的问题,并通过清除Pod缓存解决了它

清除CocoaPods缓存

吊舱去集成和吊舱缓存清理-全部

重新安装吊舱

吊舱安装

也有这个问题…
$(继承)
添加到构建设置中的其他链接器标志,现在一切正常

我尝试了“清除Cocoapods缓存”和“删除派生数据”解决方案,但没有成功。对我有效的是我在迦太基设置中发现的一个步骤(我仍然在使用Cocoapods)

$(其他\u LDFLAGS)-ObjC
标志添加到“构建”中的“其他链接器标志” 设置”

您可以在此处看到步骤:

我的信息


安装:Cocoapods | SDK:FirebaseAnalytics(6.1.2)| IDE:Xcode 11.0 | macOS:Mojave 10.14.5 Beta |语言:Swift 4.2 |平台目标:iOS 11.0+

在安装Firebase吊舱后,使用Firebase站点中解释的CoCoCoapods也出现此问题:

pod“火力基地/分析” 吊舱“火力基地/授权”

在安装吊舱的过程中,我收到一条警告,告诉我:

[!] The target `myTarget [Debug]` overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Pods.xcconfig'.
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

[!] The target `myTarget [Release]` overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Pods.xcconfig'.
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.
编译时,我得到了几个文件的错误:

Undefined symbols for architecture x86_64:
在这个答案之前,我尝试了以下答案的解决方案,它很有魅力:

基本上,解决方案是(正如@Ankish Jain所解释的):

转到您的目标构建设置->其他链接器标志->双击->+按钮。将$(继承的)添加到新行


在那之后,我成功地编译了,新的标志自动添加到构建设置中。

在我的例子中,从
其他链接器标志中删除
$(继承)
后,一切都正常了。对我来说,问题是当我在新框架中拖动时,xCode有一个错误,它无法正确设置目标成员身份


展开所有文件夹,转到您在开始此操作之前刚刚拖入的.framework文件或.m文件,高亮显示每个文件,按cmd+option+1,并确保选中目标成员资格框并将其设置为必需:

我以前遇到过此问题,看起来您需要:

rm-rf ios/Podfile ios/Podfile.lock ios/Pods ios/Runner.xcworkspace

然后跑
颤振运行

资料来源:

更新: 运行此命令也可以解决此问题:
rm-f ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings

在我的例子中,仅用于使用Firebase Auth和Firebase Firestore,使用CoCoPapods安装,我所要做的就是在Build Settings中的
其他链接器标志
下单击
+
符号以显示
调试
发布
部分。
$(继承)
标志已自动添加。在那之后建造得很好


在没有CocoaPods()的情况下进行集成的步骤之后,我遇到了同样的问题,其他答案都没有帮助我

对我有效的方法是从目标构建的其他链接器标志中删除-ObjC
pod 'Firebase/Core', '6.27.0'
Undefined symbols for architecture x86_64
error: linker command failed with exit code 1 (use -v to see invocation)
pod deintegrate && pod cache clean --all

rm -rf ~/Library/Developer/Xcode/DerivedData
pod 'Firebase', '6.27.0'
pod install