码迷,mamicode.com
首页 > 其他好文 > 详细

MAUI 安装

时间:2021-07-14 18:46:24      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:strong   level   ima   form   alter   uri   基础   mini   character   

    基础安装可参考  官方地址

  但是安装MAUI的时候出现了错误,错误如下:

       技术图片

 

  解决方法:

  文件名称: Versions.props

<Project>
  <!--Package versions-->
  <PropertyGroup>
    <MicrosoftDotnetSdkInternalPackageVersion>6.0.100-preview.5.21302.13</MicrosoftDotnetSdkInternalPackageVersion>
    <MicrosoftAndroidSdkWindowsPackageVersion>30.0.100-preview.5.28</MicrosoftAndroidSdkWindowsPackageVersion>
    <MicrosoftMacCatalystSdkPackageVersion>14.5.100-preview.5.894</MicrosoftMacCatalystSdkPackageVersion>
    <MicrosoftiOSSdkPackageVersion>14.5.100-preview.5.894</MicrosoftiOSSdkPackageVersion>
    <MicrosofttvOSSdkPackageVersion>14.5.100-preview.5.894</MicrosofttvOSSdkPackageVersion>
    <MicrosoftmacOSSdkPackageVersion>11.3.100-preview.5.894</MicrosoftmacOSSdkPackageVersion>
  </PropertyGroup>
  <PropertyGroup>
    <!-- Trim all characters after first `-` or `+` is encountered. -->
    <DotNetPreviewVersionBand Condition=" ‘$(DotNetPreviewVersionBand)‘ == ‘‘ ">$([System.Text.RegularExpressions.Regex]::Replace($(MicrosoftDotnetSdkInternalPackageVersion), `[-+].*$`, ""))</DotNetPreviewVersionBand>
  </PropertyGroup>
</Project>

 文件名称:maui.manifest.json

{
  "check": {
    "toolVersion": "0.5.6",
    "variables": {
      "MAUI_VERSION": "6.0.100-preview.5.794",
      "OPENJDK_VERSION": "11.0.10.9"
    },
    "variableMappers":[
      {
        "$type" : "DotNetCheck.Manifest.XmlVariableMapper, MauiCheck",
        "sourceUri" : "C:\\Users\\Administrator\\Desktop\\Versions.props",
        
        "mappings": [
          { "name": "DOTNET_SDK_VERSION", "xpath": "//Project/PropertyGroup/MicrosoftDotnetSdkInternalPackageVersion/text()" },
          { "name": "MACCATALYST_SDK_VERSION", "xpath": "//Project/PropertyGroup/MicrosoftMacCatalystSdkPackageVersion/text()" },
          { "name": "IOS_SDK_VERSION", "xpath": "//Project/PropertyGroup/MicrosoftiOSSdkPackageVersion/text()" },
          { "name": "TVOS_SDK_VERSION", "xpath": "//Project/PropertyGroup/MicrosofttvOSSdkPackageVersion/text()" },
          { "name": "MACOS_SDK_VERSION", "xpath": "//Project/PropertyGroup/MicrosoftmacOSSdkPackageVersion/text()" },
          { "name": "ANDROID_SDK_VERSION", "xpath": "//Project/PropertyGroup/MicrosoftAndroidSdkWindowsPackageVersion/text()" }
        ]
      }
    ],
    "openjdk": {
      "version": "11.0",
      "urls": {
        "win64": "https://aka.ms/download-jdk/microsoft-jdk-$(OPENJDK_VERSION)-windows-x64.msi",
        "osx": "https://aka.ms/download-jdk/microsoft-jdk-$(OPENJDK_VERSION)-macos-x64.pkg"
      }
    },
    "xcode": {
      "minimumVersion": "12.5"
    },
    "vswin": {
      "minimumVersion": "16.10.0"
    },
    "vsmac": {
      "minimumVersion": "8.10.0",
      "optional": "true"
    },
    "android": {
      "packages": [
        {
          "path": "emulator",
          "version": "30.4.5"
        },
        {
          "path": "build-tools;30.0.2",
          "version": "30.0.2"
        },
        {
          "path": "platforms;android-30",
          "version": "3"
        },
        {
          "path": "system-images;android-30;google_apis;x86",
          "version": "9",
          "alternatives": [
            {
              "path": "system-images;android-30;google_apis_playstore;x86",
              "version": "9"
            },
            {
              "path": "system-images;android-30;google_apis;x86_64",
              "version": "10"
            },
            {
              "path": "system-images;android-30;google_apis_playstore;x86_64",
              "version": "10"
            }
          ]
        },
        {
          "path": "platform-tools",
          "version": "31.0.0"
        }
      ],
      "emulators": [
        {
          "sdkId": "system-images;android-30;google_apis;x86",
          "alternateSdkIds": [
            "system-images;android-30;google_apis_playstore;x86",
            "system-images;android-30;google_apis;x86_64",
            "system-images;android-30;google_apis_playstore;x86_64"
          ],
          "desc": "Android Emulator - x86 - API30 - Google API‘s",
          "apiLevel": 30,
          "tag": "google_apis",
          "device": "pixel"
        }
      ]
    },
    "dotnet": {
      "sdks": [
        {
          "version": "$(DOTNET_SDK_VERSION)",
          "requireExact": true,
          "enableWorkloadResolver": false,
          "urls": {
            "win64": "https://dotnetcli.azureedge.net/dotnet/Sdk/$(DOTNET_SDK_VERSION)/dotnet-sdk-$(DOTNET_SDK_VERSION)-win-x64.exe",
            "win": "https://dotnetcli.azureedge.net/dotnet/Sdk/$(DOTNET_SDK_VERSION)/dotnet-sdk-$(DOTNET_SDK_VERSION)-win-x86.exe",
            "osx": "https://dotnetcli.azureedge.net/dotnet/Sdk/$(DOTNET_SDK_VERSION)/dotnet-sdk-$(DOTNET_SDK_VERSION)-osx-x64.pkg"
          },
          "packageSources": [
            "https://pkgs.dev.azure.com/azure-public/vside/_packaging/xamarin-impl/nuget/v3/index.json"
          ],
          "workloads": [
            {
                "workloadId": "microsoft-android-sdk-full",
                "packageId": "Microsoft.NET.Sdk.Android.Manifest-6.0.100",
                "version": "$(ANDROID_SDK_VERSION)"
            },
            {
                "workloadId": "microsoft-ios-sdk-full",
                "packageId": "Microsoft.NET.Sdk.iOS.Manifest-6.0.100",
                "version": "$(IOS_SDK_VERSION)"
            },
            {
                "workloadId": "microsoft-maccatalyst-sdk-full",
                "packageId": "Microsoft.NET.Sdk.MacCatalyst.Manifest-6.0.100",
                "version": "$(MACCATALYST_SDK_VERSION)"
            },
            {
                "workloadId": "microsoft-tvos-sdk-full",
                "packageId": "Microsoft.NET.Sdk.tvOS.Manifest-6.0.100",
                "version": "$(TVOS_SDK_VERSION)"
            },
            {
                "workloadId": "microsoft-macos-sdk-full",
                "packageId": "Microsoft.NET.Sdk.macOS.Manifest-6.0.100",
                "version": "$(MACOS_SDK_VERSION)"
            }
          ],
          "packs": [
            {
              "id": "Microsoft.Maui.Templates",
              "version": "$(MAUI_VERSION)",
              "skipManifestCheck": true,
              "packKind": "template",
              "templateShortName": "maui"
            }
          ]
        }
      ]
    }
  }
}

 

  找到 maui.manifest.json 中的 sourceUri 节点。将地址改为 Versions.props 的文件地址

 

  然后执行下面命令,不要 [ ]

  

maui-check -m [maui.manifest.json的地址]

 

   

 

MAUI 安装

标签:strong   level   ima   form   alter   uri   基础   mini   character   

原文地址:https://www.cnblogs.com/student-note/p/15010048.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!