2015-04-29 71 views
3

首先这是我的第一个应用程序,并且第一次使用Android Studio,所以我希望这只是我还不明白的一件小事。Android Studio的建立错误

这是我的错误信息;

AGPBI: {"kind":"ERROR","text":"No resource found that matches the given name (at \u0027icon\u0027 with value \[email protected]/ic_launcher\u0027).","sourcePath":"C:\\Users\\Matt\\AndroidStudioProjects\\FirstApp\\app\\build\\intermediates\\manifests\\full\\debug\\AndroidManifest.xml","position":{"startLine":13,"startColumn":23,"startOffset":385,"endColumn":42,"endOffset":404},"original":""} 


FAILED 

FAILURE: Build failed with an exception. 

* What went wrong: 
Execution failed for task ':app:processDebugResources'. 
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\Matt\AppData\Local\Android\sdk\build-tools\21.1.2\aapt.exe'' finished with non-zero exit value 1 

这是关于清单XML代码:

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
package="com.example.matt.firstapp" > 

<application 
    android:allowBackup="true" 
    android:icon="@mipmap/ic_launcher" 
    android:label="@string/app_name" 
    android:theme="@style/AppTheme" > 
    <activity 
     android:name=".MainActivity" 
     android:label="@string/app_name" > 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 

      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
    </activity> 
</application> 

</manifest> 

随着线路7上的下面的错误消息; (Ctrl + F1) 验证Android XML文件内的资源引用。

我已经安装的Android 21.1.2:

​​

感谢您的帮助!

+0

如果您可以发布您的AndroidManfiest.xml的内容 – Lolo

回答

2

Unicode转义符号\u0027代表引号字符。因此,从错误消息看来,您的AndroidManifest.xml中有一些类似于'icon' = '@mipmap/ic_launcher'的东西,我猜它应该更像android:icon="@mipmap/ic_launcher"

+0

,这将是更容易回答这是行; 机器人:图标= “@纹理贴图/ ic_launcher” 无法解析符号 '@纹理贴图/ ic_launcher' 少...(按Ctrl + F1) 内Android的XML文件void验证资源引用 – mattz330

+0

烨。应该参考'@ drawable /' – Kottary

+0

@Matthew你真的有'app/src/main/res'下的一组文件夹'mipmap-mdpi','mipmap-hdpi'等等......?其中至少有一个应该有一个'ic_launcher.png'文件。 – Lolo