Drjacky/Avocado

Can't use for some reason

Closed this issue · 20 comments

I wanted to see if this plugin can help to optimize some VectorDrawable files of Android projects inside Android Studio.

I tried to install and use this plugin but it doesn't seem to do anything and even show if there was an error:
alexjlockwood/avocado#45

Was told to install Node, and so I tried to install it from here, including all that it provides (waited for about half an hour to install all extras of it):

https://nodejs.org/en/download/

Here are the recent apps that were updated/installed:

image

What have I done wrong?

What do you get when you run this command in your command prompt: node --version

@Drjacky I get this:

v20.10.0

Can you try the attached exe file in your command prompt like: \path\to\avocado.exe --version and let me know if it works for you?
avocado.zip

@Drjacky I got this:

PS C:\Users\User\Desktop\avocado> .\avocado.exe --version
Program 'avocado.exe' failed to run: The specified executable is not a valid application for this OS platform.At
line:1 char:1
+ .\avocado.exe --version
+ ~~~~~~~~~~~~~~~~~~~~~~~.
At line:1 char:1
+ .\avocado.exe --version
+ ~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (:) [], ApplicationFailedException
    + FullyQualifiedErrorId : NativeCommandFailed

I should mention that the OS is Windows 11 home.

Could you please to the latest node? https://nodejs.org/dist/v21.4.0/node-v21.4.0-x64.msi
and also, is this a 64-bit or 32-bit windows machine?

and the User in C:\Users\User\... is a sample name for the comment, right? in your side, it's your actual username, right?

I installed this one before:

https://nodejs.org/dist/v20.10.0/node-v20.10.0-x64.msi

How come you've found a newer one? It says on the website that latest is "20.10.0 (includes npm 10.2.3)".
It is a 64bit PC. And it's the user name.

Anyway, tried again the plugin on Android Studio, and nothing happens.
Maybe I try on some VectorDrawable file that can't be optimized? Can you please offer a sample that it should be able to do anything?
Also, what should happen for a file it can't optimize? Does it show some message?

Can you please offer a sample that it should be able to do anything?

App Icon on any new created project is a good example.

The vector should be under drawable or drawanle-... folder.

Does it show some message?

Not in this version

@AndroidDeveloperLB Can you try this attached exe in your command prompt like: avocado.exe --version and let me know if it works this time?
avocado.zip

Running the command it shows "1.0.0". But what do I do with this? Isn't it supposed to be installed in the IDE as a plugin ? I'm supposed to use this file somewhere?

As for a sample file using a new project, still nothing happens there.

Running the command it shows "1.0.0". But what do I do with this? Isn't it supposed to be installed in the IDE as a plugin ? I'm supposed to use this file somewhere?

As for a sample file using a new project, still nothing happens there.

No, it's just for helping me to debug the plugin on a Windows machine. I appreciate your patience!

Hopefully, it will be fixed by 2.0.1; It is not yet released on the JetBrains Marketplace though.

The plugin has been released. I close this issue; feel free to comment if it still doesn't work.

@Drjacky I think it works, but it seems as if the IDE isn't aware of what's going on, so there is no progress, and after it's done, I need to re-open the file to get the new content. Watch:

studio64_2023-12-25_16-42-11.mp4

I have some questions:

  1. Possible to set it to run on all/multi-selection? Maybe via Lint?
  2. How reliable is it? Is it promised to have exact same visual output as original? If not, is there a way to compare before&after, to see if it's ok?
  3. If I want to use this on another PC, what are the minimal steps? I think I've installed more than I needed for this...
  1. Possible to set it to run on all/multi-selection? Maybe via Lint?

In the next version(s), I'll add optimize all the vectors in a directory.

  1. How reliable is it? Is it promised to have exact same visual output as original? If not, is there a way to compare before&after, to see if it's ok?

I have used the exact application from alexjlockwood/avocado; but have not used all it features yet as I wanted to make sure it works on a Windows as well.

  1. If I want to use this on another PC, what are the minimal steps? I think I've installed more than I needed for this...

There is no need to install NodeJS on the machine anymore. I'm going to edit the readme file in the next release.

the IDE isn't aware of what's going on, so there is no progress, and after it's done, I need to re-open the file to get the new content.

I'm aware of this. It's an IDE performance issue. I need to find a way to force the file to be refreshed.


Thanks for let me know

@Drjacky

  1. Maybe possible via Lint too? Meaning Code-analyze , so that we could choose the scope of where to find places to optimize?
  2. But can it be trusted to have same visual content?
  3. Thank you!
  4. ok. Maybe have a progress bar somewhere, at least?

the IDE isn't aware of what's going on, so there is no progress, and after it's done, I need to re-open the file to get the new content.

This has been fixed on 3.2.2.

@Drjacky
My notes about 3.2.2:

  1. Now it gets updated on its own. No progress shown, but at least it's relatively quick.
  2. It formats the content not according to my setting. I need to re-format it after it does it.
  3. I got low-memory message. Wonder if it's related. I went over multiple files.

My notes about 3.2.2:

  1. Now it gets updated on its own. No progress shown, but at least it's relatively quick.
  2. It formats the content not according to my setting. I need to re-format it after it does it.
  3. I got low-memory message. Wonder if it's related. I went over multiple files.

Please open a new issue mentioning these. This one is getting longer and contains different issues. Thanks!