ANdroid Studio dont let me create Layout-small res folder - android

I already made the layout.xml in the layout folder, but for a small device its not working
than = then =x
and after reading some articles, i must create a layout-small isnt it?
so im trying to do in android studio, it dont allow me saying that it already exist, BUT there is not layout-small folder =/ i should i do?
EDIT*
i already tried to create a folder manually in windows and restart android studio, not working too...
what i saw is that while gradle is building, i show all the folders, but after gradle finishes, it HIDE the folder
Look:
WHILE BUILDING:
AFTER BUILDING:

It may be a little bit stupid, but did you try creating this folder manually using Windows? If it is already, maybe restart Android Studio?
Also Screen Support
Note: Beginning with Android 3.2 (API level 13), these size groups are deprecated in favor of a new technique for managing screen sizes based on the available screen width. If you're developing for Android 3.2 and greater, see Declaring Tablet Layouts for Android 3.2 for more information.

Related

Cannot click next in Asset Studio when creating an icon

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.

Android Studio: My layouts are all gone. What happened?

I had several layouts for various size devices and at each orientation. Somehow, they've all disappeared and only the original layout shows again, no matter which device type or size or orientation I select in Android Studio's renderer.
I've upgraded Android Studio. I've renamed the parent folder the source project and files were in. I've upgraded the sdk. Also, Although my app is not a Gradle project, I did something the IDE kept bugging me to do... I believe I moved something from AndroidManifest to build.gradle.
I don't know which step caused me to lose my layouts, as I didn't notice as I worked on other things.
Does anyone have any idea what I might have done that would cause my layouts to disappear?
Thanks.
They have not disappeared and you have not lost them!
Click on the drop down which I have circled (It probably says Android for you) and choose "Project" view which is what you were used to before the update.

Upgraded eclipse now getting main.xml: NotFoundException: null - Saga continues

I looked up on getting an emulator for a tablet and noticed a suggested that on checking for updates within eclipse , the latest SDK/ADT etc would provide this. At the moment I cannot check this because I am getting the following error on my main.xml file.
error!
NotFoundException: null
Exception details are logged in Window > Show View > Error Log
The following classes could not be found:
- ToggleButton (Change to android.widget.ToggleButton, Fix Build Path, Edit XML)
I have tried the three options it offers and on choosing edit XML nothing appears to show an error.
This project runs under Android 1.6 (wanted to make it as backward compatible as possible) and trying to cope with different screen sizes and orientations . At the moment I have the following layout folders:
layout(empty folder)
layout-large
layout-normal
layout-normal-land
layout-small
layout-xlarge
These all existing before the eclipse/android updates and I never had these errors. I searching the net on these , I read one suggestion of Project->clean (done this) and I then did Project->Build.
I also a suggestion to remove r.java so I have done this and ran clean and build. Still getting the same error. Oddly the code and the xml show no signs of errors apart from the above message appears at the bottom of the designer window for the XML.
The designer is set to 1.6 (API4) so it is not that the designer thinks I am on a different version to my project.
Update 1:
Since moving onto 2.1 - I found that although the layout does not show the error straight away, it then appears if I try and make any changes to it. Also I have updated the images and these do not appear to have changed either.
Update 2:
feco has suggested a reasonable suggestion of moving the build target to 2.1 as only a small percentage of users operate with a 1.6 handset now. I have decided to do this , it is more of a get around than a solution but it will have to do right now.
I had the same problem. I solved it by changing from API4 to API10 (or more) in the "Graphical Layout" window -> upper menu -> Android logo (green robot) at the end

Developoing for android 2.3 and 4.0.3 in a single prject?

Well, lately i've been coding an app using 2.3 emulator, I was mainly testing the app in 2.3.7 phone, but yesterday I updated my phone to android 4.0.3 and the UI looks like shit, in fact, keeps the "bad" looking 2.3 UI.
Now i'm trying to get a nice looking app in both versions of android, the problem is that i don't want to have 2 separate projects an edit both of them, so i want to use one single project and 2 virtual machines for the different versions.
The problem is that if i create a project destinated to 2.3 i can't call to HOLO Theme resources, and if I create a 4.0.3 project it will not even work in android 2.3 right?
so... what do i need to do?
thanks.
You need to set the targetSDKVersion as 15, minSDKVersion as 10.
You need to create various resource folders for these two versions. Example, create a folder 'values-v14' inside 'res' folder and define your widget styles for ICS. Have another folder 'values-v10' and keep your styles for 2.3.3
If required, use the version qualifiers to define separate layout for different versions.
The below links will give you more clear idea.
http://developer.android.com/training/basics/supporting-devices/platforms.html
http://developer.android.com/training/backward-compatible-ui/index.html

Change app from sdk 2.2 to 4.0?

I have made an app using target sdk version 2.2 ,but for newer version I need to implement the same app on android 4.0 .But when i tested on the device it shows small layouts.
I have some questions:
1.Why is it showing small layouts ?
2.How I can change it?
3.Will there be any other problem related to this when I switch to android 4.0.?
Please answer these questions?
For change layout
In your xml editor .there is combobox for resizing layout check
that.
For Change version
Right click on your current project > properties >android > select
version >ok
no problem for changing
If you are using Eclipse, you can change the Android target version quite easily. Project->Properties and then select Android and change the target version (Note: You may need to use the Android SDK manager to install new targets and AVDs).
You shouldn't have any problem going from 2.2 to 4.0 although again you may need a new AVD or device to test your app with.
Not sure what you mean about small layouts...
Layout:
Your layout is probably set to a specific screen size or density. To support multiple screens, create a layout folder under res. You can create layout folders for specific screen sizes and densities. Something like this:
layout
layout_ldpi
layout_mdpi
layout_hdpi
For more info, check this link

Categories

Resources