Can anyone please explain why the draw9patch isn't on my computer despite ADT and all? A search after the jar-file doesn't give any result.
I believed it should be installed by default. AFAIK, nobody else has had this problem.
Can anyone help? I've tried making 9 patches on my own using Paint.NET by adding one black pixel to the left and top of the image, but as I am new to Android, I can't make it work. I even tried a utility called better9patch to no avail. I am getting quite frustrated right now as I think the graphics of a program should be the least of your concern when programming.
Infact, the popular draw9patch application is now available as a feature in the android studio application itself. If you try to open any files with a .9.png extension in your project, it will be opened in a 9 patch drawer perspective. Here is a screenshot.
You should download "draw9patch" folowing this link: https://androidstudio.io/downloads/tools/download-the-latest-version-of-draw9patch.jar.html.
Afterwards you extract the file and it will work.
open up your terminal navigate to sdk/tools. and type
chmod +x draw9patch
./draw9patch
hope it can fixed.
You can use Android Asset Studio
Simple nine-patch generator. This is web application.
A collection of tools to easily generate assets such as launcher icons
for your Android app.
Project page: https://romannurik.github.io/AndroidAssetStudio/
The program should be under android-sdk/tools/draw9patch. If you want to create the image manually, you need 1px-wide transparent border all around the image with black dots on those empty spaces to denote patches
Related
Not sure where to post this issue I have with Android Studio IDE, I hope it can be answered here.
When I open the Asset Studio in Android Studio by right clicking on my Android Module and selecting new -> Image Asset I cannot get past the first screen. Even when I leave this default, when I try and press next the Asset Window start shaking shortly after a second or two.
I encountered this problem with a prior version of Android Stuido but an update to the latest version did not help.
I tried updating the android SDK and build tools since they are obviously related but without success.
I tried restarting Android Studio but the "bug" still remains.
Perhaps I am doing something wrong, I created a video of my workflow and the issue I am encountering.
I had the same problem.
In the Legacy tab, I set the Google Play Store Icon to No and I could pass the first screen.
I had exactly the same problem while I was trying to create adaptive icon from vector graphics.
What helped me was that I need to set Size to 108 dp x 108 dp when I imported Vector Asset (res -> right click -> New -> Vector Asset).
I have faced the same issue with vectors that had a dashed line. Android Studio doesn't support dashed-strokes by default. You can check what is not supported in this link Dashes stroke-dasharray in Android Vector. So in such cases Android Studio just doesn't show any error upfront.
In your case I see its happening even for normal vectors.
To check why its failing notice every time it fails the exclamation mark at the extreme bottom right of Android Studio turns red and flashes. Just close pop up window of Android Studio and click on the red exclamation mark. It will give you the reason why its failing. Although there was nothing much I could do about it maybe you can figure out whats wrong.
I know it's been answered but here's another thing that might fix someone else's problem when adding an asset and getting the weird shaky window error: check the asset dimensions you're importing.
I was trying to add a Vector Asset with dimensions about 23dp x 1077dp (really big height and small width), and for some reason Android Studio didn't accept it. After changing it to a dimension bigger than 170dp x 8137.3dp (it scales automatically) it worked. Then I went on the .xml file and changed it to a dimension I wanted, preserving the proportion of mostly 200dp in width or height as prompted by Lint in a warning.
I don't really know why it worked but I managed to add the asset. If anyone knows it, feel free to explain.
Steps:
1) Have you tried setting it manually through file explorer/directories etc.?
2) Maybe try a drawable importer? Like this.
3) Have a look at this answer, it might help.
4) Try completely uninstalling Android Studio, re-download and install again, if all else fails.
As per your project structure, I believe this is not a native application.
That's right, Flutter projects are not Android projects. Many Android tools are enabled only for projects that have an Android facet. Adding that to Flutter projects causes many problems, so we don't do that and this functionality available for only in native android application.
Furthermore,If you want to use may be it'll help you.
Open android studio File->Open folder->navigate to your flutter project and select the Android folder. Wait for it to sync, then navigate inside the Android studio folder and find the res folder right click on it and choose New you will see the Image asset studio.
This happened to me and the problem was that the dimensions of my source image were too small, which I think is the takeaway from all the other answers as well.
In my case the issue was caused by some unusual project structure, including some source directories added manually within the module.
The only solution was to create a new sample project in Android Studio, use the Asset Editor, generate all the assets to finally copy those to my "unusual" project.
One could also read the IDE (Android Studio) logs to see exception that are being thrown when the editor windows shakes as it's described by the Author of this thread.
After updating Android studio to version 3.1.2 an issue popped up where the preview image is, pixelated/blurry. Can anyone help me fix this issue?
This is how the image is rendered
I have encountered the same problem in Android Studio 3.3 but fortunately I've managed to find a solution. You have to go to "Help" and click on "Edit Custom Properties". It might ask you to generate a file if it doesn't already exist. Once this properties file is made, you will need to write "hidpi=false" (no quotations). Save it and restart Android Studio. When you open it again , you still need to do one thing: go to File then Settings, type font in search box, select font from editor then change the size of font to 15. (or what ever size you prefer). That's all.
I'm not sure weather it will work for your scenario. I had a issue with icon pixels and I followed this.
I hope it will help you.
Create a drawable-xxhdpi directory and add all your images in that and try.
NOTE : I'm not sure that this process helps you or not.
link help you to create drawable-xxhdpi directory
I'm having the same problem and it is somehow annoying i opened a bug ticket and i will wait for there response here is the ticket link : https://issuetracker.google.com/110463869
I solve this problem pretty easy after learning documentation.
You need to change your scale display parameter. Because Android Studio supports only certain scale. Use 100% or 200% and your design tab in Android will be sharp again
Choose "answer is useful" mark)) if it helps you.
i recently started the android tutorial from android.com, after downloading and installing Android Studio and the sdk. I made the first app and all, working directory is on a Flashdrive, Android Studio and sdk are on the HDD.
I'm currently stuck at the "Adding action bar buttons" tutorial, as android studio doesnt find "#drawable/ic_action_search".
I understand that it should be in the MyfirstApp/app/src/res/drawable- folders, but those are practically empty (see picture below).
I did find an answer on here that states to simply copy the required drawables from sdk/platforms/android-/data/res/drawables-.
Another one states, I can adress "standard" pictures (like the search action icon in my case) by using "#android:drawable/ic_action_search", but that doesnt work at all.
Is there a good workaround, easier then putting every icon in every corresponding folder, every time i need one? The tutorial doesnt have that, it seems the guy writing the tutorial relied on the icons just being there?
(May solve itself with 1.)
In that other folder, there are many, many drawables, but the one folder I searched (drawable-hdpi) doesnt even have an icon called ic_action_search.png so...where do I usually get that?
Thanks for helping, I'm still hoping this is a common mistake so there's an easy solution here^^
Edit: manually starting the gradle build task doesn't work either, same problem.
()
Does your project build? Try running the gradle build task manually.
screenshot
I have a question regarding Android 9 patch. Basically when I click and open the 9Patch tool, the screen went blank and can never start. I have tried to drag a picture into it, and it just crashes. Things I have tried are:
re-download Android SDK and re-install
re-start my computer
I am sure I have downloaded the correct version of Android SDK, so my guess is maybe it has nothing to do with Android, but settings in my computer, but I don't know where and how to fix it. So any suggestions and advices are welcome!! Thanks!
This seems to be a known problem on Mac.
https://code.google.com/p/android/issues/detail?id=57473&can=1&q=draw9patch&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars
There seems to be a patch available from Apple which should fix this problem.
Also, check this thread.
draw9patch just hangs on Mac 10.7.5
Try to use Android Asset Studio
This link presents Icon generators and Simple nine-patch generator. it's very simple.
In this linked image , I see the button on the right quite often in a lot of apps. On my Moto Droid, it is used extensively in the settings app. It is also used as the default AlertDialog icon. Can I use this via a android.r.drawable?
The icon is built-in with the Android development, you can access the image by using R.drawable.ic_dialog_menu_generic
While it may be possible to use it via android.R.drawable, you may want to find the image in the resources that come with your SDK ($ANDROID_HOME/platforms/$VERSION/data/res, where $ANDROID_HOME is where you have the SDK installed and $VERSION is a relevant Android API level). So, per Mr. Forloney's answer, you'll find that in, say, drawable-hdpi/ic_dialog_menu_generic.png in the aforementioned directory. Then, copy that image into your project. While it will add 5K to your project size, it will mean that the icon does not change based upon OEM or Android changes.