No resource found that matches the given name in Manifest - android

I'm getting this error when trying to build the application. The xml editor did not highlight both error as missing. As the file/string are already there.
android-apt-compiler: [XXX]
D:\private\xxx\android\XXX\src\AndroidManifest.xml:35: error: Error:
No resource found that matches the given name (at 'icon' with value
'#drawable/ic_launcher').
android-apt-compiler: [XXX]
D:\private\xxx\android\XXX\src\AndroidManifest.xml:233: error: Error:
No resource found that matches the given name (at 'value' with value
'#string/FacebookAppID').
The project structure is like this:
ProjectFolder
|-external_lib
|-src
|-src (actual source)
|-res
|-...
I can confirm that both file is already in the project. As I use IntelliJ, I could just Ctrl + click then it open those files for me. However, I'm still getting this error.
I checked with both Google and SO. Most of the issues were about not having the files or storing in different folders. Which I can ensure that it is in the right place alongside hundred other files and strings.
Another issue is about % sign in strings.xml. I tried searching for "%" and nothing is found in the file.
Shutting down IDE and reopen it doesn't help, nor rebuilding the project. How could I get the app to build?

Look for any error message during the resource compilation.
Sometimes, if you have resource filenames containing illegal characters (such as underscores or uppercase letters), the whole process fails almost silently, and the IDE can't find any resources anymore.
I'm not sure that it's what is happening in your case, but I did eventually encounter such issues...

Related

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 fix "No resource found that matches the given name (at 'value' with value '#integer/google_play_services_version')"

I am getting the following error when I build my Android App project in Visual studio 2015.
No resource found that matches the given name (at 'value' with value '#integer/google_play_services_version')
These lines are located under:
obj\Debug\android\manifest\AndroidManifest.xml
There is 3 entires of it inside the AndroidManifest file.
I have downloaded the google play service from the SDK Manager.
Should I reference anything to my solution?
I already has Xamarin.GooglePlayServices.Base, Xamarin.GooglePlayServices.Basement, Xamarin.GooglePlayServices.Maps Referenced.
Thanks.
you have create integer.xml file inside value folder and define your Integer to that place it will solve your problem.
Try doing and a clean all and check that ALL the content under the obj has been deleted and then perform a build all.
If that does not work:
I would try removing the ~GooglePlayServices~ nugets/references and re-add just the Xamarin.GooglePlayServices.Mapsnuget which will bring in the ~Basement and ~Base libraries.
You should end up with a generated manifest that only has one reference to google_play_services_version and that resource should be picked up from Debug/android/XXX/YYYYYY/ZZZZZ/R.java:
i.e.
public static final int google_play_services_version=0x7f070000;
I added several new packages. One of the package is the reason of the error. I have to check one by one and caught the one causing error. Removing that package is all I need to do to resolve the error.

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.

Android - No Resource Found that matches the given name Errors

I am learning android and I have downloaded an open source app named Astrid and was deploying in eclipse. I got the "No resource found that matches the given name"#string/name_hint". I checked the Strings.xml and found that this label was not available in there. There is another file called String-legacy.xml and in that this value is set. Eclipse is not referring to string-legacy.xml and throwing these errors.
I copied the values from strings-legacy.xml and pasted it to strings.xml and this error was removed. I am sure this is not the right approach...there should be some setting for me to tell eclipse to read from string-legacy.xml
anybody have any thoughts on the same, please advice. Thanks
Harry

Running the android in-app billing example aplication

This will probably sound silly but I have no idea how to make the application work.
tutorial for in-app billing
Just like the tutorial says I downloaded the package, I found the files. The problem is there's no project file and I can't get it to work in eclipse.
Anyone used the example app?
I've used it successfully...what seems to be the problem? Once you download the files, bring the project into Eclipse by select "Newn Android Project", "Create project form existing source" and the "Finish." From there, follow the directions regarding changing the package name, etc...
As far as I can determine, the sample Dungeons in-app billing project that I downloaded via Android SDK Manager, does not even compile (this seems to have been fixed, see my comments later in this message..).
As a check, I ran a find command to search for one of the missing resources:
/cygdrive/k/android-sdk-windows/extras/google/play_billing $ find . -name '*.xml' -exec grep edit_payload_title {} \; -print
android:text="#string/edit_payload_title" />
./res/layout/edit_payload.xml
/cygdrive/k/android-sdk-windows/extras/google/play_billing $
As you can see, the resource #string_edit_payload_title is referenced once, but never defined in any of the xml files..
Description Resource Path Location Type
error: Error: No resource found that matches the given name (at 'background' with value '#color/screen_background'). item_row.xml /Dungeons/res/layout line 20 Android AAPT Problem
error: Error: No resource found that matches the given name (at 'background' with value '#color/screen_background'). main.xml /Dungeons/res/layout line 20 Android AAPT Problem
error: Error: No resource found that matches the given name (at 'prompt' with value '#string/select_item'). main.xml /Dungeons/res/layout line 52 Android AAPT Problem
error: Error: No resource found that matches the given name (at 'text' with value '#string/buy'). main.xml /Dungeons/res/layout line 47 Android AAPT Problem
error: Error: No resource found that matches the given name (at 'text' with value '#string/edit_payload_title'). edit_payload.xml /Dungeons/res/layout line 25 Android AAPT Problem
error: Error: No resource found that matches the given name (at 'text' with value '#string/edit_payload'). main.xml /Dungeons/res/layout line 58 Android AAPT Problem
error: Error: No resource found that matches the given name (at 'text' with value '#string/items_for_sale'). main.xml /Dungeons/res/layout line 34 Android AAPT Problem
error: Error: No resource found that matches the given name (at 'text' with value '#string/items_you_own'). main.xml /Dungeons/res/layout line 64 Android AAPT Problem
error: Error: No resource found that matches the given name (at 'text' with value '#string/recent_transactions'). main.xml /Dungeons/res/layout line 80 Android AAPT Problem
error: Error: No resource found that matches the given name (at 'textColor' with value '#color/error_message'). main.xml /Dungeons/res/layout line 28 Android AAPT Problem
** UPDATE ** I just downloaded it again and it seems to be resolved. At least, it builds and deploys now.. And the string definitions seem to be in place now..
/cygdrive/k/android-sdk-windows/extras/google/play_billing $ find . -name '*.xml' -exec grep edit_payload_title {} \; -print
android:text="#string/edit_payload_title" />
./res/layout/edit_payload.xml
<string name="edit_payload_title">Edit the developer payload associated with this purchase</string>
./res/values/strings.xml

Categories

Resources