I have converted a Xamarin project to MAUI project using Upgrade Assistant as per this blog. First I upgraded solution, then I upgraded the android and ios projects. After that I build my solution but I get the below errors.
Error NETSDK1047 Assets file 'C:\Users\SREEJITH\source\repos\MAUIDemo\MAUIDemo\MAUIDemo.iOS\obj\project.assets.json' doesn't have a target for 'net6.0-ios/ios-arm64'. Ensure that restore has run and that you have included 'net6.0-ios' in the TargetFrameworks for your project. You may also need to include 'ios-arm64' in your project's RuntimeIdentifiers.
MAUIDemo.iOS C:\Program Files\dotnet\sdk\7.0.306\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets 266
Error CS0234 The type or namespace name 'Forms' does not exist in the namespace 'Xamarin' (are you missing an assembly reference?)
MAUIDemo.Android (net6.0-android) C:\Users\SREEJITH\source\repos\MAUIDemo\MAUIDemo\MAUIDemo.Android\MainActivity.cs 11 Active
Error CS0234 The type or namespace name 'Content' does not exist in the namespace 'MAUIDemo.Android' ...
Error CS0234 The type or namespace name 'Essentials' does not exist in the namespace 'Xamarin' ...
Error CS0234 The type or namespace name 'Forms' does not exist in the namespace 'Xamarin' ...
Error CS0103 The name 'LoadApplication' does not exist in the current context MAUIDemo.Android (net6.0-android) C:\Users\SREEJITH\source\repos\MAUIDemo\MAUIDemo\MAUIDemo.Android\MainActivity.cs 19 Active
...
Screenshot:
I have a few questions related to this:
I upgraded the solution, android and iOS projects. Is solution upgrade is enough or do we need to upgrade the android and iOS projects?
When I create a new MAUI project, I found there is a
Platformsfolder and on that I found Android and iOS sub folders. But when upgrade no such folders are created on my side, should I create it manually?Below is the project structure of a MAUI project created. Like that do I need to create all the files and folders?
Update
Below issues are currently I am facing:
- Error : XamlC error XFC0000 : Cannot resolve type "ContentPage".
- Error : XamlC error XFC0000 : Cannot resolve type "Frame".
- Error : XamlC error XFC0000 : Cannot resolve type "Application".
- Project targets 'net6.0-android;net6.0-ios'. It cannot be referenced by a project that targets 'MonoAndroid,Version=v13.0'.
- Project targets 'net6.0-android;net6.0-ios'. It cannot be referenced by a project that targets 'Xamarin.iOS,Version=v1.0'.
- Project is not compatible with monoandroid13.0 Project supports: net6.0-android31.0 (.NETCoreApp,Version=v6.0) net6.0-ios16.1 (.NETCoreApp,Version=v6.0)
- Project is not compatible with xamarinios10 Project supports: net6.0-android31.0 (.NETCoreApp,Version=v6.0) net6.0-ios16.1 (.NETCoreApp,Version=v6.0)
- Version conflict detected for Xamarin.AndroidX.Browser. Install/reference Xamarin.AndroidX.Browser 1.4.0.1 directly to project to resolve this issue. Microsoft.Maui.Dependencies 6.0.553 -> Xamarin.AndroidX.Browser (>= 1.4.0.1) Xam.Plugin.HtmlLabel 5.1.0 -> Xamarin.Essentials 1.7.0 -> Xamarin.AndroidX.Browser (>= 1.3.0.5 && < 1.4.0).
- The target platform must be set to Windows (usually by including '-windows' in the TargetFramework property) when using Windows Forms or WPF, or referencing projects or packages that do so.


