Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Constructor mismatch in TransparentPopoverBackgroundView #2331

Open
2 tasks done
Pallav-sculptsoft opened this issue Nov 11, 2024 · 10 comments
Open
2 tasks done
Labels
bug Something isn't working unverified

Comments

@Pallav-sculptsoft
Copy link

Pallav-sculptsoft commented Nov 11, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Did you read the "Reporting a bug" section on Contributing file?

Current Behavior

When running a .NET MAUI application on iOS 18.0 with .NET 8.0.403 and Xcode 16.0, a warning is raised related to the CommunityToolkit.Maui.Core.Views.PopupExtensions+TransparentPopoverBackgroundView constructor. The warning indicates that there is no constructor that takes an ObjCRuntime.NativeHandle parameter, but a constructor that takes a System.IntPtr parameter was found and is used instead.

And popup not show.

Expected Behavior

The constructor should properly accept ObjCRuntime.NativeHandle to ensure compatibility and optimal interop behavior and popup to be shown.

Steps To Reproduce

  1. Create a .NET MAUI project using .NET 8.0.403.
  2. Add the CommunityToolkit.Maui package.
  3. Deploy the app on an iOS 18.0 device.
  4. Observe the warning in the output logs.

Link to public reproduction project repository

https://github.com/Pallav-sculptsoft/BugReproduce

Environment

- .NET MAUI CommunityToolkit: 9.1.0
- OS: Sequoia 15.0.1
- .NET MAUI: 8.0.403

Anything else?

Here is the same fixed issue but not for this scenario - xamarin/xamarin-macios#14046

@Pallav-sculptsoft Pallav-sculptsoft added bug Something isn't working unverified labels Nov 11, 2024
@Moes81
Copy link

Moes81 commented Nov 11, 2024

Getting the same error. This is our log:

You've implemented -[ application:performFetchWithCompletionHandler:], but you still need to add "fetch" to the list of your supported UIBackgroundModes in your Info.plist. 2024-11-11 07:28:29.350 MyApp[1425:528326] The type CommunityToolkit.Maui.Core.Views.PopupExtensions+TransparentPopoverBackgroundView does not have a constructor that takes an ObjCRuntime.NativeHandle parameter but a constructor that takes an System.IntPtr parameter was found (and will be used instead). It's highly recommended to change the signature of the System.IntPtr constructor to be ObjCRuntime.NativeHandle.

@brminnick
Copy link
Collaborator

Please ensure your local environment is using the required tools:

  • Xcode 16.0.0
    • Read the latest .NET MAUI Release wiki to always find the latest-supported version) of Xcode for .NET MAUI
    • We HIGHLY recommend using the open-source tool Xcodes to easily manage your installed Xcode versions
  • Update to the latest stable version of Visual Studio (or Jet Brains Rider)
  • Download/install .NET SDK v4.0.3
  • After installing the latest stable .NET SDK, update to the latest stable version of the .NET MAUI workload:
    • On macOS, open the Terminal and enter the following command: sudo dotnet workload install maui
    • On Windows, open the command prompt (or Powershell) and enter the following command: dotnet workload install maui
  • Add a global.json file to your application with the following parameters to ensure you're not using a unsupported preview version of .NET (example below)
    • The .NET MAUI Community Toolkit does not support preview releases of .NET

global.json

{
  "sdk": {
    "version": "8.0.403", 
    "rollForward": "latestMajor",
    "allowPrerelease": false
  }
}

@Moes81
Copy link

Moes81 commented Nov 11, 2024

I can say, that I did exactly these steps after updating to Sequoia.
Image

dotnet --info
.NET SDK:
 Version:           8.0.403
 Commit:            c64aa40a71
 Workload version:  8.0.403.1
 MSBuild version:   17.11.9+a69bbaaf5

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  15.1
 OS Platform: Darwin
 RID:         osx-arm64
 Base Path:   /usr/local/share/dotnet/sdk/8.0.403/

.NET workloads installed:
Configured to use workload sets when installing new manifests.
 [ios]
   Installation Source: SDK 8.0.400
   Manifest Version:    18.0.8303/8.0.100
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/8.0.100/microsoft.net.sdk.ios/18.0.8303/WorkloadManifest.json
   Install Type:        FileBased

 [maui]
   Installation Source: SDK 8.0.400
   Manifest Version:    8.0.82/8.0.100
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/8.0.100/microsoft.net.sdk.maui/8.0.82/WorkloadManifest.json
   Install Type:        FileBased

 [android]
   Installation Source: SDK 8.0.400
   Manifest Version:    34.0.143/8.0.100
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/8.0.100/microsoft.net.sdk.android/34.0.143/WorkloadManifest.json
   Install Type:        FileBased


Host:
  Version:      9.0.0-rc.2.24473.5
  Architecture: arm64
  Commit:       990ebf52fc

.NET SDKs installed:
  7.0.307 [/usr/local/share/dotnet/sdk]
  8.0.204 [/usr/local/share/dotnet/sdk]
  8.0.403 [/usr/local/share/dotnet/sdk]
  9.0.100-rc.2.24474.11 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.21 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.10 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.10 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.0-rc.2.24474.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.21 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.10 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.10 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.0-rc.2.24473.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  /Users/myName/Development/Projects/MyPRrject/global.json

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

@brminnick
Copy link
Collaborator

Thank you @Moes81. Could also confirm that you are using a global.json file that specifically includes "allowPrerelease": false?

Otherwise, the .NET tooling will default to the newest installed SDK, which on your machine is .NET 9 RC 2.

@Moes81
Copy link

Moes81 commented Nov 11, 2024

Yes, definitely. This is a productive project and of course we want to control the build environment. This is our global.json

{
  "sdk": {
    "version": "8.0.0",
    "rollForward": "latestMinor",
    "allowPrerelease": false
  }
}

@Pallav-sculptsoft
Copy link
Author

Pallav-sculptsoft commented Nov 14, 2024

Hello @brminnick,

Unfortunately as mentioned in this issue xamarin/xamarin-macios#14046 we even don't notified as well like :

The unfortunate part is that there will be no compiler warnings or errors flagging this, so users won't know to do it unless they either read the documentation (🤣) or run into the problem, googles for a while, runs into someone else who had the same problem, and applies their (probably broken) fix.

@Pallav-sculptsoft
Copy link
Author

Pallav-sculptsoft commented Nov 20, 2024

Hello @brminnick, @jfversluis

Reproducible demo of constructor mismatch

Project Requirements:
Target Framework: .NET 8
Development Environment: Requires .NET 8 SDK installed.

https://github.com/Pallav-sculptsoft/BugReproduce

.NET SDK:
 Version:           8.0.403
 Commit:            c64aa40a71
 Workload version:  8.0.400-manifests.e0880c5d
 MSBuild version:   17.11.9+a69bbaaf5

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  15.0
 OS Platform: Darwin
 RID:         osx-arm64
 Base Path:   /usr/local/share/dotnet/sdk/8.0.403/

.NET workloads installed:
Configured to use loose manifests when installing new manifests.
 [maui-tizen]
   Installation Source: SDK 8.0.400
   Manifest Version:    8.0.82/8.0.100
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/8.0.100/microsoft.net.sdk.maui/8.0.82/WorkloadManifest.json
   Install Type:        FileBased

 [maui-ios]
   Installation Source: SDK 8.0.400
   Manifest Version:    8.0.82/8.0.100
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/8.0.100/microsoft.net.sdk.maui/8.0.82/WorkloadManifest.json
   Install Type:        FileBased

 [maui-android]
   Installation Source: SDK 8.0.400
   Manifest Version:    8.0.82/8.0.100
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/8.0.100/microsoft.net.sdk.maui/8.0.82/WorkloadManifest.json
   Install Type:        FileBased


Host:
  Version:      9.0.0
  Architecture: arm64
  Commit:       9d5a6a9aa4

.NET SDKs installed:
  6.0.302 [/usr/local/share/dotnet/sdk]
  6.0.402 [/usr/local/share/dotnet/sdk]
  6.0.403 [/usr/local/share/dotnet/sdk]
  6.0.404 [/usr/local/share/dotnet/sdk]
  6.0.407 [/usr/local/share/dotnet/sdk]
  6.0.408 [/usr/local/share/dotnet/sdk]
  6.0.410 [/usr/local/share/dotnet/sdk]
  6.0.412 [/usr/local/share/dotnet/sdk]
  6.0.413 [/usr/local/share/dotnet/sdk]
  6.0.422 [/usr/local/share/dotnet/sdk]
  6.0.425 [/usr/local/share/dotnet/sdk]
  7.0.100 [/usr/local/share/dotnet/sdk]
  7.0.101 [/usr/local/share/dotnet/sdk]
  7.0.202 [/usr/local/share/dotnet/sdk]
  7.0.203 [/usr/local/share/dotnet/sdk]
  7.0.304 [/usr/local/share/dotnet/sdk]
  7.0.306 [/usr/local/share/dotnet/sdk]
  7.0.307 [/usr/local/share/dotnet/sdk]
  7.0.316 [/usr/local/share/dotnet/sdk]
  7.0.317 [/usr/local/share/dotnet/sdk]
  8.0.101 [/usr/local/share/dotnet/sdk]
  8.0.301 [/usr/local/share/dotnet/sdk]
  8.0.302 [/usr/local/share/dotnet/sdk]
  8.0.403 [/usr/local/share/dotnet/sdk]
  9.0.100 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.7 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.10 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.11 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.12 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.15 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.16 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.18 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.20 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.21 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.30 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.33 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.7 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.9 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.10 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.19 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.20 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.10 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.7 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.10 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.11 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.12 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.15 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.16 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.18 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.20 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.21 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.30 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.33 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.7 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.9 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.10 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.19 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.20 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.10 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  x64   [/usr/local/share/dotnet/x64]
    registered at [/etc/dotnet/install_location_x64]

Environment variables:
  Not set

global.json file:
  --

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

@brminnick
Copy link
Collaborator

brminnick commented Nov 20, 2024

Development Environment: Requires .NET 9 SDK installed.

Thank you.

We don't yet support .NET 9.

@Pallav-sculptsoft
Copy link
Author

Pallav-sculptsoft commented Nov 20, 2024

@brminnick,
I think you understand wrong but it’s issue on .NET8. You can verify with given demo, i will correct it for you.

@Pallav-sculptsoft
Copy link
Author

Hello @brminnick , @jfversluis

May be this references helps to identify issue.
#789
xamarin/xamarin-macios#14046

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unverified
Projects
None yet
Development

No branches or pull requests

3 participants