You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

构建项目报错提示查看日志,如何查找Aapt2日志的位置?

Where to Find AAPT2 Logs When You See "check logs for details"

Hey there, I’ve run into this exact "check logs for details" error with AAPT2 plenty of times—let’s walk through where you can find those logs depending on how you’re building your project.

1. Using Android Studio

  • Build Output Panel: The easiest place to start is the bottom Build tab in Android Studio. Switch to the Build Output view, and you’ll see the full AAPT2 error details right there. If the log is truncated, click the "Toggle view" icon (the expand arrow in the top-right corner of the panel) to see the complete output.
  • Studio’s Local Log Directory: If you need to dig deeper, Android Studio stores logs in a system-specific folder:
    • Windows: C:\Users\<Your Username>\.AndroidStudio<Version>\system\log
    • macOS: ~/Library/Logs/AndroidStudio<Version>
    • Linux: ~/.AndroidStudio<Version>/system/log
      Look for files like idea.log or build.log—they’ll contain AAPT2-related output alongside other IDE logs.

2. Gradle Command Line Builds

When building with commands like ./gradlew assembleDebug, AAPT2 logs print directly to the console by default. If you want to save them to a file for later reference, use the --info flag to capture detailed logs:

./gradlew assembleDebug --info > build_logs.txt

You can then search the build_logs.txt file for "AAPT2" to jump straight to the relevant sections.

Additionally, Gradle generates module-specific logs in your project’s build directory:

  • Check build/reports/ for each module, and look in build/outputs/logs for files like manifest-merger-<Build Variant>.log—these include AAPT2’s manifest processing logs.

3. Standalone AAPT2 Usage

If you’re running AAPT2 directly (not through Gradle or Studio), you can specify a log file path when executing commands:

aapt2 compile --log ./aapt2_errors.txt res/layout/activity_main.xml -o build/res/

If you don’t specify a log path, the output will go straight to your console. In CI environments, this output is usually captured automatically in the CI’s build log history.

Quick Tip

If your error message includes a specific error code or resource name (like "AAPT2: error: resource drawable/icon not found"), search for that exact phrase in the logs—it’ll cut down on time spent sifting through irrelevant content.

内容的提问来源于stack exchange,提问作者Eugene Chumak

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 04:03:56