Comments (4)
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:
- 'Platform' does not contain a definition for 'Init' (#21253), similarity score: 0.87
- Another - Error CS0246: The type or namespace name 'MauiUIApplicationDelegate' could not be found (are you missing a using directive or an assembly reference?) (CS0246) (#21751), similarity score: 0.77
- .NET 8 - No reference to MauiUIApplicationDelegate and ViewRenderer<,> (#18795), similarity score: 0.76
- The type or namespace name 'MauiUIApplicationDelegate' could not be found Microsoft.AspNetCore.Components.WebView.Maui 8.0.7 (#20591), similarity score: 0.75
- error CS0234: The type or namespace name 'iOS' does not exist in the namespace 'Microsoft.Maui.Controls.Compatibility.Platform' (#20589), similarity score: 0.74
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
from maui.
Added repro repo (tho it was created with just the 3 steps listed above)
from maui.
![スクリーンショット 2024-06-20 17 27 58](https://private-user-images.githubusercontent.com/898335/341334449-b2f3b72f-dddb-454e-8f78-2edff2a20bd8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkwNzM1MjIsIm5iZiI6MTcxOTA3MzIyMiwicGF0aCI6Ii84OTgzMzUvMzQxMzM0NDQ5LWIyZjNiNzJmLWRkZGItNDU0ZS04Zjc4LTJlZGZmMmEyMGJkOC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNjIyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDYyMlQxNjIwMjJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT04OTU1OGU0YjJiOGQ2NDc0MDYzYzI3MWY2NTU0NmZjOTA0YTJiNGE0MThmZjMwYjk0YzZjMmJjMDczZjQ5ZWY1JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.tak8-E0mfj0UmZGAS0ivU54C0PV5HPdIDcZxq4ulwVQ)
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.
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.
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)
- [BUG] ios LineBreakMode and MaxLines on Label controls does not work well HOT 2
- [Windows] CascadeInputTransparent="False" not working for ScrollView and ContentView HOT 1
- Unable to compile iOS Binding Library HOT 3
- UIScrollView able to pan past content inside scrollview when zooming (iOS) HOT 2
- Starting Community Triagers process in our repo HOT 2
- Blazor Hybrid & Web Solution Template: Template options need updating HOT 2
- Width value return -1 HOT 4
- Image is flickering after ImageSource change HOT 3
- TabbedPage doesn't change icon colour HOT 2
- FlexLayout Items (such as buttons, labels and so, etc) Padding not Working HOT 2
- TapGestureRecognizer.Tapped fired multiple times on Android when GestureRecognizers were changed after rendering. HOT 1
- TapGestureRecognizer.Tapped fired multiple times on Android when GestureRecognizers were changed after rendering. HOT 1
- AppIcon not displayed for Android 7 HOT 17
- Play a local video on Android in MAUI app HOT 2
- Color.FromHsla only returns white color HOT 3
- Bad performance while using OData client vs using HttpClient on Android HOT 8
- FontImageSource in Button and ImageButton doesn't display properly HOT 2
- Error when trying to run myfirstapp on pixel device emulation HOT 4
- Error: Activity class {../MainActivity} does not exist. HOT 4
- NavigationBarColors from NavigationPage not changing on AppTheme changing HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from maui.