38

This:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="de.androidbuch.rechner"
  android:versionCode="1"
  android:versionName="1.0">

  <uses-sdk android:minSdkVersion="7"></uses-sdk>
<application android:icon="@drawable/icon" android:label="@string/app_name"
android:theme="@android:style/Theme.Light">

    <activity android:name=".FormularActivity"
        android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

is my AndroidManifest.xml and in lines 8 & 11 I get the error:

no resource found that matches the given name(at "label" with value "@string/app_name")

no resource found that matches the given name(at "label" with value "@string/app_name")

This is really strange and I did not move the values Folder anywhere.

8 Answers 8

58

Did you check to ensure that you have the string resource defined in res/values/strings.xml?

<string name="app_name">"My App"</string>

Sometimes, I've noticed eclipse will also throw errors that are hard to track if you have any .xml files with errors. I don't think the parser recovers well and sometimes the errors you get can be misleading.

2
  • 1
    oh man i am so stupid sometimes! thanks a lot! that file didn't even exist in my program :)
    – sam
    Jan 19, 2011 at 14:56
  • this file doesn't exist in my project either. Could you provide more details how to fix this error? I creates strings.xml and put in the code-line above which sadly is giving me an error by itself. Is there more to add to this file? Aug 26, 2013 at 10:36
2

FIXED

You need to add missing string resources like this:

enter image description here

1

One Reason Can Be as in my case a bug in the string GUI when you add and delete items in some sequence

solution: simply open the strings.xml in the XML mode not GUI you will find it different and has obvious not valid extra texts pasted around or at the beginning ; although it does not give an error on the file strings.xml fix them and then clean and run

1

I also had the same error with my images .. Just rename the extension from ".png" or whatever you have to ".jpg" then they work fine after cleaning the project and re compiling it.

0

Just add the above line "config.xml" inside. Bottom of platform android. Working perfectly. After many hours I got this solution.

Enjoy your coding...

0

The fix for this is to make sure your Cordova CLI is updated to the latest, then start a new app (or re-add the android platform).

npm i -g cordova@latest

THEN:

ionic cordova platform rm android
ionic cordova platform add android

If you plan to use cordova-android 6, these are the changes you'll need to make to your config.xml:

replace this line:

<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">

with this:

<edit-config file="AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">

replace this line:

<resource-file src="resources/android/xml/network_security_config.xml" target="app/src/main/res/xml/network_security_config.xml" />

with this:

<resource-file src="resources/android/xml/network_security_config.xml" target="res/xml/network_security_config.xml" />
0

When you place anything in the /app/App_Resources/Android/src/main/res it automatically replaces the default resource that would have been used for the build. This is by design and allows the user to fully override the resource. I agree that the current case leads to unexpected errors during build, but it can be easily fixed by adding the following lines in your strings.xml:

<string name="app_name">__NAME__</string>
<string name="title_activity_kimera">__TITLE_ACTIVITY__</string>
-7

I've had the same problem. Remove "@string" from android:label="@string/app_name" and it will work fine.

android:label="@string/app_name"  ->  android:label="app_name"
2
  • 4
    This will set the title of the activity to be the literal string "app_name", which is probably not what anybody wants.
    – Ashley
    Mar 25, 2015 at 22:40
  • 7
    terrible answer, i must say.
    – Siddharth
    Apr 10, 2015 at 16:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.