Eclipse Android error - android

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>

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>

System did not generate an Id for my new xml layout and show me same errors

I have 2 problem that I think both of them is for one reason:
When I try to add a new XML layout; that XML fail add successfully but in "Console" show me it:
[2014-05-04 18:41:11 - Example] W/ResourceType( 5804): ResXMLTree_node size 0 is smaller than header size 0x14.
[2014-05-04 18:41:11 - Example] D:\Android\Workspace\Example\res\menu\main.xml:4: error: Error: Resource id cannot be an empty string (at 'actionLayout' with value '#android:layout/').
and I can get resource to it in classes.
In "problem" tab:
Errors: Unparsed aapt error(s)! Check the console for output.
Location: line 1
Type: Android ADT Problem
and I cant solve it
Please same one help me ...
I sorted this out. So for anyone else still on the learning curve with me, the solultion is as noted in my comment. In addition -
aapt = Android Asset Packaging Tool From the Developers Guide - "The Android Asset Packaging Tool (aapt) takes your application resource files, such as the AndroidManifest.xml file and the XML files for your Activities, and compiles them."
The solution for me was simply to delete the error on the 'Problem' window (right click | delete). Then, force a rebuild by rerunning the app. Any remaining problems will now show up and be logged so you can track them down.
Hope this is helpful to others.

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

no resource found that matches the given name Android 1.6

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

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

Categories

Resources