[iOS] MSB4044: The "GetMlaunchArguments" task was not given a value for the required parameter "AppBundlePath".
See original GitHub issueDescription
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
- Create new MAUI Project using the command line
- 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>
- Build and launch on physical iPhone Device:
dotnet build -t:Run -f net6.0-ios -p:_DeviceName=YOUR_DEVICE_NAME
- App launches successfully on device.
- 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);
}
}
- Now the build error occurs.
- 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:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have the error:
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 ofOutputType
, fromLibrary
toExe
.This fixed it for me, thanks!