Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Errors in IPhone build (Completely lost)

Discussion in 'iOS and tvOS' started by danipren, Apr 14, 2020.

  1. danipren

    danipren

    Joined:
    Mar 28, 2014
    Posts:
    11
    I've been attempting to make a build of our app for iphone,
    the app contains firebase and our own code
    the app built out and released on android store no problem

    Ive built from unity on a mac out for IOS
    then opened this in xcode
    fixed any errors for certificates etc

    I then click Archive (i think this is how i build out?)
    build get about 3 quarters through
    then i get a bunch of errors about undefined symbols

    Im hoping this is an easy fix or something ive missed,
    any help would be greatly appreciated
     
    leon-sunday likes this.
  2. Neonlyte

    Neonlyte

    Joined:
    Oct 17, 2013
    Posts:
    505
    Detailed error messages would be nice. Just "undefined symbols" does not really help.
     
  3. danipren

    danipren

    Joined:
    Mar 28, 2014
    Posts:
    11
    Thanks for the reply ,of course, bit of a heavy error so lll post below, there are 26 altogether all like this one but where this error references FIRDatabaseReference it will reference something else eg FIRTransactionResult
     
  4. danipren

    danipren

    Joined:
    Mar 28, 2014
    Posts:
    11
    Ld /Users/apdesignlabs/Library/Developer/Xcode/DerivedData/Unity-iPhone-bqgwvwzksinwjlgfttpvacztaihs/Build/Products/ReleaseForRunning-iphoneos/Fbb.app/Fbb normal arm64 (in target 'Unity-iPhone' from project 'Unity-iPhone')

    cd /Users/apdesignlabs/Documents/Builds/TA4

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -target arm64-apple-ios10.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.4.sdk -L/Users/apdesignlabs/Library/Developer/Xcode/DerivedData/Unity-iPhone-bqgwvwzksinwjlgfttpvacztaihs/Build/Products/ReleaseForRunning-iphoneos -L/Users/apdesignlabs/Documents/Builds/TA4 -L/Users/apdesignlabs/Documents/Builds/TA4/Libraries -L/Users/apdesignlabs/Documents/Builds/TA4/Libraries/Plugins/iOS/Firebase -F/Users/apdesignlabs/Library/Developer/Xcode/DerivedData/Unity-iPhone-bqgwvwzksinwjlgfttpvacztaihs/Build/Products/ReleaseForRunning-iphoneos -filelist /Users/apdesignlabs/Library/Developer/Xcode/DerivedData/Unity-iPhone-bqgwvwzksinwjlgfttpvacztaihs/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/Unity-iPhone.build/Objects-normal/arm64/Fbb.LinkFileList -Xlinker -map -Xlinker /Users/apdesignlabs/Library/Developer/Xcode/DerivedData/Unity-iPhone-bqgwvwzksinwjlgfttpvacztaihs/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/Unity-iPhone.build/Fbb-LinkMap-normal-arm64.txt -dead_strip -Xlinker -object_path_lto -Xlinker /Users/apdesignlabs/Library/Developer/Xcode/DerivedData/Unity-iPhone-bqgwvwzksinwjlgfttpvacztaihs/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/Unity-iPhone.build/Objects-normal/arm64/Fbb_lto.o -fembed-bitcode-marker -stdlib=libc++ -fobjc-arc -fobjc-link-runtime -weak_framework CoreMotion -weak-lSystem -framework Security -framework MediaToolbox -liPhone-lib -framework CoreText -framework AudioToolbox -weak_framework AVFoundation -framework AVKit -framework CFNetwork -framework CoreGraphics -framework CoreMedia -weak_framework CoreMotion -framework CoreVideo -framework Foundation -framework OpenAL -framework OpenGLES -framework QuartzCore -framework SystemConfiguration -framework UIKit -liconv.2 -lil2cpp -lFirebaseCppAuth -lFirebaseCppAnalytics -lFirebaseCppDatabase -lFirebaseCppApp -lFirebaseCppStorage -framework CoreLocation -weak_framework Metal -Xlinker -dependency_info -Xlinker /Users/apdesignlabs/Library/Developer/Xcode/DerivedData/Unity-iPhone-bqgwvwzksinwjlgfttpvacztaihs/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/Unity-iPhone.build/Objects-normal/arm64/Fbb_dependency_info.dat -o /Users/apdesignlabs/Library/Developer/Xcode/DerivedData/Unity-iPhone-bqgwvwzksinwjlgfttpvacztaihs/Build/Products/ReleaseForRunning-iphoneos/Fbb.app/Fbb



    Undefined symbols for architecture arm64:

    "_OBJC_CLASS_$_FIRDatabaseReference", referenced from:

    objc-class-ref in libFirebaseCppDatabase.a(database_reference_ios_0c4ba7507f304dd9e420c9763efbc13d.o)

    "_OBJC_CLASS_$_FIRTransactionResult", referenced from:

    objc-class-ref in libFirebaseCppDatabase.a(database_reference_ios_0c4ba7507f304dd9e420c9763efbc13d.o)

    "_OBJC_CLASS_$_FIRStorageDownloadTask", referenced from:

    _OBJC_CLASS_$_FIRCPPStorageDownloadTask in libFirebaseCppStorage.a(storage_reference_ios_d4ae7e6e1b047c6d69662842095fcdc7.o)

    "_OBJC_CLASS_$_FIRConfiguration", referenced from:

    objc-class-ref in libFirebaseCppApp.a(log_ios_dd26aec5b8537064a4c15d38b58b4640.o)

    "_OBJC_CLASS_$_FIRStorage", referenced from:

    objc-class-ref in libFirebaseCppStorage.a(storage_ios_0e098fe85f3704b5186520ebe16fdff0.o)

    "_FIRStorageErrorDomain", referenced from:

    ____ZN8firebase7storage8internal24StorageReferenceInternal27CreateStreamingDownloadTaskEP19FIRStorageReferencePNS1_15StorageInternalEU13block_pointerFvP6NSDataP7NSErrorEPvm_block_invoke.86 in libFirebaseCppStorage.a(storage_reference_ios_d4ae7e6e1b047c6d69662842095fcdc7.o)

    "_OBJC_METACLASS_$_GTMSessionFetcherService", referenced from:

    _OBJC_METACLASS_$_FIRCPPGTMSessionFetcherService in libFirebaseCppStorage.a(storage_ios_0e098fe85f3704b5186520ebe16fdff0.o)

    "_OBJC_METACLASS_$_GTMSessionFetcher", referenced from:

    _OBJC_METACLASS_$_FIRCPPGTMSessionFetcher in libFirebaseCppStorage.a(storage_ios_0e098fe85f3704b5186520ebe16fdff0.o)

    "_OBJC_CLASS_$_FIRGameCenterAuthProvider", referenced from:

    objc-class-ref in libFirebaseCppAuth.a(credential_ios_7e32949a14fe9694040ff5eed8d1b954.o)

    "_OBJC_CLASS_$_FIREmailAuthProvider", referenced from:

    objc-class-ref in libFirebaseCppAuth.a(credential_ios_7e32949a14fe9694040ff5eed8d1b954.o)

    "_OBJC_CLASS_$_GTMSessionFetcher", referenced from:

    _OBJC_CLASS_$_FIRCPPGTMSessionFetcher in libFirebaseCppStorage.a(storage_ios_0e098fe85f3704b5186520ebe16fdff0.o)

    "_OBJC_CLASS_$_GTMSessionFetcherService", referenced from:

    _OBJC_CLASS_$_FIRCPPGTMSessionFetcherService in libFirebaseCppStorage.a(storage_ios_0e098fe85f3704b5186520ebe16fdff0.o)

    "_OBJC_CLASS_$_GKLocalPlayer", referenced from:

    objc-class-ref in libFirebaseCppAuth.a(credential_ios_7e32949a14fe9694040ff5eed8d1b954.o)

    "_OBJC_CLASS_$_FIRStorageMetadata", referenced from:

    objc-class-ref in libFirebaseCppStorage.a(metadata_ios_547edcd336b59c4ab2118a9a2044b159.o)

    "_OBJC_CLASS_$_FIRPhoneAuthProvider", referenced from:

    objc-class-ref in libFirebaseCppAuth.a(credential_ios_7e32949a14fe9694040ff5eed8d1b954.o)

    "_OBJC_CLASS_$_FIRApp", referenced from:

    objc-class-ref in libFirebaseCppApp.a(app_ios_814e1620d4f88024cea4bade26623a67.o)

    "_OBJC_CLASS_$_FIRGoogleAuthProvider", referenced from:

    objc-class-ref in libFirebaseCppAuth.a(credential_ios_7e32949a14fe9694040ff5eed8d1b954.o)

    "_OBJC_METACLASS_$_FIRStorageDownloadTask", referenced from:

    _OBJC_METACLASS_$_FIRCPPStorageDownloadTask in libFirebaseCppStorage.a(storage_reference_ios_d4ae7e6e1b047c6d69662842095fcdc7.o)

    "_OBJC_CLASS_$_FIRGitHubAuthProvider", referenced from:

    objc-class-ref in libFirebaseCppAuth.a(credential_ios_7e32949a14fe9694040ff5eed8d1b954.o)

    "_OBJC_CLASS_$_FIRFacebookAuthProvider", referenced from:

    objc-class-ref in libFirebaseCppAuth.a(credential_ios_7e32949a14fe9694040ff5eed8d1b954.o)

    "_OBJC_CLASS_$_FIROAuthProvider", referenced from:

    objc-class-ref in libFirebaseCppAuth.a(credential_ios_7e32949a14fe9694040ff5eed8d1b954.o)

    "_OBJC_CLASS_$_FIRPhoneAuthCredential", referenced from:

    objc-class-ref in libFirebaseCppAuth.a(user_ios_1b162c7ca01af7914d8255750deffbf0.o)

    "_OBJC_CLASS_$_FIRDatabase", referenced from:

    objc-class-ref in libFirebaseCppDatabase.a(database_ios_e51dee2718c2fa50bb12fbc46a002ec6.o)

    "_OBJC_CLASS_$_FIROptions", referenced from:

    objc-class-ref in libFirebaseCppApp.a(app_ios_814e1620d4f88024cea4bade26623a67.o)

    "_OBJC_CLASS_$_FIRAuth", referenced from:

    objc-class-ref in libFirebaseCppAuth.a(auth_ios_b54468d60a10f4f18faae0e528a8c0ba.o)

    "_OBJC_CLASS_$_FIRTwitterAuthProvider", referenced from:

    objc-class-ref in libFirebaseCppAuth.a(credential_ios_7e32949a14fe9694040ff5eed8d1b954.o)

    ld: symbol(s) not found for architecture arm64

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

    Neonlyte

    Joined:
    Oct 17, 2013
    Posts:
    505
    It seems that your Firebase library is not properly linked. Specifically, all the Objective-C classes of the library are missing.
     
  6. danipren

    danipren

    Joined:
    Mar 28, 2014
    Posts:
    11
    Much appreciated for the reply Neonlyte. Not properly linked? You'll have to excuse me Im completely new to XCode so little knowledge on the terminology. How would i go about linking them? i assumed the unity build would contain the firebase librarys like it did for android?
     
  7. mylastggColto

    mylastggColto

    Joined:
    Feb 28, 2017
    Posts:
    28
    Are you using cocoapods to install Firebase? This is a long shot, but if that is the case, cocoapods will generate two files for the Xcode project:
    • Unity-iPhone.xcodeproj
    • Unity-iPhone.xcworkspace
    With cocoapods you have to open the project using the second one as it will load the 'pods' in a separate solution. If you use the first one, you won't be able to link the libraries as they simply won't be there
     
  8. danipren

    danipren

    Joined:
    Mar 28, 2014
    Posts:
    11
    Thanks mylastggcolto

    To be honest i have no idea if im using cocoapods or not, i have no idea how to access it. This is literally my first time using any apple software so i am so lost.

    I added firebase to the project by downloading the necessary unity files for Firebase Database,Storage,Auth etc these just dropped into the editor. This ran on windows and android fine so im assuming the firebase code is in there and working so how/why would i need to install firebase again with cocoapods is throwing me off?

    Ive tried to figure out the advice given above over last few days but i have no idea if cocoapods is even running and if so where it would spit out the required files
     
  9. mylastggColto

    mylastggColto

    Joined:
    Feb 28, 2017
    Posts:
    28
    @danipren cocoapods is a dependency manager for iOS, I assume firebase uses it to install itself / update itself when targeting the iOS system, this explains why everything works on android / windows but not iOS.

    I am pretty sure firebase does use cocoapods as you can read here: https://firebase.google.com/docs/unity/setup

    (iOS only) Install the following:
    • Xcode 9.4.1 or later
    • CocoaPods 1.4.0 or later
    If you can, send a screen of the Xcode project folder generated when you build for iOS and I should be able to tell if you are using cocoapods or not and guide you
     
    Last edited: Apr 26, 2020
  10. leon-sunday

    leon-sunday

    Joined:
    May 19, 2020
    Posts:
    12
    I'm having exactly this issues, I'm also totally lost... I missed a whole day on this and I can not figure out what the issue is.



    XCode 12.1
    Unity3d 2020.1.6f
    Cocoapod 1.10.0
    Firebase 16.6.1

    Using Analytics and Remote Config
     

    Attached Files:

  11. matt_unity258

    matt_unity258

    Joined:
    Dec 4, 2017
    Posts:
    17
  12. unity_471FE28708F9AD48A1AC

    unity_471FE28708F9AD48A1AC

    Joined:
    May 6, 2022
    Posts:
    3
    I also have the same problem these two day, still cannot fix it.

    • Xcode 13.4.1
    • CocoaPods 1.10.0
    • Firebase 9.1
    • Unity 2021.3.1f1
     

    Attached Files:

  13. Archoin

    Archoin

    Joined:
    Oct 31, 2018
    Posts:
    3
    After spending half a day on this issue, the following steps solved my issue:

    1. make sure your cocoapods installation is not broken
      1. I just reinstall it with the following command (close xcode first)
      2. gem uninstall cocoapods
        sudo gem install cocoapods
    2. cd to your generated xcode folder, run "pod install"
    3. fix whatever error it reports
      1. mine says could not find Firebase/Analytics, despite I did not use it at all... so I just add that package
    4. in unity, go to assets -> external dependency manager -> ios resolver -> settings -> cocoapods integration, make sure it is set to xcode workspace
    5. do another unity build (with replace), then you should see a Unity-iPhone.xcworkspace file. Open the xcworkspace file instead of the xcodeproj file. your project should build without those firebase link errors
      1. if you don't see the .xcworkspace project, it means your cocoapods is still broken