f-miyu / Plugin.CloudFirestore

MIT License
121 stars 44 forks source link

Works on Android but not in iOS #32

Open Sebastien-Remy opened 4 years ago

Sebastien-Remy commented 4 years ago

Hello,

Thank you for you library. I'm just trying to make some tests with it. I made a Multiplatform (Android and iOS) project. I just use GetDocumentAsync to read a Firestore database that I have already use in web-app project. I follow your instructions and this works fine with Android.

When I build the iOS project I don't have any error but when I click run the app quit without any message. I put GoogleService-info.plist in the project (and put build action to Bundle Ressource).

Is there anything else to do for iOS implementation ?

Note in both project I use Firebase Analytics. It's work fine so I can say my GoogleService-info.plist is correctly implemented.

My code is very simple

async public void Test()
        {
            Console.WriteLine("Test");
            document = await CrossCloudFirestore.Current
                            .Instance
                            .GetCollection("test")
                            .GetDocument("2019-01-01")
                            .GetDocumentAsync();
        }

        public void TestShow()
        {

            Console.WriteLine("TestShow");

            var modelTest = document.ToObject<ModelTest>();
            Console.WriteLine(modelTest.Name);

        }

and my Model also very simple

public class ModelTest
    {
        public static string CollectionPath = "test";

        [Id]
        public string Id { get; set; }

        public string Name { get; set; }

    }
f-miyu commented 4 years ago

I guess it is version miss matching. This library depends on Xamarin.Firebase.iOS.Core:6.1.0.1 and your project's libraries need to use this version. If you want to use Firebase Analytics, you can use Xamarin.Firebase.iOS.Analytics:6.0.4.1. My library, Plugin.FirebaseAnalytics has not updated yet and I will do soon.

Sebastien-Remy commented 4 years ago

Thank you @f-miyu it works like a charm both on Android and iOS after I replace Xamarin.Firebase.iOS.Analytics:6.21 I previously use by Xamarin.Firebase.iOS.Analytics:6.0.4.1

I let you close this issue when you'll update your library.

nugget88 commented 4 years ago

I’m seeing the same problem using xamarin.firebase.ios.auth in the same project as its referencing a newer .Core version.

Any idea when you might be able to update this package to work with current version of .Core?

Or do you know any workarounds?

drhodge commented 4 years ago

I think my issue is similar. After days of trying to find the correct NuGet versions I created a blank project in Xamarin forms.

1) IOS / Android work 1st time as new projects 2) Install Plugin.CloudFireStore 3.0.1 3) On clean / delete bin, obj / close / rebuild warning shown Warning Could not resolve reference "C:\Users\david\AppData\Local\XamarinBuildDownloadCache\GAppM-6.0.4\Frameworks\GoogleAppMeasurement.framework". If this reference is required by your code, you may get compilation errors 4) On rebuild 32 errors for iOS

3> C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(844,3): 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. 3> C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(844,3): 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. 3> C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(844,3): 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. 3> C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(844,3): 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. 3> C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(844,3): 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. 3> C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(844,3): 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. 3> C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(844,3): 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. 3> C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(844,3): 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. 3> C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(844,3): 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. 3> C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(844,3): 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. 3> C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(844,3): 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. 3> C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(844,3): 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. 3> C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(844,3): 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. 3> C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(844,3): 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. 3> C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(844,3): 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. 3> C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(844,3): 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. 3> C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(844,3): 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. 3> C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(844,3): 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. 3> C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(844,3): 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. 3> C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(844,3): 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. 3> C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(844,3): 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. 3> C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(844,3): 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. 3> C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(844,3): 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. 3> C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(844,3): 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. 3> C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(844,3): 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. 3> C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(844,3): 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. 3> C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(844,3): error MT5201: Native linking failed. Please review the build log and the user flags provided to gcc: -ObjC -lc++ -lsqlite3 -lz 3> C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(844,3): error : ] in GoogleAppMeasurement(APMMeasurement_561138f5f113d94c3c5387a826925f21.o) 3> C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(844,3): error : ] in GoogleAppMeasurement(APMMeasurement_561138f5f113d94c3c5387a826925f21.o) 3> C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(844,3): error : ] in GoogleAppMeasurement(APMMeasurement_561138f5f113d94c3c5387a826925f21.o) 3> C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(844,3): error : ] in GoogleAppMeasurement(APMMeasurement_561138f5f113d94c3c5387a826925f21.o) 3> C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(844,3): error : linker command failed with exit code 1 (use -v to see invocation)

No other NuGet packages other than .Essentials / .Forms ie the ones from a blank project template.