简体   繁体   中英

Error with firebase while building on Xcode for iOS

im having some troubles building an app in xcode but the build in Unity to android works just fine. I have searched all over and none of the other solutions helped me to get the build done. Im not using any pods just switch target to iOS, signing and trying to build. The error that xcode gives me is this:

Showing Recent Errors Only

Build target UnityFramework of project Unity-iPhone with configuration ReleaseForRunning warning: OpenGLES is deprecated. Consider migrating to Metal instead. (in target 'UnityFramework' from project 'Unity-iPhone')

Ld /Users/schrodingerlab/Library/Developer/Xcode/DerivedData/Unity-iPhone-cznkgmrdhbgorsbwisensbubkxok/Build/Products/ReleaseForRunning-iphoneos/UnityFramework.framework/UnityFramework normal (in target 'UnityFramework' from project 'Unity-iPhone') cd /Users/schrodingerlab/Thermomix_40/buildenios6 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -target arm64-apple-ios12.0 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.4.sdk -L/Users/schrodingerlab/Library/Developer/Xcode/DerivedData/Unity-iPhone-cznkgmrdhbgorsbwisensbubkxok/Build/Products/ReleaseForRunning-iphoneos -L/Users/schrodingerlab/Thermomix_40/buildenios6/Libraries -L/Users/schrodingerlab/Thermomix_40/buildenios6/Libraries/com.ptc.vuforia.engine/Vuforia/Plugins/iOS -L/Users/schrodingerlab/Thermomix_40/buildenios6/Libraries/Plugins/iOS/Firebase -F/Users/schrodingerlab/Library/Developer/Xcode/DerivedDa ta/Unity-iPhone-cznkgmrdhbgorsbwisensbubkxok/Build/Products/ReleaseForRunning-iphoneos -F/Users/schrodingerlab/Thermomix_40/buildenios6/Frameworks/com.unity.ads/Plugins/iOS -F/Users/schrodingerlab/Thermomix_40/buildenios6/Frameworks/com.ptc.vuforia.engine/Vuforia/Plugins/iOS -filelist /Users/schrodingerlab/Library/Developer/Xcode/DerivedData/Unity-iPhone-cznkgmrdhbgorsbwisensbubkxok/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/UnityFramework.build/Objects-normal/arm64/UnityFramework.LinkFileList -install_name @rpath/UnityFramework.framework/UnityFramework -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -map -Xlinker /Users/schrodingerlab/Library/Developer/Xcode/DerivedData/Unity-iPhone-cznkgmrdhbgorsbwisensbubkxok/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/UnityFramework.build/UnityFramework-LinkMap-normal-arm64.txt -dead_strip -Xlinker -object_path_lto -Xlinker /Users/schrodingerlab/Library/Developer/Xcode/Deriv edData/Unity-iPhone-cznkgmrdhbgorsbwisensbubkxok/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/UnityFramework.build/Objects-normal/arm64/UnityFramework_lto.o -fembed-bitcode-marker -stdlib=libc++ -fobjc-arc -fobjc-link-runtime -lc++ -weak_framework CoreMotion -weak-lSystem -liPhone-lib -framework Security -framework MediaToolbox -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 -framework UnityAds -lVuforiaWrapper -framework Vuforia -lFirebaseCppMessaging -lFirebaseCppAnalytics -lFirebaseCppApp -framework AdSupport -framework CoreTelephony -framework StoreKit -framework CoreLocation -weak_framework Metal -weak_framework GameController -weak_framework U serNotifications -Xlinker -no_adhoc_codesign -Xlinker -dependency_info -Xlinker /Users/schrodingerlab/Library/Developer/Xcode/DerivedData/Unity-iPhone-cznkgmrdhbgorsbwisensbubkxok/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/UnityFramework.build/Objects-normal/arm64/UnityFramework_dependency_info.dat -o /Users/schrodingerlab/Library/Developer/Xcode/DerivedData/Unity-iPhone-cznkgmrdhbgorsbwisensbubkxok/Build/Products/ReleaseForRunning-iphoneos/UnityFramework.framework/UnityFramework

Undefined symbols for architecture arm64: " OBJC_CLASS $_FIRConfiguration", referenced from: objc-class-ref in libFirebaseCppApp.a(log_ios_dd26aec5b8537064a4c15d38b58b4640.o) " OBJC_CLASS $_FIRMessaging", referenced from: objc-class-ref in libFirebaseCppMessaging.a(messaging_231c52c311096cfce13e67fa91eb9ac5.o) " OBJC_CLASS $_FIRApp", referenced from: objc-class-ref in libFirebaseCppApp.a(app_ios_814e1620d4f88024cea4bade26623a67.o) " OBJC_CLASS $_FIROptions", referenced from: objc-class-ref in libFirebaseCppApp.a(app_ios_814e1620d4f88024cea4bade26623a67.o) "_MuskGetLocaleRegion", referenced from: _DeviceCountryProvider_Awake_mEE95CC492427159A08D423192B51472917D33011 in Assembly-CSharp2.o _DeviceCountryProvider_MuskGetLocaleRegion_mDEF69019B1CC4B23AAB2F05C013AAD759104CA9C in Assembly-CSharp2.o (maybe you meant: _DeviceCountryProvider_MuskGetLocaleRegion_mDEF69019B1CC4B23AAB2F05C013AAD759104CA9C) ld: symbol(s) not found for architecture arm64 clang: error: linker command f ailed with exit code 1 (use -v to see invocation)

Build failed 17/3/21, 19:41 151.1 seconds

I think i have an error with the arm64 library as the error sugest and i tried to include it manually but still got the MuskGetLocaleRegion.

Thank you for your time!

It does look like you're either skipping the CocoaPods step in Unity or you've disabled some core functionality of the Firebase Unity SDK. It's also possible that you've run into an issue mixing Firebase with another library. I'll give you some quick debugging tips and what to do to file a bug report if it is a bigger issue.

First, since this is a new project, make sure your Firebase Unity SDK is updated to the latest ( currently 7.1.0 ).

Next, you need to make sure that CocoaPods is properly installed. This should happen automatically, but you might as well check. If you type pod , you should see some output other than "command not found". If you don't have it, you can always navigate to "Assets>External Dependency Manager>iOS Resolver>Install Cocoapods" to do so: 在“Assets>External Dependency Manager>iOS Resolver”中显示“Install Cocoapods”的屏幕截图

You may also opt to install CocoaPods directly following this guide . Finally, we did find that sometimes CocoaPods required uninstalling/reinstalling across certain OS upgrades (notably moving onto Catalina). This likely doesn't apply, but you can try uninstalling if you run into continued issues.

The mechanism by which Firebase associates the proper Pod files with a built Unity game is called the "External Dependency Manager for Unity" (EDM4U). It may be worth opening the "iOS Resolver Settings" (in the same menu where you found "Install Cocoapods") and resetting to default. For convenience I've included a screenshot of my settings page: 我的“iOS 解析器设置”的屏幕截图。选择了以下选项。 Podfile 生成:是的。 Cocoapods 集成:Xcode 工作区。使用 Shell 执行 Cocoapod 工具:true。在编辑器中自动安装 Cocoapod 工具:true。添加 use_frameworks!到 Podfile:是的。静态链接框架:false。始终将主要目标添加到 Podfile:true。允许同一个 pod 位于多个目标中:true。启用分析报告:真。详细日志记录:错误。使用项目设置:true。

Since you've been running into issues previously, now would be a good time to delete your previously generated project. Then you can click "Build And Run" from your "Build Settings" window. Unity should generate your xcodeproj, generate a Podfile, use the Podfile to generate an xcworkspace, then open the xcworkspace for you.

Building and running from here should work.

Sometimes folks still run into issues. There are some moving parts here: Unity version, Cocoapods version, Firebase version, and dependency manager version not to mention any other libraries either using EDM4U or doing their own custom work to integrate (notably we've seen that almost every tool to "make an iOS build from Windows" fails to work).

So in addition to just making sure your Podfile looks roughly like what you might expect from the iOS getting started guide , updating Cocoapods, and updating Firebase (do not follow the iOS guide, Unity is different enough that you should follow the Unity guide ), you may want to follow up on the public issue tracker . When you do so, the first thing to do would be to verify that your setup works with the quickstart for the Firebase products you use (it looks like Messaging from your error log?).

  1. Open terminal window

  2. Go to project folder and run this:

"pod update"

  1. Then close and re-open Xcode workspace file and build it

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM