maui icon indicating copy to clipboard operation
maui copied to clipboard

Maui not building in Azure pipeline

Open ranjithtech opened this issue 1 year ago • 3 comments

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

ranjithtech avatar Jun 25 '24 20:06 ranjithtech

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.

github-actions[bot] avatar Jun 25 '24 20:06 github-actions[bot]

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

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

drasticactions avatar Jun 26 '24 06:06 drasticactions

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.

ranjithtech avatar Jul 12 '24 15:07 ranjithtech