xamarin / GoogleApisForiOSComponents

MIT License
225 stars 161 forks source link

Cannot use latest version of Firebase.iOS (Core, Analtics, Auth), linking errors #443

Open SimpsOff opened 4 years ago

SimpsOff commented 4 years ago

Here is an empty app example with just the firebase packages added: https://github.com/SimpsOff/FirebaseExample

This seems to be a continuation of this issue: https://github.com/xamarin/GoogleApisForiOSComponents/issues/158 but it was asked in that thread that a new issue be opened. I've tried all steps listed in the thread without success.

When adding these packages, and upgrading to the latest version (which are used in another app we have): Firebase.iOS Core - 6.6.6 Firebase.iOS.Analytics - 6.4.1 Firebase.iOS.Auth - 6.5.1 Firebase.iOS.Installations - 1.1.1.1 Firebase.iOS.InstanceID - 4.3.3

Upon build attempt, the following errors are observed in the build log:

Target _CompileToNative:
    /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch @/Users/andrew/Projects/FirebaseExample/FirebaseExample/obj/iPhoneSimulator/Debug/response-file.rsp --registrar:static "--gcc_flags=-ObjC -lc++ -lsqlite3 -lz -ObjC -lc++ -lsqlite3 -lz" 
    Process exited with code 1, command:
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang  -F /Users/andrew/Library/Caches/XamarinBuildDownload/GAppM-6.4.1/Frameworks -framework GoogleAppMeasurement -framework Security -framework StoreKit -framework SystemConfiguration -framework UIKit -F /Users/andrew/Library/Caches/XamarinBuildDownload/FAnlytcs-6.4.1/Frameworks -framework FirebaseAnalytics -framework AddressBook -framework AdSupport -framework CoreGraphics -F /Users/andrew/Library/Caches/XamarinBuildDownload/FAnlytcs-6.4.1/Frameworks -framework FIRAnalyticsConnector -framework Foundation -weak_framework CFNetwork -Xlinker -rpath -Xlinker @executable_path/Frameworks /Users/andrew/Projects/FirebaseExample/FirebaseExample/obj/iPhoneSimulator/Debug/mtouch-cache/x86_64/registrar.o /Users/andrew/Projects/FirebaseExample/FirebaseExample/obj/iPhoneSimulator/Debug/mtouch-cache/x86_64/main.o /Library/Frameworks/Xamarin.iOS.framework/Versions/12.10.0.157/SDKs/MonoTouch.iphonesimulator.sdk/usr/lib/libmonosgen-2.0.a /Library/Frameworks/Xamarin.iOS.framework/Versions/12.10.0.157/SDKs/MonoTouch.iphonesimulator.sdk/usr/lib/libxamarin-debug.a -force_load /Library/Frameworks/Xamarin.iOS.framework/Versions/12.10.0.157/SDKs/MonoTouch.iphonesimulator.sdk/usr/lib/libapp.a -Wl,-pie -arch x86_64 -gdwarf-2 -std=c99 -I/Library/Frameworks/Xamarin.iOS.framework/Versions/12.10.0.157/SDKs/MonoTouch.iphonesimulator.sdk/usr/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk -Qunused-arguments -fobjc-legacy-dispatch -fobjc-abi-version=2 -mios-simulator-version-min=9.0 -lz -liconv -o /Users/andrew/Projects/FirebaseExample/FirebaseExample/bin/iPhoneSimulator/Debug/FirebaseExample.app/FirebaseExample -ObjC -lc++ -lsqlite3 -lz -ObjC -lc++ -lsqlite3 -lz -u _xamarin_timezone_get_data -u _xamarin_log -u _xamarin_find_protocol_wrapper_type -u _xamarin_get_block_descriptor -u _UIApplicationMain -u _mono_pmip -u _xamarin_dyn_objc_msgSend -u _xamarin_dyn_objc_msgSendSuper -u _xamarin_dyn_objc_msgSend_stret -u _xamarin_dyn_objc_msgSendSuper_stret
    Undefined symbols for architecture x86_64:
      "_APMAnalyticsConfiguration", referenced from:
          +[FIRAnalytics startWithConfiguration:options:] in FirebaseAnalytics(FIRAnalytics_7251d33630b5526046515eb342cf4e83.o)
      "_APMAppMeasurementOriginFirebase", referenced from:
          +[FIRAnalytics startWithConfiguration:options:] in FirebaseAnalytics(FIRAnalytics_7251d33630b5526046515eb342cf4e83.o)
      "_APMIsAnalyticsCollectionDeactivated", referenced from:
          +[FIRAnalytics startWithConfiguration:options:] in FirebaseAnalytics(FIRAnalytics_7251d33630b5526046515eb342cf4e83.o)
      "_APMIsAnalyticsCollectionEnabled", referenced from:
          +[FIRAnalytics startWithConfiguration:options:] in FirebaseAnalytics(FIRAnalytics_7251d33630b5526046515eb342cf4e83.o)
      "_APMMonitorLogTagOptionKey", referenced from:
          +[FIRAnalytics startWithConfiguration:options:] in FirebaseAnalytics(FIRAnalytics_7251d33630b5526046515eb342cf4e83.o)
      "_APMSafelistedEventsOptionKey", referenced from:
          +[FIRAnalytics startWithConfiguration:options:] in FirebaseAnalytics(FIRAnalytics_7251d33630b5526046515eb342cf4e83.o)
      "_FIRInstallationIDDidChangeNotification", referenced from:
          +[FIRAnalytics observeFirebaseInstallationIDChanges] in FirebaseAnalytics(FIRAnalytics_7251d33630b5526046515eb342cf4e83.o)
      "_GULIsLoggableLevel", referenced from:
          -[APMMonitor isLoggableLevel:] in GoogleAppMeasurement(APMMonitor_ef678926ed29a8789c2a47d143bcb03c.o)
      "_GULLogBasic", referenced from:
          -[APMASLLogger logMessage:logTag:messageCode:withLogLevel:] in GoogleAppMeasurement(APMASLLogger_466efed35a5f23968c22566c7d73d056.o)
      "_GULLogError", referenced from:
          +[APMAnalytics startWithAppID:origin:options:] in GoogleAppMeasurement(APMAnalytics_b5e839cb4c33d04514600afcd61d2def.o)
          -[APMUserDefaults synchronize] in GoogleAppMeasurement(APMUserDefaults_a6b5b26129a36e9a7f47684f0883c824.o)
      "_GULLogInfo", referenced from:
          ___44+[UIViewController(APMScreenClassName) load]_block_invoke in GoogleAppMeasurement(UIViewController+APMScreenClassName_9656c83908820df5d5741a22364bcbc3.o)
      "_GULLogWarning", referenced from:
          +[APMMeasurement sharedInstance] in GoogleAppMeasurement(APMMeasurement_9c6a590e800f6e58020a35af1caeae59.o)
          -[APMUserDefaults objectForKey:] in GoogleAppMeasurement(APMUserDefaults_a6b5b26129a36e9a7f47684f0883c824.o)
          -[APMUserDefaults setObject:forKey:] in GoogleAppMeasurement(APMUserDefaults_a6b5b26129a36e9a7f47684f0883c824.o)
          -[APMUserDefaults synchronize] in GoogleAppMeasurement(APMUserDefaults_a6b5b26129a36e9a7f47684f0883c824.o)
          ___44+[UIViewController(APMScreenClassName) load]_block_invoke in GoogleAppMeasurement(UIViewController+APMScreenClassName_9656c83908820df5d5741a22364bcbc3.o)
      "_GULSetLoggerLevel", referenced from:
          -[APMMonitor setDebugModeEnabled:] in GoogleAppMeasurement(APMMonitor_ef678926ed29a8789c2a47d143bcb03c.o)
      "_OBJC_CLASS_$_FIRApp", referenced from:
          objc-class-ref in FirebaseAnalytics(FIRAnalytics_7251d33630b5526046515eb342cf4e83.o)
          objc-class-ref in FIRAnalyticsConnector(FIRAnalyticsConnector_c162b9f6e9dd193ef13757b8d7ebe6f7.o)
      "_OBJC_CLASS_$_FIRComponent", referenced from:
          objc-class-ref in FIRAnalyticsConnector(FIRAnalyticsConnector_c162b9f6e9dd193ef13757b8d7ebe6f7.o)
      "_OBJC_CLASS_$_FIRInstallations", referenced from:
          objc-class-ref in FirebaseAnalytics(FIRAnalytics_7251d33630b5526046515eb342cf4e83.o)
      "_OBJC_CLASS_$_FIROptions", referenced from:
          objc-class-ref in FirebaseAnalytics(FIRAnalytics_7251d33630b5526046515eb342cf4e83.o)
      "_OBJC_CLASS_$_GULAppDelegateSwizzler", referenced from:
          objc-class-ref in GoogleAppMeasurement(APMAnalytics_b5e839cb4c33d04514600afcd61d2def.o)
      "_OBJC_CLASS_$_GULMutableDictionary", referenced from:
          objc-class-ref in GoogleAppMeasurement(APMMeasurement_9c6a590e800f6e58020a35af1caeae59.o)
          objc-class-ref in GoogleAppMeasurement(APMRemoteConfig_c5400480091348d9d0507d500ca1b5e8.o)
      "_OBJC_CLASS_$_GULNetwork", referenced from:
          objc-class-ref in GoogleAppMeasurement(APMAnalytics_b5e839cb4c33d04514600afcd61d2def.o)
          objc-class-ref in GoogleAppMeasurement(APMMeasurement_9c6a590e800f6e58020a35af1caeae59.o)
          objc-class-ref in GoogleAppMeasurement(APMAppDelegateInterceptor_8eccbb425d76703bd931c4581a5d7ff0.o)
      "_OBJC_CLASS_$_GULSwizzler", referenced from:
          objc-class-ref in GoogleAppMeasurement(UIViewController+APMScreenClassName_9656c83908820df5d5741a22364bcbc3.o)
      "_kFIRLoggerAnalytics", referenced from:
          +[FIRAnalytics startWithConfiguration:options:] in FirebaseAnalytics(FIRAnalytics_7251d33630b5526046515eb342cf4e83.o)
      "_kGULNetworkHTTPStatusCodeCannotAcceptTraffic", referenced from:
    -[APMMeasurement networkUploadCompletionHandlerWithResponse : error : ] in GoogleAppMeasurement(APMMeasurement_9c6a590e800f6e58020a35af1caeae59.o)
          -[APMMeasurement networkRemoteConfigFetchCompletionHandler:data:error:] in GoogleAppMeasurement(APMMeasurement_9c6a590e800f6e58020a35af1caeae59.o)
      "_kGULNetworkHTTPStatusCodeNotFound", referenced from:
          -[APMMeasurement networkRemoteConfigFetchCompletionHandler:data:error:] in GoogleAppMeasurement(APMMeasurement_9c6a590e800f6e58020a35af1caeae59.o)
      "_kGULNetworkHTTPStatusCodeNotModified", referenced from:
          -[APMMeasurement networkRemoteConfigFetchCompletionHandler:data:error:] in GoogleAppMeasurement(APMMeasurement_9c6a590e800f6e58020a35af1caeae59.o)
      "_kGULNetworkHTTPStatusCodeUnavailable", referenced from:
    -[APMMeasurement networkUploadCompletionHandlerWithResponse : error : ] in GoogleAppMeasurement(APMMeasurement_9c6a590e800f6e58020a35af1caeae59.o)
          -[APMMeasurement networkRemoteConfigFetchCompletionHandler:data:error:] in GoogleAppMeasurement(APMMeasurement_9c6a590e800f6e58020a35af1caeae59.o)
      "_kGULNetworkHTTPStatusNoContent", referenced from:
    -[APMMeasurement networkUploadCompletionHandlerWithResponse : error : ] in GoogleAppMeasurement(APMMeasurement_9c6a590e800f6e58020a35af1caeae59.o)
          -[APMMeasurement networkRemoteConfigFetchCompletionHandler:data:error:] in GoogleAppMeasurement(APMMeasurement_9c6a590e800f6e58020a35af1caeae59.o)
      "_kGULNetworkHTTPStatusOK", referenced from:
    -[APMMeasurement networkUploadCompletionHandlerWithResponse : error : ] in GoogleAppMeasurement(APMMeasurement_9c6a590e800f6e58020a35af1caeae59.o)
          -[APMMeasurement networkRemoteConfigFetchCompletionHandler:data:error:] in GoogleAppMeasurement(APMMeasurement_9c6a590e800f6e58020a35af1caeae59.o)
    ld: symbol(s) not found for architecture x86_64
    clang : error : linker command failed with exit code 1 (use -v to see invocation)

    MTOUCH : error MT5210: Native linking failed, undefined symbol: _APMAnalyticsConfiguration. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
    MTOUCH : error MT5210: Native linking failed, undefined symbol: _APMAppMeasurementOriginFirebase. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
    MTOUCH : error MT5210: Native linking failed, undefined symbol: _APMIsAnalyticsCollectionDeactivated. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
    MTOUCH : error MT5210: Native linking failed, undefined symbol: _APMIsAnalyticsCollectionEnabled. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
    MTOUCH : error MT5210: Native linking failed, undefined symbol: _APMMonitorLogTagOptionKey. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
    MTOUCH : error MT5210: Native linking failed, undefined symbol: _APMSafelistedEventsOptionKey. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
    MTOUCH : error MT5210: Native linking failed, undefined symbol: _FIRInstallationIDDidChangeNotification. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
    MTOUCH : error MT5210: Native linking failed, undefined symbol: _GULIsLoggableLevel. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
    MTOUCH : error MT5210: Native linking failed, undefined symbol: _GULLogBasic. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
    MTOUCH : error MT5210: Native linking failed, undefined symbol: _GULLogError. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
    MTOUCH : error MT5210: Native linking failed, undefined symbol: _GULLogInfo. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
    MTOUCH : error MT5210: Native linking failed, undefined symbol: _GULLogWarning. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
    MTOUCH : error MT5210: Native linking failed, undefined symbol: _GULSetLoggerLevel. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
    MTOUCH : error MT5211: Native linking failed, undefined Objective-C class: FIRApp. The symbol '_OBJC_CLASS_$_FIRApp' could not be found in any of the libraries or frameworks linked with your application.
    MTOUCH : error MT5211: Native linking failed, undefined Objective-C class: FIRComponent. The symbol '_OBJC_CLASS_$_FIRComponent' could not be found in any of the libraries or frameworks linked with your application.
    MTOUCH : error MT5211: Native linking failed, undefined Objective-C class: FIRInstallations. The symbol '_OBJC_CLASS_$_FIRInstallations' could not be found in any of the libraries or frameworks linked with your application.
    MTOUCH : error MT5211: Native linking failed, undefined Objective-C class: FIROptions. The symbol '_OBJC_CLASS_$_FIROptions' could not be found in any of the libraries or frameworks linked with your application.
    MTOUCH : error MT5211: Native linking failed, undefined Objective-C class: GULAppDelegateSwizzler. The symbol '_OBJC_CLASS_$_GULAppDelegateSwizzler' could not be found in any of the libraries or frameworks linked with your application.
    MTOUCH : error MT5211: Native linking failed, undefined Objective-C class: GULMutableDictionary. The symbol '_OBJC_CLASS_$_GULMutableDictionary' could not be found in any of the libraries or frameworks linked with your application.
    MTOUCH : error MT5211: Native linking failed, undefined Objective-C class: GULNetwork. The symbol '_OBJC_CLASS_$_GULNetwork' could not be found in any of the libraries or frameworks linked with your application.
    MTOUCH : error MT5211: Native linking failed, undefined Objective-C class: GULSwizzler. The symbol '_OBJC_CLASS_$_GULSwizzler' could not be found in any of the libraries or frameworks linked with your application.
    MTOUCH : error MT5210: Native linking failed, undefined symbol: _kFIRLoggerAnalytics. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
    MTOUCH : error MT5210: Native linking failed, undefined symbol: _kGULNetworkHTTPStatusCodeCannotAcceptTraffic. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
    MTOUCH : error MT5210: Native linking failed, undefined symbol: _kGULNetworkHTTPStatusCodeNotFound. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
    MTOUCH : error MT5210: Native linking failed, undefined symbol: _kGULNetworkHTTPStatusCodeNotModified. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
    MTOUCH : error MT5210: Native linking failed, undefined symbol: _kGULNetworkHTTPStatusCodeUnavailable. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
    MTOUCH : error MT5210: Native linking failed, undefined symbol: _kGULNetworkHTTPStatusNoContent. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
    MTOUCH : error MT5210: Native linking failed, undefined symbol: _kGULNetworkHTTPStatusOK. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
    MTOUCH : error MT5201: Native linking failed. Please review the build log and the user flags provided to gcc: -ObjC -lc++ -lsqlite3 -lz -ObjC -lc++ -lsqlite3 -lz
    MTOUCH : error MT5202: Native linking failed. Please review the build log.
Done building target "_CompileToNative" in project "FirebaseExample.csproj" -- FAILED.

Later, including this code recommended to fix the linker errors (var sharedInstance = Firebase.Core.Configuration.SharedInstance;) produces a new error:

  Failed to resolve "ObjCRuntime.TrampolineBlockBase" reference from "Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065"

Any help or resolution to this would be greatly appreciated.

PaymonK commented 3 years ago

Hi guys. Any update on this? It's a blocker issue for us.

jbtdevgit commented 3 years ago

image

MTOUCH : warning MT5215: References to 'System' might require additional -framework=XXX or -lXXX instructions to the native linker MTOUCH : warning MT5215: References to 'System' might require additional -framework=XXX or -lXXX instructions to the native linker MTOUCH : warning MT5215: References to 'System.Net.Security' might require additional -framework=XXX or -lXXX instructions to the native linker MTOUCH : warning MT5215: References to 'System' might require additional -framework=XXX or -lXXX instructions to the native linker MTOUCH : warning MT5215: References to 'System' might require additional -framework=XXX or -lXXX instructions to the native linker MTOUCH : error MT5210: Native linking failed, undefined symbol: _FIRInstallationIDDidChangeNotification. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. MTOUCH : error MT5210: Native linking failed, undefined symbol: _GULIsLoggableLevel. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. MTOUCH : error MT5210: Native linking failed, undefined symbol: _GULLogBasic. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. MTOUCH : error MT5210: Native linking failed, undefined symbol: _GULLogError. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. MTOUCH : error MT5210: Native linking failed, undefined symbol: _GULLogInfo. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. MTOUCH : error MT5210: Native linking failed, undefined symbol: _GULLogWarning. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. MTOUCH : error MT5210: Native linking failed, undefined symbol: _GULSetLoggerLevel. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. MTOUCH : error MT5211: Native linking failed, undefined Objective-C class: FIRApp. The symbol '_OBJCCLASS$_FIRApp' could not be found in any of the libraries or frameworks linked with your application. MTOUCH : error MT5211: Native linking failed, undefined Objective-C class: FIRComponent. The symbol '_OBJCCLASS$_FIRComponent' could not be found in any of the libraries or frameworks linked with your application. MTOUCH : error MT5211: Native linking failed, undefined Objective-C class: FIRInstallations. The symbol '_OBJCCLASS$_FIRInstallations' could not be found in any of the libraries or frameworks linked with your application. MTOUCH : error MT5211: Native linking failed, undefined Objective-C class: FIROptions. The symbol '_OBJCCLASS$_FIROptions' could not be found in any of the libraries or frameworks linked with your application. MTOUCH : error MT5211: Native linking failed, undefined Objective-C class: GULAppDelegateSwizzler. The symbol '_OBJCCLASS$_GULAppDelegateSwizzler' could not be found in any of the libraries or frameworks linked with your application. MTOUCH : error MT5211: Native linking failed, undefined Objective-C class: GULAppEnvironmentUtil. The symbol '_OBJCCLASS$_GULAppEnvironmentUtil' could not be found in any of the libraries or frameworks linked with your application. MTOUCH : error MT5211: Native linking failed, undefined Objective-C class: GULMutableDictionary. The symbol '_OBJCCLASS$_GULMutableDictionary' could not be found in any of the libraries or frameworks linked with your application. MTOUCH : error MT5211: Native linking failed, undefined Objective-C class: GULNetwork. The symbol '_OBJCCLASS$_GULNetwork' could not be found in any of the libraries or frameworks linked with your application. MTOUCH : error MT5211: Native linking failed, undefined Objective-C class: GULSwizzler. The symbol '_OBJCCLASS$_GULSwizzler' could not be found in any of the libraries or frameworks linked with your application. MTOUCH : error MT5210: Native linking failed, undefined symbol: _kFIRLoggerAnalytics. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. MTOUCH : error MT5210: Native linking failed, undefined symbol: _kGULNetworkHTTPStatusCodeCannotAcceptTraffic. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. MTOUCH : error MT5210: Native linking failed, undefined symbol: _kGULNetworkHTTPStatusCodeNotFound. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. MTOUCH : error MT5210: Native linking failed, undefined symbol: _kGULNetworkHTTPStatusCodeNotModified. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. MTOUCH : error MT5210: Native linking failed, undefined symbol: _kGULNetworkHTTPStatusCodeUnavailable. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. MTOUCH : error MT5210: Native linking failed, undefined symbol: _kGULNetworkHTTPStatusNoContent. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. MTOUCH : error MT5210: Native linking failed, undefined symbol: _kGULNetworkHTTPStatusOK. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. MTOUCH : error MT5210: Native linking failed, undefined symbol: _pb_decode. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. MTOUCH : error MT5210: Native linking failed, undefined symbol: _pb_decode_varint. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. MTOUCH : error MT5210: Native linking failed, undefined symbol: _pb_encode. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. MTOUCH : error MT5210: Native linking failed, undefined symbol: _pb_encode_string. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. MTOUCH : error MT5210: Native linking failed, undefined symbol: _pb_encode_submessage. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. MTOUCH : error MT5210: Native linking failed, undefined symbol: _pb_encode_tag_for_field. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. MTOUCH : error MT5210: Native linking failed, undefined symbol: _pb_encode_varint. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. MTOUCH : error MT5210: Native linking failed, undefined symbol: _pb_istream_from_buffer. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. MTOUCH : error MT5210: Native linking failed, undefined symbol: _pb_ostream_from_buffer. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. MTOUCH : error MT5210: Native linking failed, undefined symbol: _pb_read. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. MTOUCH : error MT5201: Native linking failed. Please review the build log and the user flags provided to gcc: -ObjC -lc++ -lsqlite3 -lz -ObjC -lc++ -lsqlite3 -lz -[APMMeasurement networkUploadCompletionHandlerWithResponse : error : ] in GoogleAppMeasurement(APMMeasurement_87bdad44f2b9aa68c2d607a36be1b8c5.o) -[APMMeasurement networkUploadCompletionHandlerWithResponse : error : ] in GoogleAppMeasurement(APMMeasurement_87bdad44f2b9aa68c2d607a36be1b8c5.o) -[APMMeasurement networkUploadCompletionHandlerWithResponse : error : ] in GoogleAppMeasurement(APMMeasurement_87bdad44f2b9aa68c2d607a36be1b8c5.o) -[APMMeasurement networkUploadCompletionHandlerWithResponse : error : ] in GoogleAppMeasurement(APMMeasurement_87bdad44f2b9aa68c2d607a36be1b8c5.o)

Happens on latest firebase.ios packages. This can easily be reproduced in an empty app

dmariogatto commented 3 years ago

Using the example repo from @SimpsOff, I got the below build error, Native linking failed, undefined symbol: _FIRInstallationIDDidChangeNotification

I was able to fix the error by replacing FinishedLaunching method in the AppDelegate with the below,

public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
{
    // Override point for customization after application launch.
    // If not required for your application you can safely delete this method

    var type = typeof(Analytics);
    App.Configure();

    return true;
}
jeroen-corteville commented 3 years ago

I can confirm the solution posted by @dmariogatto works. I tried adding --linkskip=Firebase.Analytics to the mtouch arguments, but that didn't work. I think this is because it's not the Xamarin Linker removing this, but the Native linker, but I'm not 100% sure this is the case.

jbtdevgit commented 3 years ago

I already have Firebase.Core.App.Configure(); and the error still persist.

jeroen-corteville commented 3 years ago

@jbtamaresgit var type = typeof(Analytics) is the line that makes it work for me.

padmasrisekar commented 3 years ago

Failed to resolve "ObjCRuntime.TrampolineBlockBase" reference from "Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065"

Im still getting the same error in server machine. But its working fine in local machine. Any help or resolution to this would be appreciated.

@jbtamaresgit @jeroen-corteville Anyone please confirm the version of Xamarin.ios and Xamarin.forms. It would be great help!!!

@SimpsOff Did you find any solution?

jbtdevgit commented 3 years ago

@padmasrisekar Xamarin.Forms 4.5.0.725 Xamarin.iOS 14.2.0.12

There's a new version of iOS.Crashlytics 4.6.2 The error still persists with these packages: image Any solution for this?

@jbtamaresgit var type = typeof(Analytics) is the line that makes it work for me.

Hmm, this is considered as a temporary work around and shouldn't be done as the variable wouldn't be used. They just released a new version and the issue still persists with their latest packages.

padmasrisekar commented 3 years ago

@jbtamaresgit Delete the XamarinBuildDownload in caches and delete bin and obj folder from your project, then try to build. It will work. App works well. But I cant see the crashes report in crashlytics console. Do you have any idea regarding that. i have uploaded the dsyms as well. but i still shows missing dsyms.

jbtdevgit commented 3 years ago

@padmasrisekar I have forgotten regarding my analytics package that it isn't updated yet. Just did a quick update for analytics and the error was gone regarding the XamarinBuildDownload however, the native linking problem still occurs after I have upgraded

padmasrisekar commented 3 years ago

@jbtamaresgit are you using any other packages that depends on xamarin.build.download? Please check that and update and try. In my project, after updation of xamarin.google.ios.analytics package, that error has gone.

SimpsOff commented 3 years ago

I tried @dmariogatto 's suggestion of from here https://github.com/xamarin/GoogleApisForiOSComponents/issues/443#issuecomment-719379516

But I'm still getting the same error: Failed to resolve "ObjCRuntime.TrampolineBlockBase" reference from "Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065" 😞

@padmasrisekar I'm still having the problem, and using the old firebase packages. Did you resolve the issue with clearing your caches?

padmasrisekar commented 3 years ago

Try to install xamarin.ios 13.8 or above version depends upon your xcode version

On Sun, Nov 15, 2020, 20:39 Andrew Simpson notifications@github.com wrote:

I tried @dmariogatto https://github.com/dmariogatto 's suggestion of from here #443 (comment) https://github.com/xamarin/GoogleApisForiOSComponents/issues/443#issuecomment-719379516

But I'm still getting the same error: Failed to resolve "ObjCRuntime.TrampolineBlockBase" reference from "Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065" 😞

@padmasrisekar https://github.com/padmasrisekar I'm still having the problem, and using the old firebase packages. Did you resolve the issue with clearing your caches?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/xamarin/GoogleApisForiOSComponents/issues/443#issuecomment-727584563, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKCVWMGSC45EOO3FAZT2HWDSP7VJBANCNFSM4STZ7HFA .

jbtdevgit commented 3 years ago

@padmasrisekar Thanks, I've updated the packages dependent to the xamarin.build.download to the latest version

jbtdevgit commented 3 years ago

Any update on this? RemovingCrashlytics.SharedInstance.SetCrashlyticsCollectionEnabled(true); in the AppDelegate.cs results into linking errors.

MTOUCH: Error MT5210: Native linking failed, undefined symbol: _FIRInstallationIDDidChangeNotification. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210)

Error: linker command failed with exit code 1 (use -v to see invocation) 

MTOUCH: Error MT5211: Native linking failed, undefined Objective-C class: FIRInstallations. The symbol '_OBJC_CLASS_$_FIRInstallations' could not be found in any of the libraries or frameworks linked with your application. (MT5211)

MTOUCH: Error MT5201: Native linking failed. Please review the build log and the user flags provided to gcc: -ObjC -ObjC -ObjC -lc++ -lz -ObjC -lc++ -lsqlite3 -lz -ObjC -lc++ -lsqlite3 -lz (MT5201)
pablogupi commented 3 years ago

Hi! My project has an OpenCV Binding made with this tutorial https://chamoda.com/how-to-use-opencv-with-xamarin-ios/ It works fine before adding Firebase. When I add any Firebase library to my project, the project stops compiling. I get 98 errors like these:

MTOUCH : error MT5210: Native linking failed, undefined symbol: (extension in Foundation):Foundation.DataProtocol.copyBytes(to: Swift.UnsafeMutableRawBufferPointer) -> Swift.Int. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. MTOUCH : error MT5210: Native linking failed, undefined symbol: Foundation.__DataStorage.init(bytes: Swift.UnsafeRawPointer?, length: Swift.Int) -> Foundation.__DataStorage. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. MTOUCH : error MT5210: Native linking failed, undefined symbol: type metadata accessor for Foundation.__DataStorage. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. MTOUCH : error MT5210: Native linking failed, undefined symbol: type metadata accessor for Foundation.Data.RangeReference. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. MTOUCH : error MT5210: Native linking failed, undefined symbol: Foundation.Data._bridgeToObjectiveC() -> __C.NSData. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. MTOUCH : error MT5210: Native linking failed, undefined symbol: static Foundation.Data._unconditionallyBridgeFromObjectiveC(__C.NSData?) -> Foundation.Data. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. MTOUCH : error MT5210: Native linking failed, undefined symbol: protocol conformance descriptor for Foundation.Data : Foundation.DataProtocol in Foundation. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. MTOUCH : error MT5210: Native linking failed, undefined symbol: (extension in Swift):Swift.BinaryInteger.description.getter : Swift.String. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. MTOUCH : error MT5210: Native linking failed, undefined symbol: Swift._StringGuts.grow(Swift.Int) -> (). Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. ............................ Many more similar ............................ MTOUCH : error MT5201: Native linking failed. Please review the build log and the user flags provided to gcc: -ObjC -lc++ -lsqlite3 -lz -ObjC -lz -lsqlite3 clang : error : linker command failed with exit code 1 (use -v to see invocation)

By doing a lot of testing, I have verified that linking errors appear when I construct the private OpenCV4 OpenCV = new OpenCV4 () class; By removing that instance the application compiles with Firebase installed. If I remove Firebase and add the instance to OpenCv the application works correctly. I think there is a conflict and I don't know where to solve it. Can you help me? Thanks a lot

thearaks commented 3 years ago

None of the solutions works in my case.

I'm including the latest versions of Analytics and Crashlytics, the debug build works fine but not the release.

    Process exited with code 1, command:
    MTOUCH : error MT5210: Native linking failed, undefined symbol: _FIRInstallationIDDidChangeNotification. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -F /Users/user/Library/Caches/XamarinBuildDownload/GAppM-6.9.0/Frameworks -framework GoogleAppMeasurement [...]
    Undefined symbols for architecture arm64:
      "_FIRInstallationIDDidChangeNotification", referenced from:
          +[FIRAnalytics observeFirebaseInstallationIDChanges] in FirebaseAnalytics(FIRAnalytics_bcf240aa84bc544bc770b8f84276795f.o)
      "_OBJC_CLASS_$_FIRInstallations", referenced from:
          objc-class-ref in FirebaseAnalytics(FIRAnalytics_bcf240aa84bc544bc770b8f84276795f.o)
    ld: symbol(s) not found for architecture arm64
    clang : error : linker command failed with exit code 1 (use -v to see invocation)
thearaks commented 3 years ago

For the ones having problems with FIRInstallations framework missing, downgrade to the following versions: image Firebase Installations was included in Firebase Instance ID at the time of these releases, so you won't have linking problems.

thearaks commented 3 years ago

Managed to fix it: Update Visual Studio for Mac to the latest version, then use the following packages versions: image

Then, in your code, reference at least one time the class Firebase.Analytics.Analytics, for example:

Analytics.SetAnalyticsCollectionEnabled(true);
aphex3k commented 3 years ago

Update Visual Studio for Mac to the latest version, then use the following packages versions: image

Then, in your code, reference at least one time the class Firebase.Analytics.Analytics, for example:

Analytics.SetAnalyticsCollectionEnabled(true);

I followed these instructions and version from the screenshot but still see this issue happening.

For the ones having problems with FIRInstallations framework missing, downgrade to the following versions: image Firebase Installations was included in Firebase Instance ID at the time of these releases, so you won't have linking problems.

Downgrading to these package versions didn't help either...

stepheaw commented 3 years ago

Downgrading packages did not work for me either. Although, I left them downgraded

Screen Shot 2021-03-19 at 2 20 31 PM

Adding this line of code in my app delegate magically fixed the build issue for me. Not sure why.

        // Configure firebase for push notifications
        Firebase.Core.App.Configure();
        **var instance = Firebase.Installations.Installations.DefaultInstance;**
acupofjose commented 3 years ago

For me was a combination of adding both:

Firebase.Core.App.Configure();
Analytics.SetAnalyticsCollectionEnabled(true);

with the additional MTOUCH args in the iOS Build Options: --registrar:static

Thank y'all!

JanaJunkiss commented 3 years ago

Having same issues, MTOUCH args, combination

Firebase.Core.App.Configure(); Analytics.SetAnalyticsCollectionEnabled(true);

and downgrading none works( Please, help.

nlsickler commented 3 years ago

I had run into a similar issue with a different library (EFCore).

I've worked around this by adding an Assembly tag to AppDelegate.cs

[assembly: Preserve(typeof(Firebase.Analytics.Analytics), AllMembers = true)]
namespace MyProject.iOS
{
    [Register("AppDelegate")]
    public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate

I find this more palatable than var type = typeof(Analytics);, but your mileage may vary.

apoorvadixit-ttc commented 2 years ago

Using the example repo from @SimpsOff, I got the below build error, Native linking failed, undefined symbol: _FIRInstallationIDDidChangeNotification

I was able to fix the error by replacing FinishedLaunching method in the AppDelegate with the below,

public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
{
    // Override point for customization after application launch.
    // If not required for your application you can safely delete this method

    var type = typeof(Analytics);
    App.Configure();

    return true;
}

Worked for me.

emanuelecastelli commented 2 years ago

Hi! My project has an OpenCV Binding made with this tutorial https://chamoda.com/how-to-use-opencv-with-xamarin-ios/ It works fine before adding Firebase. When I add any Firebase library to my project, the project stops compiling. I get 98 errors like these:

MTOUCH : error MT5210: Native linking failed, undefined symbol: (extension in ........................... Many more similar ............................ MTOUCH : error MT5201: Native linking failed. Please review the build log and the user flags provided to gcc: -ObjC -lc++ -lsqlite3 -lz -ObjC -lz -lsqlite3 clang : error : linker command failed with exit code 1 (use -v to see invocation)

By doing a lot of testing, I have verified that linking errors appear when I construct the private OpenCV4 OpenCV = new OpenCV4 () class; By removing that instance the application compiles with Firebase installed. If I remove Firebase and add the instance to OpenCv the application works correctly. I think there is a conflict and I don't know where to solve it. Can you help me? Thanks a lot

Hi @pablogupi , we have the same issue:

The app is compiled only with one of the two, never with both together.

Have you found a solution in the meantime?

christianbuonaiutowork commented 1 year ago

I have the same error when have upgraded FIrebase.iOS.Core from 6.10.4 to 8.10.03 and Google.iOS.SignIn from 5.0.2.1 to 5.0.2.4. I see this in the build log:

    Undefined symbols for architecture arm64:
      "_kFirebaseErrorDomain", referenced from:
          -[GGLContext configureWithError:] in GGLCore(GGLContext_8606885088d11458ba27dd487a24d742.o)
    ld: symbol(s) not found for architecture arm64
    clang : error : linker command failed with exit code 1 (use -v to see invocation)

Besides seeing this:

MTOUCH : error MT5210: Native linking failed, undefined symbol: _kFirebaseErrorDomain. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. MTOUCH : error MT5201: Native linking failed. Please review the build log and the user flags provided to gcc: -ObjC -lz -lstdc++ -lsqlite3 -ObjC -lsqlite3 -ObjC -lc++ -lsqlite3 -lz -ObjC -lc++ -lsqlite3 -lz -lsqlite3 -lsqlite3 -lc++ -lz -lsqlite3 -lc++ -lz -lsqlite3 -lc++ -lz clang : error : linker command failed with exit code 1 (use -v to see invocation)

UPDATE I have resolved, removing the package Google.iOS.Core (deprecated)