Bad Loser
Bad Loser

Reputation: 3155

Why does Android Drawable Importer ignore selection in AS 3.5 onwards

After right-click --> new Batch Drawable Import and selecting any .png from the Select Image Asset(s) box, the primary Batch Drawable Importer box remains empty (ie: the selection was ignored!).

First 2 lines of Event Log:

java.lang.NoSuchMethodError: org.jetbrains.android.facet.AndroidFacet.getAllResourceDirectories()Ljava/util/List;
    at de.mprengemann.intellij.plugin.androidicons.util.AndroidFacetUtils.getResourcesRoot(AndroidFacetUtils.java:48)

So apparently Android Drawable Importer is fundamentally broken under the more recent AS / intellij versions.

I downloaded and re-installed android-drawable-importer-intellij-plugin-0.5-81.zip to no effect. This plugin was last built in 2016.

This leaves me stuck, because the new Android Studio Resource Manager Import Drawables function does not allow me to pick an external 256x256 .png and then automatically resize for mdpi, hdpi, xdhpi etc.

I have noted the issue (see comment).

Any circumventions or alternatives?

Upvotes: 20

Views: 4771

Answers (2)

Mat
Mat

Reputation: 26

For recent Android Studio Versions (tested with 2022.1.1) you can batch import drawables with the built in Resource Manager: View > Tool Windows > Resource Manager On the + Icon you find "Import Drawables"

Source: https://developer.android.com/studio/write/resource-manager

Upvotes: 0

Bad Loser
Bad Loser

Reputation: 3155

There were multiple issues preventing operation of this plugin in later releases of Android Studio.

Update: December 2022

Forked, fixed and tested under Android Studio Dolphin.

Download the plugin installation zip from here.

( AS -> Settings -> Plugins -> Install from disk )

Tip: Uninstall the old version beforehand.

Upvotes: 36

Related Questions