Reputation: 71
I've built an app in Unity and have installed the Firebase SDK for authentication, analytics, and the database. The build process works just fine in Unity. No errors at all. However, when I open up the project in Xcode and try to archive it, I get these errors:
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)
I've tried almost everything, including:
I'm using Unity version 2020.3.36f1 and Xcode version 13.4.1
Yet after following solutions on multiple websites including this one for hours, nothing seems to work. I know there's a way. I just can't seem to figure it out.
Please help .
Upvotes: 1
Views: 7851
Reputation: 71
After over 10 hours of research and trial and error I've found the solution. This is probably going to answer hundreds of questions I've seen all over the place that have not been answered. Here we go:
On Mac the issue for me was the Cocoapods failing when trying to Build and Run. Which created all of the errors in Xcode.
Step By Step:
You should now see a bunch of green! All of the gems for the framework should be installed.
You will then have a workspace project in your build folder from unity and you can fully build your project in Xcode without it failing.
Hope this helps!
Upvotes: 6