Coder Social home page Coder Social logo

Comments (19)

guperrot avatar guperrot commented on May 14, 2024 1

We do not have dependency on any 3rd party sqlite libraries on Xamarin.iOS, we use the system one and that conflicts at runtime with Avakache which uses a 3rd party library for sqlite.

What Jae answered is that the runtime error can be avoided by initializing MobileCenter before.

from appcenter-sdk-dotnet.

guperrot avatar guperrot commented on May 14, 2024 1

I am considering leaving this one opened for visibility and avoid duplicates.

from appcenter-sdk-dotnet.

ghuntley avatar ghuntley commented on May 14, 2024

Howdy,

One of the maintainers for Akavache here. We aren't a huge fan of bundle_green, because it means an app is not using the same SQLite version on all platforms. This logic was part of the discussion back when Akavache chose to use bundle_e_sqlite3.

Eventually Microsoft is going to get an edge case where tests are green and they'll ship a a red build unknowingly for the iOS platform.

Eric (author of sqlpcliteraw) advocates using bundle_e_sqlite3 for these reasons but agrees that standardizing on a single bundle is not the 100% path to success. Rather it is just a path to a different kind of frustration. For example there are alternatives implementations of Sqlite such as Chipher and Couchbase.Lite.

This is discussed further over at
https://reactivex.slack.com/archives/C02CBKUV8/p1504541597000250 - send an email to [email protected] for a slack invitation.

from appcenter-sdk-dotnet.

jaeklim avatar jaeklim commented on May 14, 2024

MobileCenter must be started prior to any 3rd party libraries that are using custom SQLite. If you do so, there shouldn't be any issues with Akavache 5.0.

from appcenter-sdk-dotnet.

guperrot avatar guperrot commented on May 14, 2024

No answer in 7 days, closing. Will reopen if needed.

from appcenter-sdk-dotnet.

ghuntley avatar ghuntley commented on May 14, 2024

@guperrot and @jaelim-ms there are issues and will be more issues like this raised in the future. Please start a conversation with the library author that you build upon and use as a dependancy for more specifics. This is a design issue, not a support issue.

from appcenter-sdk-dotnet.

ghuntley avatar ghuntley commented on May 14, 2024

@guperrot thanks for the convo. Learned a few things (thank-you) - not sure how we can resolve this one considering how Mobile Centre for .NET is constructed. Please close this issue out and Akavache will keep tracking over at reactiveui/Akavache#382

Summary:

  • Azure Mobile Centre is actually developed as objective-c first; then that library is bundled up into an assembly w/p/invoke headers/bindings. See https://github.com/Microsoft/mobile-center-sdk-ios/tree/develop/MobileCenter/MobileCenter
  • There's no easy way out of this situation; the only way out of this hot mess would be if the entire .NET ecosystem started using and standardized on bundle_green (i.e. don't ship sqlite for ios) but that still wouldn't fix consumers who use sqlite encryption or couchbase lite.

from appcenter-sdk-dotnet.

biapar avatar biapar commented on May 14, 2024

I send the code to Azure Mobility group, too.
The code where to init is into app.cs and I init the Mobile Library into appstart before Akavache.

`Xamarin Forms.

public App()

    {

        InitializeComponent();



     

        FlowListView.Init();



        //MainPage = new Harley_Davidson_Protection.MainPage();



        //BlobCache.ApplicationName = "HDAkavache";   // Init Akavache



        var menuPage = new MenuPage();



        NavigationPage = new NavigationPage(new DashboardPage())

        {

            BarBackgroundColor = Color.FromHex("#000"),

            BarTextColor = Color.White

        };



        //NavigationPage.BarBackgroundColor = Color.Black;



        //NavigationPage.BarTextColor =  Color.FromHex("#f48322");



        //NavigationPage.BarTextColor = Color.White;





        RootPage = new RootPage();

        RootPage.Master = menuPage;

        RootPage.Detail = NavigationPage;

        MainPage = RootPage;





        Color origPageBgColor = Color.Black;

        RootPage.IsPresentedChanged += async (object sender, EventArgs e) =>

        {

            if (Xamarin.Forms.Device.OS == TargetPlatform.iOS)

            {

                if (RootPage.IsPresented)

                {

                    var currentPage = ((NavigationPage)RootPage.Detail).CurrentPage;

                    origPageBgColor = currentPage.BackgroundColor;





                    currentPage.BackgroundColor = Color.Black;

                    currentPage.FadeTo(0.5);

                    if (currentPage.BackgroundColor == Color.Default)

                    {

                        currentPage.BackgroundColor = Color.White;



                    }



                    menuPage.Icon = "cross16.png";

                }

                else

                {

                    var currentPage = ((NavigationPage)RootPage.Detail).CurrentPage;

                    currentPage.BackgroundColor = origPageBgColor;

                    menuPage.Icon = "menu16.png";

                    currentPage.FadeTo(1.0);

                }

            }

        };

     }



    protected override void OnStart()

    {

        // Handle when your app starts





        Push.PushNotificationReceived += (sender, e) => {



            // Add the notification message and title to the message

            var summary = $"Push notification received:" +

                                $"\n\tNotification title: {e.Title}" +

                                $"\n\tMessage: {e.Message}";



            // If there is custom data associated with the notification,

            // print the entries

            if (e.CustomData != null)

            {

                summary += "\n\tCustom data:\n";

                foreach (var key in e.CustomData.Keys)

                {

                    summary += $"\t\t{key} : {e.CustomData[key]}\n";

                }

            }



            // Send the notification summary to debug output

            System.Diagnostics.Debug.WriteLine(summary);



            CrossLocalNotifications.Current.Show("Harley Davidson Protection", summary);

        };



      

        MobileCenter.Start("ios=xyzagd;" +

               "android=dfghtke;",

               typeof(Analytics), typeof(Crashes), typeof(Push));



      

    }`

from appcenter-sdk-dotnet.

jaeklim avatar jaeklim commented on May 14, 2024

I replied to you already, looks you are initializing Akavache in a constructor. Please move it after MobileCenter Start call.

from appcenter-sdk-dotnet.

guperrot avatar guperrot commented on May 14, 2024

You can call MobileCenter.Start in constructor if you want by the way.

from appcenter-sdk-dotnet.

biapar avatar biapar commented on May 14, 2024

I already did what you say but I had the same problem.

from appcenter-sdk-dotnet.

guperrot avatar guperrot commented on May 14, 2024

@biapar can you test with 0.16.0? A change has been made in iOS database implementation that could improve compatibility.

from appcenter-sdk-dotnet.

guperrot avatar guperrot commented on May 14, 2024

@biapar did you get a chance to test with 0.16.0?

from appcenter-sdk-dotnet.

sanyandreichuk avatar sanyandreichuk commented on May 14, 2024

I had the same issue and can confirm that 0.16.0 fixed it.

from appcenter-sdk-dotnet.

biapar avatar biapar commented on May 14, 2024

from appcenter-sdk-dotnet.

biapar avatar biapar commented on May 14, 2024

from appcenter-sdk-dotnet.

guperrot avatar guperrot commented on May 14, 2024

@biapar when you said "very good", that means it worked for you?

from appcenter-sdk-dotnet.

biapar avatar biapar commented on May 14, 2024

from appcenter-sdk-dotnet.

guperrot avatar guperrot commented on May 14, 2024

Ok, based on @l3xer answer, 0.16.0 seems to fix the issue, so will wait another week before closing this ticket if I don't hear anything bad here.

from appcenter-sdk-dotnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.