Some days ago I change my hard disk, so I need to re-install Android Studio. When I clone my project again some icons don't work (others are shown well). Icons are in right folder (when I have mouse hover the icon's name i can see them) and they are equal (64x64 PNG).
Some previews of the icons appear, other not. So I can't start app because the icons that don't appear are null. I don't know what happened when I install again Android Studio, because app works fine before it.
I tried to add another icon but it also doesn't appear, I tried to create another project and use the same icon but don't work and I tried to invalidate cache and nothing.
You should check on an android phone if you can download and play the app. If the problem is only with the emulator - it does get buggy, so the regular reinstalling the emulator/android studios, restarting your computer, trying to install a different emulator might work.
Otherwise:
The relevant line to look at is:
android:icon="#mipmap/ic_launcher"
This means that the app is going to the 'mipmap' folder inside your directory, and looking for a file named 'ic_launcher' - to display it as the App icon.
You need to make sure this file name exists in the proper folder, and is in the correct format(this guide might help )
How to find the image location folder
If this doesn't help: remember that icons can be displayed at different qualities for different devices (hdpi, mdpi, xhdpi....) so sometimes if you want to make your own icon you need to make sure it fits the requirements (in the above guide)
Have you tried to check if all icons are in the project folder?
"Some previews of the icons appear, other not.", From this statement of yours, means the studio cannot locate it though you can manually see theme by your eyes. This happens sometimes in the studio.
The solution is simple "Just try to reload your image files(replace them with the same files), The ones the studio can't locate".
Also you may have your app is not able to locate an image file from a 'mipmap' folder for API less than 24, you just have to navigate your studio view from Android View to Project View and move your image file from a specified folder to default image folder. ie. from drawable<24> to drawable folder then relocate your file in your code.
Related
I use MacOS High Siearra. My Eclipse IDE version is Oxygen 3(4.3.2). I have a big problem.
I accidentally shrunk my console area and text in the text field (using Command (-)) but now when I turn the screen back on, I close my tabs and when I reopen them the page opens in the smallest size. I have to fix it every time.
Also, I have not been able to make my console screen larger again if using a mouse. I'm glad you helped me. I also thought about reinstalling the IDE, but when I delete it from the application screen and install it again, I still have the same problem. I think I could not delete it with all the system folders. Please help me ... Thanks
These settings are stored in the workspace metadata which on mac is at location:
<your root path>/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings . Remove the intended setting from there and restart eclipse.
For example, my editor settings are in the file org.eclipse.ui.editors.prefs with content:
eclipse.preferences.version=1
lineNumberRuler=true
overviewRuler_migration=migrated_3.1
spellingEnabled=true
I have a probelm when I'm starting a new Android project. I proceed without a problem to the last step, but when I press finish, this error appears:
Sync Android SDKs
The path
'C:\Users\Tom�\AppData\Local\Android\Sdk'
does not refer to an Android SDK.
Android Studio will use its default SDK instead:
'C:\Users\Tomáš\AppData\Local\Android\Sdk'
and will modify the project's local.properties file.
The problem is obviously caused by my user folder, which contains special characters ('á' and 'š'), because it's part of my name (I'm from the Czech Republic). Unfortunately, this folder cannot be renamed.
I have tried to change all the encodings setting to UTF-8, but it did not help at all.
I'll be grateful for every advice.
I can't help you with the localization problem, however I have had a similar issue and I hope that your problem can be resolved in a similar manor.
My advice would therefore be:
Create a new folder in your C:\ drive (name it something without special characters)
Copy and paste both your SDK and android studio to the new folder.
Enter the folder containing android studio and create a new shortcut to "studio64.exe" (for 64-bit. I think that is the right name, but I'm on my phone so I'm not sure)
I would also advice you to create another folder for your android studio projects by following step one above as the special characters may cause issues. (That was my original problem. Most things worked fine, but some were very strange indeed)
I read on another forum that to launch draw9pad from your console, you have to do java -jar draw9patch.jar from the command prompt once youre in sdk. I did that but i still cannot launch the file. Is this tool absolutely necessary for your pictures to scale on different screens? I know that eclipse has these drawable folders that scale your pictures to different dpis or is that not what they do?
Console output: http://imgur.com/YdGLHXr
File skd/tools :http://imgur.com/vOU647L
To answer the first question for a Mac OS or Linux user, simply type sh draw9patch to launch the editor. CommonsWare already answered the second question.
I read on another forum that to launch draw9pad from your console, you have to do java -jar draw9patch.jar from the command prompt once youre in sdk
Please use the draw9patch batch file or shell script found in the tools/ directory of your SDK installation.
I did that but i still cannot launch the file
First, that is because you did not type it in correctly, as you did not include the .jar extension.
Second, that JAR file is not in that directory. You can tell that by looking at the directory contents.
Instructions for running draw9patch can be found in the Android documentation.
Is this tool absolutely necessary for your pictures to scale on different screens?
Quoting the documentation:
A NinePatchDrawable graphic is a stretchable bitmap image, which Android will automatically resize to accommodate the contents of the View in which you have placed it as the background.
Scaling for different screens is not really the role of a nine-patch PNG file. Scaling for different content is. A nine-patch is used as the background for widgets like Button, EditText, and the like.
I tried many methods to fix Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE but until now, I can increase my intern storage memory.
The method I tried:
Right click the root of your Android Project, go to "Run As" then go to "Run Configurations..." locate the "Android Application" node in the tree at the left, then select your project and go to the "Target" tab on the right side of the window look down for the "Additional Emulator Command Line Options" field (sometimes you'll need to make the window larger) and finally paste "-partition-size 1024" there. Click Apply and then Run to use your emulator.
Go to Eclipse's Preferences, then Select “Launch” Add “-partition-size 1024” on the “Default emulator option” field, then click “Apply” and use your emulator as usual.
Open your .Android directory. Usually in your home directory. Then go to avd and then open the directory that has the name of the avd you would like to change.
Now edit the config.ini file and add the following line or modify the following line: disk.dataPartition.size=1024
This all worked for me in Linux.
I used my app to store in external storage by using this:
android:installLocation="preferExternal"
but then I received
Installation error: INSTALL_FAILED_MEDIA_UNAVAILABLE
Error
Installation error: INSTALL_FAILED_MEDIA_UNAVAILABLE
means that your device does not have SD card.
Error
Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE
means that you don't have enough space on device for your app.
You should do next:
Write android:installLocation="auto" and android itself will care where to install your app - internal or external memory.
Be sure that device has enough memory for installing (usually it is more then size of apk).
If your app really need much space - read this guide.
If you use emulator - setup sd card support:
Try with these options, with that configuration I'm able to install one app of 23MB:
Try uninstalling apps that are installed on emulator and not inbuilt. you can also change the size of SD card by editing emulator settings but then it will take time to run your app as that much memory needs to be converted into a mountable partition.
I have also had a similar problem when I run my app. In my Google TV emulator, it does not show USB storage for external storage. Try to increasing the cache memory and ram size in a emulator new hardware.
How to increase virtual memory of emulator:
\\emulator -avd "Emulator Name" -partition-size 500
After that, try to install your apk.
I'm using Eclipse-plugin to develop Android applications on mac.
I've got a project and I followed the steps in 'Android Tools > Export signed Application Package' successfully, but all I end up with is a blank-icon .apk.
Is it supposed to look like that? I've followed the instructions from what I can tell.
And when I transfer it to a phone, it won't execute. It's just reads "Can't use as a valid .apk-file". For the record, the application works just fine in the emulator.
Any help on this please?
did you check taht you have an icon file inside your drawables folder?
drawable
drawable-ldpi
drawable-mdpi
drawable-hdpi
should have it at least in drawable folder but chek every folder just in case the current icon defined un any of those folder is corrupted.
Seems like I've solved the problem... somehow. it just started working for some reason.
I guess the application was signed and zip aligned as aimed for after all.