Giter Site home page Giter Site logo

Comments (8)

MitchBomcanhao avatar MitchBomcanhao commented on June 15, 2024

Sounds like you need to update xamarin forms along with essentials.

from essentials.

dooferorg avatar dooferorg commented on June 15, 2024

No, this still occurs even with everything else updated.

The issue is this project has made 'Platform.init()' protected.

from essentials.

jfversluis avatar jfversluis commented on June 15, 2024

Make sure that you updated both Xamarin.Forms and Xamarin.Essentials on all of your projects, the shared project, iOS, Android and that all the versions align. I don't see any reason why this should break. It seems to work fine in the sample app.

from essentials.

dooferorg avatar dooferorg commented on June 15, 2024

Make sure that you updated both Xamarin.Forms and Xamarin.Essentials on all of your projects, the shared project, iOS, Android and that all the versions align. I don't see any reason why this should break. It seems to work fine in the sample app.

You mean the sample Android app MainActivity.cs that calls Platform.Init() that I expressly stated is now a protected method when updating to version 1.8.0 when all 1.7.x versions work fine?

from essentials.

jfversluis avatar jfversluis commented on June 15, 2024

Still public from what I can see. The sample project is still a separate project and is bound to the same rules as your application, so if it was protected, it shouldn't be able to call it just like you.

https://github.com/xamarin/Essentials/blob/main/Xamarin.Essentials/Platform/Platform.android.cs#L87-L97

from essentials.

dooferorg avatar dooferorg commented on June 15, 2024

Yes, I realized I mispoke about the Init() method (really thought that was the issue when I made the bug report) .. seems it was picking up the System 'Platform' object incorrectly and then whining about it, after my upgrade to 1.8.0.

What 1.8.0 DOES seem to break is the where the 'Platform' object even is.

I took some screenshots through my process. When I changed to explicit namespacing for the call to Platform.Init just like the sample application does, the proper error is apparent - it's not finding 'Platform' any more under the 1.8.0 nuget package.

Screenshot 2023-11-30 163806
Screenshot 2023-11-30 163826
Screenshot 2023-11-30 164136

Removing the call to 'Platform.Init()' breaks the version tracking.

Maybe the sample project needs to be updated since obviously something is different now. Maybe another package needs to be installed but it's not apparent to me what it is.

from essentials.

jfversluis avatar jfversluis commented on June 15, 2024

But that's the thing. 1.8.0 did not bring any breaking change in that regard. You can also see in the sample that the MainActivity hasn't been touched in 3 years. If there was a breaking change in this area, that would've needed an update as well, but it didn't.

I have the feeling that there might be some weird issue with different versions between projects for you or some caching of older versions. If you throw out the bin/obj folders for the projects and rebuild, does that help?

If you create a new project and add Essentials to that and try to do the same, does that produce the same result?

from essentials.

dooferorg avatar dooferorg commented on June 15, 2024

That's fair enough. I just don't understand it. I tried making a new Xamarin project and I was able to upgrade it to 1.8.0 and it kept working.

However, even removing all dependencies to make the nuget package list the exact same as my updated example app, my original app had this error. I had closed the project and cleared the bin/obj folders both times on both projects to see if there was any caching going on. I just cannot get it to work with 1.8.0 on my original app.

I do thank you for helping me work through this. It does appear that it's not a bug on this project so I'm going to close it off. I'll just stick with 1.7.7 and move on with life at this point! lol.

from essentials.

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.