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

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

Closed
tivtag opened this issue Feb 2, 2022 · 6 comments
Labels
area-tooling XAML & C# Hot Reload, XAML Editor, Live Visual Tree, Live Preview, Debugging platform/iOS 🍎 t/bug Something isn't working

Comments

@tivtag
Copy link

tivtag commented Feb 2, 2022

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)
@tivtag tivtag added the t/bug Something isn't working label Feb 2, 2022
@tivtag
Copy link
Author

tivtag commented Feb 2, 2022

A comment on this Xamarin issue also reports this same build error with no solution: dotnet/xamarin#26 (comment)

@hartez hartez added the area-tooling XAML & C# Hot Reload, XAML Editor, Live Visual Tree, Live Preview, Debugging label Feb 2, 2022
@tivtag
Copy link
Author

tivtag commented Feb 17, 2022

Updating to .NET MAUI Preview 13 and .NET 6.0.2 and creating a new project I still receive this error once I add the AsyncNfcReader.cs to the Platforms/iOS/ folder.

/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/15.2.301-preview.13.2/targets/Xamarin.Shared.Sdk.targets(1556,3): error MSB4044: The "GetMlaunchArguments" task was not given a value for the required parameter "AppBundlePath".

@codemonkey85
Copy link

I'm seeing this error as well.

@andrestalavera
Copy link

andrestalavera commented 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.

@krdmllr
Copy link
Contributor

krdmllr commented Mar 3, 2022

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

This fixed it for me, thanks!

@Redth
Copy link
Member

Redth commented Mar 23, 2022

Thanks for sharing your answer, yes the OutputType must be Exe.

@Redth Redth closed this as completed Mar 23, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Apr 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-tooling XAML & C# Hot Reload, XAML Editor, Live Visual Tree, Live Preview, Debugging platform/iOS 🍎 t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants