Giter Club home page Giter Club logo

Comments (4)

github-actions avatar github-actions commented on July 3, 2024

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

from maui.

metal450 avatar metal450 commented on July 3, 2024

Added repro repo (tho it was created with just the 3 steps listed above)

from maui.

drasticactions avatar drasticactions commented on July 3, 2024
スクリーンショット 2024-06-20 17 27 58

Yeah, your repro shows this working.

My guess, based on your error, is that you either have that code inside a file that is being referenced by another target framework. Even though you mentioned this happening in AppDelegate in (I think) a MAUI UI project, which I also tried and worked fine, as expected.

public static void Init(Func<UIKit.UIViewController>? getCurrentUIViewController) =>

This would only works on iOS/Catalyst, and the single target MAUI solution targets iOS, Catalyst, Windows, and Android. So maybe you have it placed somewhere we're it's trying to be compiled for other platforms. Or maybe your IDE is targeting that file for other platforms and it's showing it as failing, but it would compile fine from CLI. My guess looking at that other issue you linked to is they had the same issue. Without having a sample project nor context into where they were typing their code, it was probably targeting the base TFM where nothing exists for Platform.

There is no change in that API from net7.0 to net8.0. IMO I don't think there's a bug here, I think it's more a configuration issue with your project and/or IDE. Could you try creating a MAUI UI project showing your issue?

from maui.

metal450 avatar metal450 commented on July 3, 2024

Ok, I had to do 2 things:

  • Upon updating Visual Studio, it fixed it in the repro project. But it still occurred in my actual app.
  • I had to change the Target OS version of the project to 17.2. Anything lower than that (even 17.0) causes this to occur, including in the sample project.

When the issue is present, if I go to the definition of Microsoft.Maui.ApplicationModel, I can see that it's because the #elif IOS || MACCATALYST case isn't being compiled. aka IOS isn't defined. I'm not sure why it should be necessary to both upgrade Visual Studio and change the target OS version for that to be defined, but in any event, it is an extremely unclear error that seems to crop up on multiple platforms, so it seems like there'd be a better way to handle it / report the issue to the user...?

from maui.

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.