Invalid resource directory name for android dimens - android

Hi,I have a dimens resource files with different screen densities,everything worked just fine,I tested it,but suddenly I got an error:
Error: Invalid resource directory name
res\values-(xxxhdpi): Error: Invalid resource directory name
Any advice and suggestion will be greatly appreciated.Thx.

Switch to Project view instead of Android view and remove the parenthesis in the folder. It should only be values-xxxhdpi

You need to create different values folder for different screens.
Then, inside the values directory, you have to place your dimens.

Related

Can not extract resource from com.android.aaptcompiler.ParsedResource#4510599a

enter image description hereResource compilation failed (Failed to compile values resource file E:\AndroidStudioProjects\AuthenticApp2\app\build\intermediates\incremental\debug\mergeDebugResources\merged.dir\values\values.xml. Cause: java.lang.IllegalStateException: Can not extract resource from com.android.aaptcompiler.ParsedResource#4510599a.). Check logs for more details
Find and exchange all ' symbols in your strings.xml or somewhere else in your code with \'
Look into the resources in ids.xml file and comment out each id one by one and try to simulate the emulator. I also had this problem but when I removed the EditText id from the resources of ids.xml, then the issue was resolved.

"AAPT: error: resource not found" when I'm testing

I've written an instrumented test. When I run it I get an error:
/Users/ilamasin/StudioProjects/ecwid/general/build/intermediates/packaged_res/debug/drawable/horizontal_divider_with_padding.xml:6:
AAPT: error: resource dimen/horizontal_divider_thickness (aka
com.ecwid.android.reports.test:dimen/horizontal_divider_thickness) not
found.
It's my drawable in project and it exists. My project runs and works. But test doesn't. Did anyone has this error? I use Junit and Mockito (Sorry for my English)
just go to dimen file and add value to this-:
res->values->dimen and give value to dimen/horizontal_divider_thickness
or go to drawable file and pass value i.e 15dp or 20dp whatever you want to add.

Xamarin Forms Error "invalid resource directory name: /Path/res Icon "res Icon"

Yesterday everything worked fine and the app get build successfully.
But when I want to build the app now, I always get the following error:
invalid resource directory name:
/path/to/project.android/obj/Debug/Ip/26/jl/res Icon "res Icon".
Does somebody know how to fix that?
It seems like you have a space character in the name of your resource file or directory which is not allowed:
"File-based resource names must contain only lowercase a-z, 0-9, or underscore"
I don't know how but this fixed my problem.
Use incremental Android packaging system (aapt2).

How to change android application resource id value

Generally, AAPT is packaging an application with fixed resource id, and the id value is starting with "0x7f".
I want to replace this integer value with other value, like "0x6f" or something.
I found the code line to handle this, and modified the aapt code. (path : /frameworks/base/tools/aapt/)
But, when building an application, I got the build error message like:
/apps/myapps/AndroidManifest.xml:9: error: Error: No resource found that matches the given name (at 'icon' with value '#drawable/ic_launcher_app')."\
Is there any way to solve this build error ?
According to this Android resources dev page you should never modify the R file yourself as it is generated automatically
Caution: You should never modify the R.java file by hand—it is generated by the aapt tool when your project is compiled. Any changes are overridden next time you compile.
That means ic_launcher_app image not in your drawable folder. And also if you change image format manually like .jpg to save as .Png without using any software that AAPT(while compile resources into binary assets) issue will occur.so use proper image formats.

Localization Example Issue

I am testing localization example given on http://developer.android.com/resources/tutorials/localization/index.html. For this i have created android 2.3.3 level 10 application.
There is a step mentioned in the tutorial:
Localize the Images
As shown in Table 2, the application needs six more drawable folders, each containing a flag.png icon. Add the needed icons and folders to your project:
Save this German flag icon as res/drawable-de-rDE/flag.png in the application's project workspace.
For example:
1. Click the link to open the flag image.
2. Save the image in your-workspace/HelloL10N/res/drawable-de-rDE/ .
But in the res folder i have three folders drawable-hdpi, drawable-mdpi and drawable-ldpi.
I know that it is for different screen resolutions. Similarly i have values-dr folder containing strings.xml file.
I have made drawable-hdpi-de-rDE folder for german and similar folders for other languages. But i am getting error:
[2011-04-04 14:34:32 - HelloL10N] (skipping index file 'C:\Documents and Settings\abc\workspace\HelloL10N\res\drawable-hdpi\Thumbs.db')
[2011-04-04 14:34:32 - HelloL10N] C:\Documents and Settings\abc\workspace\HelloL10N\res\values-fr\strings.xml:4: error: Apostrophe not preceded by \ (in Irai-je te comparer au jour d'été?)
[2011-04-04 14:35:14 - HelloL10N] (skipping index file 'C:\Documents and Settings\abc\workspace\HelloL10N\res\drawable-hdpi\Thumbs.db')
[2011-04-04 14:35:14 - HelloL10N] invalid resource directory name: C:\Documents and Settings\abc\workspace\HelloL10N\res/drawable-hdpi-de-rDE
[2011-04-04 14:35:14 - HelloL10N] invalid resource directory name: C:\Documents and Settings\abc\workspace\HelloL10N\res/drawable-hdpi-en-rCA
[2011-04-04 14:35:14 - HelloL10N] invalid resource directory name: C:\Documents and Settings\abc\workspace\HelloL10N\res/drawable-hdpi-fr-rCA
[2011-04-04 14:35:14 - HelloL10N] invalid resource directory name: C:\Documents and Settings\abc\workspace\HelloL10N\res/drawable-hdpi-fr-rFR
[2011-04-04 14:35:14 - HelloL10N] invalid resource directory name: C:\Documents and Settings\abc\workspace\HelloL10N\res/drawable-hdpi-ja-rJP
I am unable to understand the reason for such an issue.
One more thing i am curious to know whether i have to create three resources in place of one for e.g. i have one image file so i have to upload it in drawable-hdpi, drawable-mdpi and drawable-ldpi with different screen resolutions?
Please help me on this
Thanks
Pankaj
To do what you want, you must create folders named like this :
drawable-de-rDE-hdpi,
drawable-de-rDE-mdpi,
drawable-de-rDE-ldpi, ...
I hope will be helpful
use drawable-de-rDE-mdpi instead of drawable-hdpi-de-rDE .
I was experiencing the same problem in another Android example then I deleted those Thumds.db files, and that fixed it.

Categories

Resources