question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[iOS] MSB4044: The "GetMlaunchArguments" task was not given a value for the required parameter "AppBundlePath".

See original GitHub issue

Description

After adding a file to the Platforms/iOS folder, I receive following build error: MSB4044: The “GetMlaunchArguments” task was not given a value for the required parameter “AppBundlePath”.

Removing the file did not fix the issue. What do I have to do to fix this issue?

Microsoft (R) Build Engine version 17.1.0-preview-22075-05+b5c435978 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  All projects are up-to-date for restore.
  MyMauiApp2 -> /Users/paule/Projects/NetMauiTest/MyMauiApp2/bin/Debug/net6.0-ios/ios-arm64/MyMauiApp2.dll
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/15.2.200-preview.12.4/targets/Xamarin.Shared.Sdk.targets(1243,3): error MSB4044: The "GetMlaunchArguments" task was not given a value for the required parameter "AppBundlePath". [/Users/paule/Projects/NetMauiTest/MyMauiApp2/MyMauiApp2.csproj]

Build FAILED.

/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/15.2.200-preview.12.4/targets/Xamarin.Shared.Sdk.targets(1243,3): error MSB4044: The "GetMlaunchArguments" task was not given a value for the required parameter "AppBundlePath". [/Users/paule/Projects/NetMauiTest/MyMauiApp2/MyMauiApp2.csproj]
    0 Warning(s)
    1 Error(s)

Thank you! Paul Ennemoser

Steps to Reproduce

  1. Create new MAUI Project using the command line
  2. Configure iOS build by adding following code to the .csproj:
    <PropertyGroup Condition="$(TargetFramework.Contains('-ios'))">
        <RuntimeIdentifier>ios-arm64</RuntimeIdentifier>
		<CodesignKey>YOUR_KEY</CodesignKey>
                <CodesignProvision>YOUR_PROVISIONING_PROFILE_UUID</CodesignProvision>	
                <!--<CodesignEntitlements>Platforms/iOS/Entitlements.plist</CodesignEntitlements>-->  
		<ProvisioningType>manual</ProvisioningType>
    </PropertyGroup>
  1. Build and launch on physical iPhone Device:
dotnet build -t:Run -f net6.0-ios -p:_DeviceName=YOUR_DEVICE_NAME
  1. App launches successfully on device.
  2. Now add a class file to the Platforms/iOS/ folder, such as the following class. I received this error also after adding an Entitlements.plist file.
using ObjCRuntime;
using UIKit;
using CoreNFC;
using Foundation;
using CoreFoundation;
using System.Text;

namespace MyMauiApp2;

public class AsyncNfcReader : NSObject, INFCNdefReaderSessionDelegate
{
    private NFCNdefReaderSession _session;
    private TaskCompletionSource<string> _tcs;

    public Task<string> ScanAsync()
    {
        if (NFCNdefReaderSession.ReadingAvailable)
        {
            throw new InvalidOperationException("Reading NDEF is not available");
        }

        _tcs = new TaskCompletionSource<string>();
        _session = new NFCNdefReaderSession(this, DispatchQueue.CurrentQueue, true);
        _session.BeginSession();

        return _tcs.Task;
    }

    public void DidInvalidate(NFCNdefReaderSession session, NSError error)
    {
        _tcs.TrySetException(new Exception(error?.LocalizedFailureReason));
    }

    public void DidDetect(NFCNdefReaderSession session, NFCNdefMessage[] messages)
    {
        var bytes = messages[0].Records[0].Payload.Skip(3).ToArray();
        var message = Encoding.UTF8.GetString(bytes);
        _tcs.SetResult(message);
    }
}
  1. Now the build error occurs.
  2. Removing the new file doesn’t recover the build error.

Version with bug

Preview 12 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 15, VS for MAC Preview 5, .NET SDK 6.0.200, macOS 12.2 on ARM/M1

Did you find any workaround?

No response

Relevant log output

Microsoft (R) Build Engine version 17.1.0-preview-22075-05+b5c435978 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  All projects are up-to-date for restore.
  MyMauiApp2 -> /Users/paule/Projects/NetMauiTest/MyMauiApp2/bin/Debug/net6.0-ios/ios-arm64/MyMauiApp2.dll
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/15.2.200-preview.12.4/targets/Xamarin.Shared.Sdk.targets(1243,3): error MSB4044: The "GetMlaunchArguments" task was not given a value for the required parameter "AppBundlePath". [/Users/paule/Projects/NetMauiTest/MyMauiApp2/MyMauiApp2.csproj]

Build FAILED.

/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/15.2.200-preview.12.4/targets/Xamarin.Shared.Sdk.targets(1243,3): error MSB4044: The "GetMlaunchArguments" task was not given a value for the required parameter "AppBundlePath". [/Users/paule/Projects/NetMauiTest/MyMauiApp2/MyMauiApp2.csproj]
    0 Warning(s)
    1 Error(s)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
andrestalaveracommented, Feb 28, 2022

I have the error:

/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/15.2.301-preview.13.7/targets/Xamarin.Shared.Sdk.targets(1616,3): error MSB4044: The "GetMlaunchArguments" task was not given a value for the required parameter "AppBundlePath". [/Users/Andres/Projects/XXX-Maui/XXX.Mobile/XXX.Mobile.csproj]

At this day, I use the latest version of framework (SDK 6.0.200) on the last version of VS (2022 Preview, v17 build 7303) and macOS Monterey.

But in my case, I have found a solution: I have compare a new project with my project (mainly a migration) and I have found one difference… In my *.csproj. I have replace the value of OutputType, from Library to Exe.

1reaction
krdmllrcommented, Mar 3, 2022

I have replace the value of OutputType, from Library to Exe.

This fixed it for me, thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

MSB4044 - MSBuild
This error occurs when a task is not provided a value for a required parameter. The message resembles the following text:.
Read more >
The "CompileAppManifest" task was not given a value for ...
The build fails with the following error: error MSB4044: The "CompileAppManifest" task was not given a value for the required parameter " ...
Read more >
[.NET MAUI] error MSB4044: The "CompileAppManifest ...
NET MAUI] error MSB4044: The "CompileAppManifest" task was not given a value for the required parameter "DefaultSdkVersion"Closed - Fixed
Read more >
MSB4044
task was not given a value for the required parameter "Path". Am completely stuck and not sure how to come out of it....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found