dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.03k stars 1.73k forks source link

Maui not building in Azure pipeline #23252

Closed ranjithtech closed 2 months ago

ranjithtech commented 3 months ago

Description

We are building a MAUI app migrated from Xamarin. The application builds and runs smoothly on a local mac machine, but when I moved it to Azure pipeline to build, it is failing with below error.

error CS0246: The type or namespace name 'MauiTextField' could not be found (are you missing a using directive or an assembly reference?) [/Users/runner/work/1/s/TestMobile/DashMobile.csproj::TargetFramework=net8.0-ios] /Users/runner/work/1/s/TestMobile/Controls/Handlers/DoneEntryHandler.iOS.cs(37,35):

The maui handler code for the above error is as below.

using CoreGraphics;
using Microsoft.Maui.Handlers;
using Microsoft.Maui.Platform;
using UIKit;

namespace TestMobile.Controls.Handlers
{
    public class DoneEntryHandler : EntryHandler
    {
        protected override void ConnectHandler(MauiTextField platformView)
        {
            base.ConnectHandler(PlatformView);

            // handler code
        }
    }
}

Steps to Reproduce

The Azure build task is

steps:
- task: DotNetCoreCLI@2
  displayName: 'dotnet build'
  inputs:
    projects: iOS/DashMobile.iOS.csproj
    arguments: '--framework net8.0-ios --configuration:Release --verbosity d'

Link to public reproduction project repository

No response

Version with bug

8.0.3 GA

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

.Net SDK Version: 8.0.302

Did you find any workaround?

No response

Relevant log output

No response

github-actions[bot] commented 3 months ago

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.

drasticactions commented 3 months ago

Is the MAUI workload provisioned on the bots you're building on?

Can you build a template MAUI project in your Azure Pipelines?

ranjithtech commented 2 months ago

I resolved it by using .NET SDK version 8.0.101.

The latest mac agent has these version of sdk: 7.0.102, 7.0.202, 7.0.306, 7.0.410, 8.0.101, 8.0.204, 8.0.302 So it tries to use the latest one 8.0.302 which has this problem. It also do not work on 8.0.204

Please fix it in latest sdks.