简体   繁体   English

.net maui 项目由于应用程序图标而无法存档/发布

[英].net maui poject cannot archive/Publish due to app icon

Following the changes as directed in Microsoft documentation , I made changes to my project as thus.按照Microsoft 文档中指示的更改,我对我的项目进行了更改。

Android Manifest Android 清单

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application android:allowBackup="true" 
              android:icon="@mipmap/kigoo" 
              android:roundIcon="@mipmap/kigoo_round" 
              android:supportsRtl="true">
   
 </application>
 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
 <uses-permission android:name="android.permission.INTERNET" />

<queries>
  <intent>
    <action android:name="android.intent.action.DIAL" />
    <data android:scheme="tel"/>
  </intent>
  <intent>
   <action android:name="android.intent.action.SENDTO" />
   <data android:scheme="mailto" />
  </intent>
 </queries>


</manifest>

In the project.csprog在项目.csprog

 <!-- App Icon -->
   <MauiIcon Include="Resources\AppIcon\appicon.svg" 
   ForegroundFile="Resources\AppIcon\kigoo.svg" ForegroundScale="0.65" Color="#512BD4" 
    />

I can deploy to the emulator and physical devices fine but...我可以很好地部署到模拟器和物理设备,但是......

Trying to the archive on debug mode (Just to get the errors), fails and does not show any error.尝试在调试模式下存档(只是为了获取错误),失败并且不显示任何错误。

archiving in the release mode throws the following errors:在发布模式下归档会引发以下错误:

1. 1.

Severity Code Description Project File Line Suppression State Error APT2260 resource mipmap/kigoo_round (aka com.companyname.kigoopcmauisimple:mipmap/kigoo_round) not found.严重性代码 描述 项目文件行抑制 State 错误 APT2260 资源 mipmap/kigoo_round(又名 com.companyname.kigoopcmauisimple:mipmap/kigoo_round)未找到。 This error is likely caused by an issue with the AndroidManifest.xml file or an Android manifest generation attribute in a source code file.此错误可能是由 AndroidManifest.xml 文件或源代码文件中的 Android 清单生成属性的问题引起的。 KigooPCMauiSimple C:\Users{path} 1 KigooPCMauiSimple C:\Users{path} 1

Severity Code Description Project File Line Suppression State Error APT2260 resource mipmap/kigoo (aka com.companyname.kigoopcmauisimple:mipmap/kigoo) not found.严重性代码 描述 项目文件行抑制 State 错误 APT2260 资源 mipmap/kigoo(又名 com.companyname.kigoopcmauisimple:mipmap/kigoo)未找到。 This error is likely caused by an issue with the AndroidManifest.xml file or an Android manifest generation attribute in a source code file.此错误可能是由 AndroidManifest.xml 文件或源代码文件中的 Android 清单生成属性的问题引起的。 KigooPCMauiSimple KigooPCMauiSimple
C:\Users{path} 1 C:\用户{路径} 1

Severity Code Description Project File Line Suppression State Error APT2067 failed processing manifest.严重性代码 描述 项目文件行抑制 State 错误 APT2067 处理清单失败。 KigooPCMauiSimple C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\32.0.448\tools\Xamarin.Android.Aapt2.targets 212 KigooPCMauiSimple C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\32.0.448\tools\Xamarin.Android.Aapt2.targets 212

Please advise, I appreciate it.请指教,我很感激。

I have tested it.我已经测试过了。 You may need to make the following changes in the project.csprog:您可能需要在 project.csprog 中进行以下更改:

 <MauiIcon Include="Resources\AppIcon\kigoo.svg" 
 ForegroundFile="Resources\AppIcon\appicon.svg" ForegroundScale="0.65" 
 Color="#512BD4"/>

This is because in your Android Manifest file, you have set it like this:这是因为在您的 Android 清单文件中,您已将其设置为:

 android: icon="@mipmap/kigoo"

So in your project.csprog file, behind MauiIcon.Include attribute, it should also be set accordingly like this:所以在你的 project.csprog 文件中,在 MauiIcon.Include 属性后面,它也应该像这样设置:

 <MauiIcon Include="Resources\AppIcon\kigoo.svg"/>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM