Android Studio

时间:2015-04-29 03:36:27

标签: java android build sdk

这是我的第一个应用程序,第一次使用Android Studio,所以我希望它只是一件我不了解的小事。

以下是我的错误消息;

AGPBI: {"kind":"ERROR","text":"No resource found that matches the given name (at \u0027icon\u0027 with value \u0027@mipmap/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

这是Manifest 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行出现以下错误消息; 无法解析符号&#39; @ mipmap / ic_launcher&#39;少...( Ctrl + F1 ) 验证Android XML文件中的资源引用。

我已经安装了android 21.1.2:

android sdk manager, packages and versions

感谢您的帮助!

1 个答案:

答案 0 :(得分:2)

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