Rikudou En Sof
Rikudou En Sof

Reputation: 758

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

Android Manifest

<?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

 <!-- 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.

Severity Code Description Project File Line Suppression State Error APT2260 resource mipmap/kigoo_round (aka com.companyname.kigoopcmauisimple:mipmap/kigoo_round) not found. This error is likely caused by an issue with the AndroidManifest.xml file or an Android manifest generation attribute in a source code file. 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. This error is likely caused by an issue with the AndroidManifest.xml file or an Android manifest generation attribute in a source code file. KigooPCMauiSimple
C:\Users{path} 1

Severity Code Description Project File Line Suppression State Error APT2067 failed processing manifest. KigooPCMauiSimple C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\32.0.448\tools\Xamarin.Android.Aapt2.targets 212

Please advise, I appreciate it.

Upvotes: 1

Views: 1682

Answers (1)

Hongxin Sui-MSFT
Hongxin Sui-MSFT

Reputation: 199

I have tested it. You may need to make the following changes in the 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: icon="@mipmap/kigoo"

So in your project.csprog file, behind MauiIcon.Include attribute, it should also be set accordingly like this:

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

Upvotes: 0

Related Questions