Error: No resource found that matches the given name (at 'text' with value - 小众知识

Error: No resource found that matches the given name (at 'text' with value

2014-08-14 16:50:25 苏内容
  标签: error
阅读:4512

错误提示:

Error:(12, 23) No resource found that matches the given name (at 'text' with value '@string/hello2'). Error:(12, 23) Execution failed for task ':app:processDebugResources'. > com.android.ide.common.internal.LoggedErrorException: Failed to run command: C:\Program Files (x86)\Android\android-studio\sdk\build-tools\android-4.4W\aapt.exe package -f --no-crunch -I C:\Program Files (x86)\Android\android-studio\sdk\platforms\android-20\android.jar -M D:\Git\Android\HelloWorld\app\build\intermediates\manifests\debug\AndroidManifest.xml -S D:\Git\Android\HelloWorld\app\build\intermediates\res\debug -A D:\Git\Android\HelloWorld\app\build\intermediates\assets\debug -m -J D:\Git\Android\HelloWorld\app\build\generated\source\r\debug -F D:\Git\Android\HelloWorld\app\build\intermediates\libs\app-debug.ap_ --debug-mode --custom-package org.predream.helloworld -0 apk Error Code: 1 Output: D:\Git\Android\HelloWorld\app\build\intermediates\res\debug\layout\activity_suese.xml:11: error: Error: No resource found that matches the given name (at 'text' with value '@string/hello_worldd').

解决方法:

在/res/values/strings.xml 添加上你问题里面补充的内容就可以了

 

<?xml version="1.0" encoding="utf-8"?>
<resources>

    <string name="hello">这是第一个Activity。</string>
    <string name="hello2">这是第二个Activity。</string>
    <string name="app_name">Examples_03_04</string>

</resources>

扩展阅读
相关阅读
© CopyRight 2010-2021, PREDREAM.ORG, Inc.All Rights Reserved. 京ICP备13045924号-1