简体   繁体   English

使用Android Studio构建错误

[英]Build Error with Android Studio

first of this is my first app, and first time using Android Studio, so I am hoping it's just a small thing I don't understand yet. 首先是我的第一个应用程序,第一次使用Android Studio,所以我希望它只是一件我还不了解的小事。

Here are my error messages; 这是我的错误消息;

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

This is the code on the Manifest xml: 这是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>

With the following error message on line 7; 第7行出现以下错误消息; Cannot resolve symbol '@mipmap/ic_launcher' less... ( Ctrl + F1 ) Validates resource references inside Android XML files. 无法解析符号'@ mipmap / ic_launcher'...( Ctrl + F1 )验证Android XML文件中的资源引用。

I already have android 21.1.2 installed: 我已经安装了android 21.1.2:

android sdk经理,包和版本

Thanks for any help! 谢谢你的帮助!

The Unicode escape notation \' stands for a quote character. Unicode转义符号\'代表引号字符。 Thus, from the error message, it looks like you have something similar to 'icon' = '@mipmap/ic_launcher' somewhere in your AndroidManifest.xml, and I'm guessing it should be more like android:icon="@mipmap/ic_launcher" . 因此,从错误消息中,你的AndroidManifest.xml中'icon' = '@mipmap/ic_launcher'某个地方看起来像'icon' = '@mipmap/ic_launcher' ,我猜它应该更像android:icon="@mipmap/ic_launcher"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM