Open onurhazar opened 4 years ago
Transfering this soon to iOS repo!
@onurhazar Hey! We've had similar issue with this package. I've came up with a workaround that should get you up and running.
When you try to update Xamarin.Firebase.iOS.Analytics from lower version, let's say 5.5.0 it has reference to GoogleAppMeasurement.framework in "~/Library/Caches/XamarinBuildDownload", the file is in GAppM-x.x.x, where x.x.x is a version of the Google Measurement App framework.
In our case some machines had another project that was using older version of Analytics package, this meant that it was referencing GAppM-5.5.0. When we tried to deploy another project, not related to the first one, it was throwing the same exception. Because this second project was using Analytics 6.0.4, and this package depends on higher version of GAppM.
It looks like maybe something is causing problems during linking of this native references(GAppM), because when there are more present in XamarinBuildDownload, the exception is thrown every time.
Try the following:
Sometimes exception is gone, but the app starts and closes immediately if this would happen, clear your project, remove /bin and /obj folders, and remove application from the device or simulator and then try again.
After all this, the project should start.
Just make sure that in ~/Library/Caches/XamarinBuildDownload only one GAppM-x.x.x is present, that's crucial.
@SotoiGhost Seems like this one is iOS.
@onurhazar @szymonkalista Can you upgrade to the most recent version of Firebase Analytics and try again? Remember to delete bin and obj folders and XBD cache. Thanks in advance!
@SotoiGhost Hey,
When I delete bin, obj and XBD cache I am able to use any version of Firebase Analytics Including the newest.
The tricky part, at least for me, was finding out, that I have to delete XBD cache. The message in the exception(same as in @onurhazar case) isn't very helpful, when you are seeing something like this for the first time. I understand that it's coming from native code, so nothing can be done about it.
Trying to pinpoint why we were getting this exception was very frustrating(albeit pretty rewarding :~D).
Could you tell me, why do we have to delete the XBD cache in this case? I am seeing something like this for the first time.
It would be awesome if something could be done, so that we can use different Firebase Analytics versions without cleaning the XBD cache. If this can't be done, it would be great if this case could be documented somewhere. (Maybe it is documented somewhere? I couldn't find it.) Because getting this bit of information is crucial in this case.
Hello @szymonkalista ,
I have tried your approach and the issue is still present event after all the cache deletion. Additionally, I'm using the latest versions at this point and the issue is still present.
I'm wondering if there is another workaround and/or if this could be related with a "shared project" type? Due to I tried in a new project/solution on a Windows PC and there are no issues with the Google Apis components.
@vhugogarcia
Hey,
I am currently using the newest packages as well.
Please make sure that the exception which is thrown has this message:
Failed to configure firebase. Error: Objective-C exception thrown. Name: FIRAnalyticsVersionMismatch Reason: Google Analytics for Firebase version (60004000) does not match with Google App Measurement (50500000) version. Please update.
version numbers may differ. Just to be sure, that it isn't some other problem.
We are using .net standard instead of PCL in our project, but I don't think this should cause any issues.
I guess something is broken with how this nuget package handles dependencies on a mac os, that's why it does not happen on Windows. To be able to build iOS project, you have to do it on a mac, or on a windows machine connected to a mac.
Please make sure you've properly deleted all the dependencies in XBD folder.
Here you can see how the XamarinBuildDownload looks on my side, note that GAppM-6.4.1 is the only version of GoogleAppMeasurement that is present and FAnlytycs-6.4.1 is the only version of Firebase Analytics. Disregard other packages, they are not related.
You could try again and delete everything from the path, that you can see in the screenshot I've attached. Try to delete bin and obj folder from your project also.
Then launch VS with your project, wait until nuget packages are restored, check XBD cache again, to make sure another version of GoogleAppMeasurement isn't available there. After that, build and run your iOS project.
Other thing you might try, is to install all the dependencies of the firestore package manually, before you install the firestore package. Then clear the XBD cache again, and try to build.
In my team, we were able to get several people up and running with this workaround.
Hello @szymonkalista ,
I have tired as same you mentioned, but the issue is still exist. I dont know why its not running in my machine. Really appreciated, if any more methods are there. Thanks in advance!!!
Hello @szymonkalista ,
I have tried your approach and the issue is still present event after all the cache deletion. Additionally, I'm using the latest versions at this point and the issue is still present.
I'm wondering if there is another workaround and/or if this could be related with a "shared project" type? Due to I tried in a new project/solution on a Windows PC and there are no issues with the Google Apis components.
Hi @vhugogarcia Have you fixed your issue? Please post here, if you have new solution
@SotoiGhost Could someone have a look at this again, please? Seems like the workaround doesn't cut it for some people. On my side - we are not experiencing this issue anymore in our projects.
@padmasrisekar Would you be able to a provide sample project that reproduces this issue? I can check whether this happens on my machine while we wait for the response from the maintainers.
@SotoiGhost Could someone have a look at this again, please? Seems like the workaround doesn't cut it for some people. On my side - we are not experiencing this issue anymore in our projects.
@padmasrisekar Would you be able to a provide sample project that reproduces this issue? I can check whether this happens on my machine while we wait for the response from the maintainers.
Hi @szymonkalista, i will create sample project and post you. Could you confirm, which Xamarin forms version you are using.
@padmasrisekar Xamarin.Forms 4.6.0.847 and Xamarin.Forms 4.8.0.1451 - depends on a project.
@padmasrisekar Xamarin.Forms 4.6.0.847 and Xamarin.Forms 4.8.0.1451 - depends on a project.
thanks @szymonkalista. Its working fine in my local machine. But it gives - native linking error in server machine. Could you please tell me the which version of xamarin.ios and xcode you are using. Im using Xamarin.ios 13.2 and Xcode11.2
Xamarin.iOS
Version: 14.0.0.0 (Visual Studio Community)
Branch: xcode12
Build date: 2020-09-16 11:33:15-0400
Xcode: Version 12.1 (12A7403)
Hi @szymonkalista Thank you.. after updating xamarin.google.ios.analytics, it is working fine in server as well. Do you know how to upload dsym for xamarin ios app.
On Tue, Nov 10, 2020, 05:44 Szymon Kalista notifications@github.com wrote:
Xamarin.iOS Version: 14.0.0.0 (Visual Studio Community) Branch: xcode12 Build date: 2020-09-16 11:33:15-0400
Xcode: Version 12.1 (12A7403)
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/xamarin/GoogleApisForiOSComponents/issues/385#issuecomment-724363268, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKCVWMGE47477Q2LTV7UQHLSPCAXBANCNFSM4LULZWWA .
I am still getting this Native Linking error after adding FireBase to my Xamarin.iOS with embedded XF app. I have tried all of the above workarounds (delete bin/obj/XamarinBuildDownloads and restart VS Mac) but nothing worked.
Here are the versions of the associated libraries:
<package id="Xamarin.Firebase.iOS.Analytics" version="6.9.0" targetFramework="xamarinios10" />
<package id="Xamarin.Firebase.iOS.CloudMessaging" version="4.7.1" targetFramework="xamarinios10" />
<package id="Xamarin.Firebase.iOS.Core" version="6.10.4" targetFramework="xamarinios10" />
<package id="Xamarin.Firebase.iOS.Installations" version="1.7.0" targetFramework="xamarinios10" />
<package id="Xamarin.Firebase.iOS.InstanceID" version="4.8.0" targetFramework="xamarinios10" />
Here are the build 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.
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: GULAppEnvironmentUtil. The symbol '_OBJC_CLASS_$_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 '_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 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 : warning MT5215: References to 'System' might require additional -framework=XXX or -lXXX instructions to the native linker
MTOUCH : warning MT5215: References to 'ole32' 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 : 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 'Crypt32' might require additional -framework=XXX or -lXXX instructions to the native linker
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 -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/...redacted.../obj/iPhoneSimulator/Debug/Entitlements.xcent
...
...
Environment: === Visual Studio Community 2019 for Mac ===
Version 8.10.8 (build 0) Installation UUID: b0c75246-bd6a-42d5-ae05-9129fa16ec18 GTK+ 2.24.23 (Raleigh theme) Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)
Package version: 612000140
=== Mono Framework MDK ===
Runtime: Mono 6.12.0.140 (2020-02/51d876a041e) (64-bit) Package version: 612000140
=== Roslyn (Language Service) ===
3.10.0-4.21269.26+029847714208ebe49668667c60ea5b0a294e0fcb
=== NuGet ===
Version: 5.9.0.7134
=== .NET Core SDK ===
SDK: /usr/local/share/dotnet/sdk/6.0.100-preview.7.21379.14/Sdks SDK Versions: 6.0.100-preview.7.21379.14 5.0.400 5.0.302 5.0.301 5.0.203 5.0.202 5.0.103 5.0.101 5.0.100 3.1.412 3.1.411 3.1.410 3.1.409 3.1.408 3.1.406 3.1.404 3.1.403 3.1.402 3.1.401 3.1.302 3.1.301 3.1.300 3.1.200 3.1.102 3.1.101 3.1.100 3.1.100-preview2-014569 3.0.100 2.1.701 MSBuild SDKs: /Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/Sdks
=== .NET Core Runtime ===
Runtime: /usr/local/share/dotnet/dotnet Runtime Versions: 6.0.0-preview.7.21377.19 5.0.9 5.0.8 5.0.7 5.0.6 5.0.5 5.0.3 5.0.1 5.0.0 3.1.18 3.1.17 3.1.16 3.1.15 3.1.14 3.1.12 3.1.10 3.1.9 3.1.8 3.1.7 3.1.6 3.1.5 3.1.4 3.1.2 3.1.1 3.1.0 3.1.0-preview2.19525.6 3.0.0 2.1.23 2.1.22 2.1.21 2.1.20 2.1.19 2.1.18 2.1.17 2.1.16 2.1.15 2.1.14 2.1.13 2.1.12
=== .NET Core 3.1 SDK ===
SDK: 3.1.412
=== Xamarin.Profiler ===
Version: 1.6.15.68 Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
=== Updater ===
Version: 11
=== Apple Developer Tools ===
Xcode 12.5.1 (18212) Build 12E507
=== Xamarin.Mac ===
Xamarin.Mac not installed. Can't find /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/Version.
=== Xamarin.iOS ===
Version: 14.20.0.24 (Visual Studio Community) Hash: c4b89cddb Branch: d16-10 Build date: 2021-06-15 22:03:01-0400
=== Xamarin.Android ===
Version: 11.3.0.4 (Visual Studio Community) Commit: xamarin-android/d16-10/ae14caf Android SDK: /Users/joe/Library/Developer/Xamarin/android-sdk-macosx Supported Android versions: 4.4 (API level 19) 7.1 (API level 25) 8.1 (API level 27)
SDK Tools Version: 26.1.1 SDK Platform Tools Version: 30.0.4 SDK Build Tools Version: 30.0.2
Build Information: Mono: b4a3858 Java.Interop: xamarin/java.interop/d16-10@f39db25 ProGuard: Guardsquare/proguard/v7.0.1@912d149 SQLite: xamarin/sqlite/3.35.4@85460d3 Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-10@c5732a0
=== Microsoft OpenJDK for Mobile ===
Java SDK: /Users/joe/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25 1.8.0-25 Android Designer EPL code available here: https://github.com/xamarin/AndroidDesigner.EPL
=== Android SDK Manager ===
Version: 16.10.0.13 Hash: 1b81df5 Branch: remotes/origin/d16-10 Build date: 2021-08-12 20:43:52 UTC
=== Android Device Manager ===
Version: 16.10.0.15 Hash: 89dcc0b Branch: remotes/origin/d16-10 Build date: 2021-08-12 20:44:10 UTC
=== Xamarin Designer ===
Version: 16.10.0.119 Hash: 36a2d986f Branch: remotes/origin/d16-10 Build date: 2021-06-02 19:41:34 UTC
=== Build Information ===
Release ID: 810080000 Git revision: 0bc91c25997e4c374dc6eb96809c7bf52f6a7c33 Build date: 2021-08-18 14:50:30-04 Build branch: release-8.10
=== Operating System ===
Mac OS X 10.16.0 Darwin 21.1.0 Darwin Kernel Version 21.1.0 Thu Aug 19 02:54:46 PDT 2021 root:xnu-8019.40.29~26/RELEASE_X86_64 x86_64
Any help/ideas/workarounds would be greatly appreciated.
I am getting this exception when configuring firebase. It starts throwing after I updated Firebase.iOS.Analytics to 6.0.4.1 (latest version).
Here is the log;
Failed to configure firebase. Error: Objective-C exception thrown. Name: FIRAnalyticsVersionMismatch Reason: Google Analytics for Firebase version (60004000) does not match with Google App Measurement (50500000) version. Please update. Native stack trace: 0 CoreFoundation 0x00007fff23c7127e __exceptionPreprocess + 350 1 libobjc.A.dylib 0x00007fff513fbb20 objc_exception_throw + 48 2 DDPYogaiOS 0x000000010b251ba9 +[FIRAnalytics logEventWithName:parameters:] + 0 3 libobjc.A.dylib 0x00007fff513fc103 CALLINGSOME+initialize_METHOD + 17 4 libobjc.A.dylib 0x00007fff513fcee9 initializeNonMetaClass + 624 5 libobjc.A.dylib 0x00007fff513fd4ba _ZL24initializeAndMaybeRelockP10objc_classP11objc_objectR8mutex_ttILb0EEb + 157 6 libobjc.A.dylib 0x00007fff51407a5d lookUpImpOrForward + 595 7 libobjc.A.dylib 0x00007fff513f8219 _objc_msgSend_uncached + 73 8 FirebaseCore 0x000000010c06733d -[FIRApp configureCore] + 413 9 FirebaseCore 0x000000010c067010 +[FIRApp addAppToAppDictionary:] + 97 10 FirebaseCore 0x000000010c0669c9 +[FIRApp configureWithName:options:] + 705 11 FirebaseCore 0x000000010c06665a +[FIRApp configureWithOptions:] + 92
My Environment: