Recent

Author Topic: [SOLVED] Cannot change launcher icon  (Read 1455 times)

maurobio

  • Hero Member
  • *****
  • Posts: 623
  • Ecology is everything.
    • GitHub
[SOLVED] Cannot change launcher icon
« on: May 21, 2023, 01:34:58 pm »
Dear ALL,

Here is yet another Android newbie question...

I have not been able to change the launcher icon in my app. I go to Project -> Options -> [LAMW] Android Project Options and in the Application tab I change the launcher icon for a custom image (36 x 36), which is correctly displayed. However, when I compile the app and install it on the target device, the standard 'lemur catta' LAMW icon is displayed instead of my own icon.

How can I make my own icon be used as the launcher icon?

Thanks in advance!

With best regards,
« Last Edit: May 21, 2023, 09:36:05 pm by maurobio »
UCSD Pascal / Burroughs 6700 / Master Control Program
Delphi 7.0 Personal Edition
Lazarus 2.0.12 - FPC 3.2.0 on GNU/Linux Mint 19.1, Lubuntu 18.04, Windows XP SP3, Windows 7 Professional, Windows 10 Home

jmpessoa

  • Hero Member
  • *****
  • Posts: 2312
Re: Cannot change launcher icon
« Reply #1 on: May 21, 2023, 07:05:05 pm »
Go to your project folder....   
look for  the folders  " res/drawable*** " and replace  the "ic_launcher.png" collection...
but the file name  of your new icons must continue as "ic_launcher.png"
(some online tools can produce all collection for you...)
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

maurobio

  • Hero Member
  • *****
  • Posts: 623
  • Ecology is everything.
    • GitHub
Re: Cannot change launcher icon
« Reply #2 on: May 21, 2023, 09:35:31 pm »
Hi, @jmpessoa!

Doing it manually? Really? In that case, what use would be the fancy 'Project Options' -> '[LAMW] Android Project Options' interface?

I just discovered that, by choosing the '96x96' size in the Launcher icon dropdown box allows the IDE to automagically create all required versions (in lesser and larger sizes) of the launcher icon!

Living and learning!

With best wishes,
UCSD Pascal / Burroughs 6700 / Master Control Program
Delphi 7.0 Personal Edition
Lazarus 2.0.12 - FPC 3.2.0 on GNU/Linux Mint 19.1, Lubuntu 18.04, Windows XP SP3, Windows 7 Professional, Windows 10 Home

jmpessoa

  • Hero Member
  • *****
  • Posts: 2312
Re: [SOLVED] Cannot change launcher icon
« Reply #3 on: May 22, 2023, 08:29:32 am »
Quote
Living and learning!

well, it looks like i'm already in another phase:  living and forgetting and [maybe] (re)learning...  :-X
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

schumi

  • New Member
  • *
  • Posts: 45
Re: [SOLVED] Cannot change launcher icon
« Reply #4 on: September 14, 2024, 11:46:44 am »
hi,
I have same problem in new app, i have cheched ic_launcher.png in  res/drawable***, but icon don't change
LAMW 0.8.6.4
LAZ 3.0

Guser979

  • Jr. Member
  • **
  • Posts: 64
Re: [SOLVED] Cannot change launcher icon
« Reply #5 on: September 14, 2024, 01:40:45 pm »
In Project\Project Options\Application

Choose the same icon for all sizes shown. Answer yes to resize

Note: The following message may appear when trying to build
> [mipmap-hdpi-v4/ic_launcher] res\mipmap-hdpi\ic_launcher.png [mipmap-hdpi-v4/ic_launcher] \res\mipmap-hdpi\ic_launcher.webp: Error: Duplicate resources

Just delete the .webp versions of ic_launcher from the mipmap folders;

neuro

  • Jr. Member
  • **
  • Posts: 70
Re: [SOLVED] Cannot change launcher icon
« Reply #6 on: September 24, 2024, 03:31:23 am »
Just delete the .webp versions of ic_launcher from the mipmap folders;

Two years ago I have found this workaround solution too.
However this is a bug of LAMW compiler and should be fixed.
.webp versions of ic_launcher should be deleted automatically when changing the icon.

I have reported this bug on July 16, 2022:

Changing of Launcher icon fails to work.

Just create new project and change Launcher icon by going to menu:
Project -> Project Options -> [LAMW] Android project options -> Launcher icon

Then run menu
[LAMW] Build Android Apk and run

The result is:
Quote
Fatal: FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':mergeDebugResources'.
> [mipmap/ic_launcher] D:\AppLAMWProject1\res\mipmap\ic_launcher.png   [mipmap/ic_launcher] D:\AppLAMWProject1\res\mipmap\ic_launcher.webp: Error: Duplicate resources

 

TinyPortal © 2005-2018