no resource found that matches the given name Android 1.6 - android

I've got 'no resource found that matches the given name' but everything is set up correctly.
error: Error: No resource found that matches the given name (at 'text' with value '#string/labReminderClear').
In AndroidManifest.xml:
<application android:label="MyName"
.....
In Strings.xml:
<string name="app_name">MyName</string>
...
<string name="labReminderClear">Clear</string>
What could be wrong?

The project you've mentiond contains errors in strings.xml file. It is connected with % sign used for example in following line (NOTE: there are multiple in that file):
<string name="msgYouHaveASTS">You have %d appointment(s)\n..and %d task(s)</string>
This is due to aapt (Android Asset Packaging Tool) becoming strict and being used for all versions of Android. See detailed explanation in this answer.
If you want to fix the code so that it works correctly, you have to add info about parameters positions. For example line from above should become:
<string name="msgYouHaveASTS">You have %1$d appointment(s)\n..and %2$d task(s)</string>

If you're using Eclipse try using (from menus above):
Project->Clean....
Select project, in which you have problem, to be rebuilt.
If that doesn't help Error Log view might help you nail what is the real issue here. From Eclipse menus choose:
Window->Show view->ErrorLog

Related

Getting Error on Building APK - Android Studio

I am a newbie and trying to build an APK in android studio. Getting the following error
Error : Android Resource Packaging:[Project Name] D:\react-app\Android\App
Error : Android Resource Packaging:[Project Name] src\main\AndroidManifest.xml:45: error:Error:no resource found that matches the given name (at 'label' with value '#string/App_name).
There are approx 9 errors showing.
Please help to resolve the problem.
The possible answer to your mentioned error is make sure
string.xml file under
android/app/src/main/res/values/strings.xml
should look like this
<resources>
<string name="app_name">YOUR_APP_NAME</string>
</resources>

android version condition for largeheap

I'm trying to use largeheap: true in the AndroidManifest file, and I found this answer
Enable android:largeHeap in Android 4, and disable it in Android 2.3
but the problem is I always get the errors
/*/android/app/build/intermediates/manifests/full/debug/AndroidManifest.xml:38:28-41: AAPT: No resource found that matches the given name (at 'largeHeap' with value '#values/bools').
/*/android/app/build/intermediates/manifests/full/debug/AndroidManifest.xml:32: error: Error: No resource found that matches the given name (at 'largeHeap' with value '#values/bools').
I created 2 files bools.xml
first one in */android/app/src/main/res/values/bools.xml
with value <bool name="largeheap">true</bool>
and the 2nd one in */android/app/src/main/res/values-v23/bools.xml with value <bool name="largeheap">false</bool> (for api 23 and above)
not sure what I am missing, why the AndroidManifest won't find the resource to match the line android:largeHeap="#bool/largeheap"
is there anything else I need to do beside the android:largeHeap="#bool/largeheap" in the AndroidManifest file ?
thanks.
According to your error, I can see that android complains about #values/bools and your question is showing another line: android:largeHeap="#bool/largeheap".
I created a new app project and reproduced your case. This worked for me:
Use this in AndroidManifest.xml:
android:largeHeap="#bool/largeheap"
And make sure your bools.xml looks like this:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="largeheap">true</bool>
</resources>
Also try to clean and rebuild your project after that.

Error:(50, 28) No resource found that matches the given name (at 'value' with value '#string/google_maps_key')

I'm making an Android program using Android Studio. After open Android Studio and Gradle process finished, I got
Error:(50, 28) No resource found that matches the given name (at 'value' with value '#string/google_maps_key')".
What is happening? This is the first time I got this error.
Even though this question was a few years ago, I will add an answer for the benefit of others. You should see a file named /src/debug/res/values/google_maps_api.xml (copied below), in that file there are instructions to generate and add maps key. Replace the field
YOUR_KEY_HERE with your key.
To get one, follow this link, follow the directions and press "Create" at the end:
Once you have your key (it starts with "AIza"), replace the "google_maps_key"
string in this file.
-->
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">
YOUR_KEY_HERE
</string>
Do Sync project with gradle files.

First Android Project Errors

I'v just started building my first Android project with eclipse, according to Lynda's course Up and Running with PhoneGap.
When i try to run the project (like the demonstration on Lynda), i get the following error message:
"your project contains error(s), please fix them befor running your application."
Description Resource Path Location Type
error: Error: No resource found that matches the given name (at 'label' with value
'#string/app_name'). AndroidManifest.xml /android_project line 49
Android AAPT Problem error: Error: No resource found that matches the given name (at 'label'
with value '#string/app_name'). AndroidManifest.xml /android_project line 52 Android
AAPT Problem
The import org.apache.cordova cannot be resolved android_project.java
/android_project/src/com/example/android line 23 Java Problem
DroidGap cannot be resolved to a type android_project.java
/android_project/src/com/example/android line 25 Java Problem
The method onCreate(Bundle) of type android_project must override or implement a supertype
method android_project.java /android_project/src/com/example/android line 28 Java
Problem DroidGap cannot be resolved to a type android_project.java
android_project/src/com/example/android line 30 Java Problem
Config cannot be resolved android_project.java /android_project/src/com/example/android
line 32 Java Problem
Attached the error screenshot
I can guess what some of the error messages means, but i don't know how to solve them.
Any suggestion?
I'm using windows 8.
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
Thanks,
Liron
Check your strings.xml inside your project>res>values and add the string values you are going to use in your project.
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<resources>
<string name="app_name">AppName</string>
</resources>
Plus, I think you need to update your .jar file of cordova.
You can download it from the phonegap github repo.
You can find the lib in the lib/android/ folder.
To create a new project, you can use the lilb/andoird/bin/create.bat file.
Don't forget to clean the project.
Hope this helps you.
I think You forgot to set the string values. I havenĀ“t read that tutorial, but there are some strings missin. Check the tutorial, You have to set some strings inside strings.xml in Your res/values folder
EDIT
go to folder inside Your project "res/values" and open strings.xml. Then begin a new line and put
<string name="example_string">This is an example!</string>
The first part "example_string" is the name of the string. This is to refer to this for example inside an xml layout. imagine You have a button in any xml layout:
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/example_button"
android:text="#string/example_string"/> <-- here you refer to that string inside strings.xml
The second part "This is an example" is what will be appear on that button.
But I think it would be better if You learn the basics instead of starting with PhoneGap.
http://developer.android.com/training/basics/firstapp/index.html

Eclipse Android error

Vista 64; Eclipse 3-5-1.
I'm getting this error when I work on main.xml:
ERROR Error: No resource found that matches the given name (at 'text' with value '#string/get_text').
To eliminate variables I've created a new Android Project
Opened main.xml and pasted this in
When I hit save I get the above error in a red X next to the
This is related to a problem mentioned on this site. It's question # is 885009.
My project is set to automatically build.
Add this line in your string.xml
<string name="get_text">SAMPLE</string>

Categories

Resources