How to set custom icon for extension Logo

How to set custom icon for extension any example

There are two approaches:

  1. Specify a HTTP/HTTPS URL for iconName in the @DesignerComponent annotation. App Inventor will embed the image on the page. If your server goes away though, the icon will fail to load.

  2. Use the aiwebres directory. aiwebres is the App Inventor web resources directory. Create it at the same level as your extension’s Java file (e.g., if you are creating com.example.test.TestExtension, you would put it at components/src/com/example/test/aiwebres). Place your 16x16 px icon in this directory and specify the iconName field of @DesignerComponent to be "aiwebres/icon.png".

    When you build your extension, the icon will be included in the aix file and App Inventor will serve your icon.

1 Like

thanks sir I’ll try

Sir my package name is…
Package.com.uidesign;
And I place icon in
components/src/com/uidesign/aiwebres)
But not showing

Did you specify the iconName in the annotation? What do you see in the ant extensions output?

Aix build success full

Build aix successful but not showing icon I don’t know what I have done wrong. Plz guide me

@varsha_naik show your @DesignerComponent code…

@SimpleObject(external = true)
@DesignerComponent(category = ComponentCategory.EXTENSION, description = " Uidesign Extension developed by varsha", iconName = “aiwebres/sss.png”, nonVisible = true, version = 1)

Please paste the exact output of ant extensions.

Ant extensions build success full

The whole log please, not just whether it was successful or not.

OK ill send tomorrow right now I don’t have my PC sorry

new 1.txt (2.4 KB)

ExternalComponentGenerator:
[mkdir] Created dir: C:\appinventor-sources-master\appinventor\components\build\classes\ExternalComponentGenerator
[mkdir] Created dir: C:\appinventor-sources-master\appinventor\components\build\externalComponents
[mkdir] Created dir: C:\appinventor-sources-master\appinventor\components\build\externalComponents-class
[javac] Compiling 1 source file to C:\appinventor-sources-master\appinventor\components\build\classes\ExternalComponentGenerator
[javac] warning: [options] bootstrap class path not set in conjunction with -source 1.7
[javac] 1 warning
[java]
[java] Extensions : Generating extensions
[java]
[java] Extensions : Generating files [com.Varsha]
[java] Extensions : Skipping missing icon aiwebres/sss.png
[java] Extensions : Copying file com\Varsha\Varsha$1.class
[java] Extensions : Copying file com\Varsha\Varsha$2.class
[java] Extensions : Copying file com\Varsha\Varsha$3.class
[java] Extensions : Copying file com\Varsha\Varsha$4.class
[java] Extensions : Copying file com\Varsha\Varsha$5.class
[java] Extensions : Copying file com\Varsha\Varsha$6.class
[java] Extensions : Copying file com\Varsha\Varsha$7.class
[java] Extensions : Copying file com\Varsha\Varsha$8.class
[java] Extensions : Copying file com\Varsha\Varsha$9.class
[java] Extensions : Copying file com\Varsha\Varsha.class
[java] Extensions : Successfully created com.Varsha build info file
[java] Extensions : Successfully created com.Varsha extension properties file

unjarAllExtensionLibraries:

unjarExtensionLibraries:

jarAllExtensions:

jarExtension:
[jar] Building jar: C:\appinventor-sources-master\appinventor\components\build\externalComponents-class\com.Varsha.jar
[copy] Copying 1 file to C:\appinventor-sources-master\appinventor\components\build\externalComponents\com.Varsha\files
[echo] Generated build file AndroidRuntime.jar [com.Varsha]

dexAllExtensions:

dexExtension:
[java] Picked up _JAVA_OPTIONS: -Xmx1024M
[echo] Dexing extension: com.Varsha

extensions:
[mkdir] Created dir: C:\appinventor-sources-master\appinventor\components\build\extensions

packExtension:
[zip] Building zip: C:\appinventor-sources-master\appinventor\components\build\extensions\com.Varsha.aix

BUILD SUCCESSFUL
Total time: 18 seconds
Picked up _JAVA_OPTIONS: -Xmx1024M

I know but how to resolve this …

I try but same error

1 Like

Try with a logo url instead. (The simplest approach ).

” & " Aren't the same character, try changing them.

Edit: the ” might just be a side effect of pasting it here.

1 Like

This won't work. aiwebres needs to be in the same directory as the Java file as it is looked up relative to the Java file.

@varsha_naik:
Since you're on Windows, see what happens if you replace aiwebres/sss.png with aiwebres\\sss.png.

2 Likes