Invalid resource directory name in android - android

I am using android studio, I added gms library in my android project. And after build I got error
Error:Execution failed for task ':app:mergeDebugResources'.
> D:\Android\Mejodo\app\src\main\res\values-11: Error: Invalid resource directory name
I read in other articles that, these folders are for different screen sizes. But I have only three values folders (values, values-11, values-v11), So >=11 version handle with values-11 folder.
But I don't know how to solve it.
Can I delete these folders ?
Please suggest something.

v11 in values-v11 is a qualifier for Android sdk version v11.
Take a look at http://developer.android.com/guide/topics/resources/providing-resources.html.
So I think "values-11" folder is unnecessary and wrong.

Delete all unnecessary folder containing empty folder
Like above "values-11" folder is unnecessary so delete it
After that clean the project.

I had the same error. Indeed values-11 is not a valid name, instead it has to be replaced by values-v11 in order to compile. So basically I would suggest to move anything you had in folder values-11 and move it into the values-v11 one.

Related

Android Studio ic_launcher not found

after have created an icon for the app, android studio is avoiding it when I generate the apk file for release.
error: resource mipmap/ic_launcher (aka com.example.elrestaurante:mipmap/ic_launcher) not found.
error: resource mipmap/ic_launcher_round (aka com.example.elrestaurante:mipmap/ic_launcher_round) not found
My project has a git repo. Something rare happens when I do click over each file generated inside mipmap (this disappear), here you can see the issue. is a git repo conflict?
Here are the files:
I generated the icon from file->new->Image Asset.. and also I tested creating the icon doing right click over the res folder then new->Image Asset.
I will appreciate any idea to fix this problem.
thanks so much,
To be honest, you can delete mipmap and and ic_launcher directory, and then add the Image Asset again, that's what I've always been doing, cause for whatever reason if you add an image asset and another one exist, the previous one is not removed sometimes
Try This
you are put all icons in debug folder remove them from debug folder and put them outside
debug folder assets only work when you are app running in debug bug release time it's getting errors because the app can't find assets
folder structure like this shown in the below image
Check your folder structure where the files are located. As it shows debug, check whether there is debug and main in src folder.

Can't add Resources/layout folder in shared Xamarin project

I'm working on shared project and needed to add Resources/layout folder but this leads me to error about this folder alredy existing.
In my project Resources folder only have Drawable and values subfolders. In actual file system here is also some alternative folders for drawables. But here is no layout folder.
How can I solve this problem?
Maybe it's fine to use different folder name? I can add layout_ folder without errors.
Problem was solved by removing code refering to not existing yet Resource.Layout and rebuilding solution.
Can't tell for sure what's actually solved a problem.

How to create an android library project with no resources

I want to create a library project with just java/Android classes - but no resources. Basically it will contain helpers for IO etc. I have manually deleted the resources etc - the project is here - but I wonder if this can be done out of the box - or is my way not proper
NB: I need Android classes - so creating a regular java project is not an option (?)
Edit : if there is no out of the box way is there any catch in deleting the (edit: contents of the) res/ folder and the support library ? I would appreciate a 1-2-3 procedure
You need to keep project structure, incl. having res/ foder with drawable/ etc, but these folders can be empty. There's no requirement for your library to reference any drawable.
Others suggest it's mandatory for "app icon" but your library does not need any <application> entry in manifest, so it does not need any icon. The same applies to values/ and layout/ folders. Your library project have to have these folders (as required by build process), but having no file in them (so basically keeping them empty) is perfectly fine and valid and meets your requirements.
I believe you should keep all the required folders (including res) but you can leave them empty. Here is a guide for it.
http://developer.android.com/tools/projects/projects-eclipse.html#SettingUpLibraryProject
I believe you cannot delete the res folder completely since the app icon is contained in it. However you can delete the default layout if you do not need it and any other content that is required for the app to work.
If you would like to access the Android classes you will have to create an Android project.
I hope this helps.
I have created a git repository to illustrate - I created a vanilla eclipse android library project (screens) added a git ignore (bin/) and then proceeded to delete unneeded resources (all the contents of the res/ folder) along with libs/ and assets/ and edit the manifest. The changes are in this commit for reference. Cleaning the project removed R.java along.
Will be adding more (.gitattributes and eclipse settings for android) but this is for now.

Androids AppValidator complains a missing drawable-xhdpi folder. Why?

Androids AppValidator complains that a special folder is missing (drawable-xhdpi). The settings in the Manifest are identical to several other projects. I see that error only for one project.
What causes this?
Folder "drawable-xhdpi" does not exist. Create the "drawable-xhdpi" folder inside the "res" folder and add the appropriate drawables to it. Unknown AppValidator problem
Thanks in advance.

Making subfolders in a resource folder

Is it possible to make subfolders in the resource folders in the Android project? I have about 200 images (thumbnails) that I need in my project and I could add them in the drawable-mdpi, but it would be better to not mix these images with the other ones. Something like drawable-mdpi --> thumbs --> all images here.
No this is not allowed. You are only allowed to make folders specified by the android documentation.
The allowed sub folder names are specified in the link. Android generates the R.java based on these structures and putting sub folders can cause errors.
actually, there are mechanisms in place that allow the R.java file to be generated when there are folders with non-standard names in the res folder.
(i ran into this wanting to share a git repo as a submodule of both an iOS and Android project, but not wantint the Android project to pick up files that resided in a folder i designated.)
aapt is the tool that creates the R.java file, and it can be invoked with the --ignore-assets argument. there is a set of defaults for this found in the google source documentation, or a less verbose description simply by invoking aapt from the command-line without any arguments (or --help, which isn't a valid argument, but presents help nevertheless). using the line aapt.ignore.assets=xxx in an ant.properties file in your Android project will accomplish pretty much the same thing, depending upon your needs or preferences.
if you do not have a build.xml or other mechanism that forces usage of ant (which i do not), one of the aapt --ignore-assets defaults is <dir>_*, which means ignore any folders starting with _.
this was my fallback: i created a directory called _iOS_retina and placed all of my #2x files in there. (in Xcode, i can simply pull in resources from wherever they reside). the default invocation of aapt simply ignores it. to further streamline my project, i also updated my .project file to contain a resource filter that ignores this folder, and thus it doesn't take any space in my eclipse environment, either.
<filteredResources>
<filter>
<id>1371429105277</id>
<name></name>
<type>26</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-true-false-_iOS_retina</arguments>
</matcher>
</filter>
</filteredResources>

Categories

Resources