gpt4 book ai didi

java - 使用 Android Studio 构建错误

转载 作者:太空狗 更新时间:2023-10-29 13:20:11 26 4
gpt4 key购买 nike

首先这是我的第一个应用程序,也是第一次使用 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

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

我已经安装了 android 21.1.2:

android sdk manager, packages and versions

感谢您的帮助!

最佳答案

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

关于java - 使用 Android Studio 构建错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29933878/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com