unity3d 建筑物arm 64的未定义符号:|Firebase/统一/Xcode

e5nszbig  于 2023-01-05  发布在  其他
关注(0)|答案(1)|浏览(198)

我在Unity中构建了一个应用,并安装了Firebase SDK用于身份验证、分析和数据库。构建过程在Unity中运行良好,没有任何错误。但是,当我在Xcode中打开项目并尝试存档时,我收到了以下错误:

ld: warning: arm64 function not 4-byte aligned: _unwind_tester from  /Users/michael/Desktop/Reserve1/Libraries/libiPhone-lib.a(unwind_test_arm64.o)
Undefined symbols for architecture arm64:

"_OBJC_CLASS_$_FIRApp", referenced from:
  objc-class-ref in libFirebaseCppApp.a(app_ios.mm.o)
"_OBJC_CLASS_$_FIRTransactionResult", referenced from:
  objc-class-ref in libFirebaseCppDatabase.a(database_reference_ios.mm.o)
"_OBJC_CLASS_$_FIRTransactionResult", referenced from:
  objc-class-ref in libFirebaseCppDatabase.a(database_reference_ios.mm.o)
"_OBJC_CLASS_$_FIRDatabase", referenced from:
  objc-class-ref in libFirebaseCppDatabase.a(database_ios.mm.o)
"_OBJC_CLASS_$_FIRGameCenterAuthProvider", referenced from:
  objc-class-ref in libFirebaseCppAuth.a(credential_ios.mm.o)
"_OBJC_CLASS_$_FIRGoogleAuthProvider", referenced from:
  objc-class-ref in libFirebaseCppAuth.a(credential_ios.mm.o)
"_OBJC_CLASS_$_FIRPhoneAuthProvider", referenced from:
  objc-class-ref in libFirebaseCppAuth.a(credential_ios.mm.o)
"_OBJC_CLASS_$_FIRPhoneAuthCredential", referenced from:
  objc-class-ref in libFirebaseCppAuth.a(user_ios.mm.o)
"_OBJC_CLASS_$_FIROptions", referenced from:
  objc-class-ref in libFirebaseCppApp.a(app_ios.mm.o)
"_OBJC_CLASS_$_FIROAuthProvider", referenced from:
  objc-class-ref in libFirebaseCppAuth.a(credential_ios.mm.o)
 "_OBJC_CLASS_$_FIRConfiguration", referenced from:
  objc-class-ref in libFirebaseCppApp.a(app_ios.mm.o)
"_OBJC_CLASS_$_FIRFacebookAuthProvider", referenced from:
  objc-class-ref in libFirebaseCppAuth.a(credential_ios.mm.o)
"_OBJC_CLASS_$_FIRDatabaseReference", referenced from:
  objc-class-ref in libFirebaseCppDatabase.a(database_reference_ios.mm.o)
"_OBJC_CLASS_$_FIREmailAuthProvider", referenced from:
  objc-class-ref in libFirebaseCppAuth.a(credential_ios.mm.o)
"_OBJC_CLASS_$_FIRGitHubAuthProvider", referenced from:
  objc-class-ref in libFirebaseCppAuth.a(credential_ios.mm.o)
"_OBJC_CLASS_$_FIRTwitterAuthProvider", referenced from:
  objc-class-ref in libFirebaseCppAuth.a(credential_ios.mm.o)
"_OBJC_CLASS_$_FIRAuth", referenced from:
  objc-class-ref in libFirebaseCppAuth.a(auth_ios.mm.o)
 "_FIRAuthErrorUserInfoUpdatedCredentialKey", referenced from:
  firebase::auth::SignInResultCallback(FIRAuthDataResult*, NSError*, firebase::SafeFutureHandle<firebase::auth::SignInResult>, firebase::auth::AuthData*) in libFirebaseCppAuth.a(auth_ios.mm.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我几乎什么都试过了,包括:

  1. Cocoapod安装/删除/重新安装
  2. IOS解析器设置更改
    1.在Unity和Xcode上重新安装SDK
    1.以多种方式编辑Pod文件
    1.按照我看到的每一篇文章的说明
    我使用的是Unity版本2020.3.36f1和Xcode版本13.4.1
    然而,在包括这个网站在内的多个网站上浏览了几个小时之后,似乎什么都不起作用。我知道有一种方法。但我似乎找不到。
    请帮帮我。
1cosmwyk

1cosmwyk1#

经过10多个小时的研究和反复试验,我找到了解决方案。这可能会回答我在各地看到的数百个尚未得到答案的问题。我们开始吧:
在Mac上,我遇到的问题是Cocoapods在尝试构建和运行时失败,这导致了Xcode中的所有错误。

逐步:

1.打开您的Xcode项目。(始终保持打开状态)
1.在Finder中找到Xcode项目文件夹。
1.右键单击文件夹并选择“在文件夹中新建终端”
1.如果您有一个M1芯片类型“sudo arch -x86_64 gem安装ffi”,那么“arch -x86_64 pod安装”,否则英特尔“pod安装”。
你现在应该看到一堆绿色!框架的所有gems都应该安装好了。
然后,您将在Unity的build文件夹中拥有一个工作区项目,您可以完全在Xcode中构建项目而不会失败。
希望这有帮助!

相关问题