David Shochet
David Shochet

Reputation: 5395

The "CompileAppManifest" task was not given a value for the required parameter "DefaultSdkVersion"

I am trying to test my .Net MAUI app on my iPhone on PC Visual Studio 2022 that is paired to a Mac with xCode and everything installed. My iPhone is connected to Mac, and I am trying to deploy to it as an iOS Remote Device.

The build fails with the following error:

error MSB4044: The "CompileAppManifest" task was not given a value for the required parameter "DefaultSdkVersion".

The error happens in Xamarin.Shared.targets:

<CompileSceneKitAssets
        SessionId="$(BuildSessionId)"
        AppBundleName="$(_AppBundleName)$(AppBundleExtension)"
        Condition="'$(IsMacEnabled)' == 'true'"
        ToolExe="$(CopySceneKitAssetsExe)"
        ToolPath="$(CopySceneKitAssetsPath)"
        SceneKitAssets="@(SceneKitAsset)"
        IntermediateOutputPath="$(DeviceSpecificIntermediateOutputPath)"
        TargetFrameworkMoniker="$(_ComputedTargetFrameworkMoniker)"
        ProjectDir="$(MSBuildProjectDirectory)"
        ResourcePrefix="$(_ResourcePrefix)"
        IsWatchApp="$(IsWatchApp)"
        SdkPlatform="$(_SdkPlatform)"
        SdkDevPath="$(_SdkDevPath)"
        SdkRoot="$(_SdkRoot)"
        SdkVersion="$(_SdkVersion)">
        <Output TaskParameter="BundleResources" ItemName="_BundleResourceWithLogicalName" />

Deleting bin and obj folder does not help.

The app runs successfully on simulators.

What is missing?

Upvotes: 6

Views: 2720

Answers (5)

gshock
gshock

Reputation: 11

I tried all, delete bin and obj, build vs rebuild. This seems to have worked: (my Macbook was not paired, so be sure it's paired), then after I paired my Mac, I still had problems, but I disconnected and reconnected my iPhone and then it worked.

Upvotes: 1

Kebechet
Kebechet

Reputation: 2397

For me removing of /bin and /obj folder did the trick

Upvotes: 1

Ryan Watson
Ryan Watson

Reputation: 108

Doing a "Build" instead of a "Rebuild" will get the error to go away. Not a fix but at least a workaround to the problem.

Upvotes: 1

Zack
Zack

Reputation: 1629

According to @RyanWatson, Change "Rebuild" to "Build" and it will work without errors.

Upvotes: 1

Geometrics
Geometrics

Reputation: 31

I had the same problem but with an iPad.

Steps to "Fix":

  1. Disconnect the device.
  2. Wait for the target device to change to "Remote Device".
  3. Plug the device back in.
  4. Wait for the target device to change back to "xxx's iPad"

After this, I got "error MT1007: Failed to launch the application", but then it deployed properly.

Upvotes: 3

Related Questions