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

Android Studio全新安装后无法构建新项目:mergeDebugResources报错

Hey there, let’s work through this build failure together—this is a super common gotcha when your user folder has special characters, which looks like exactly what’s happening here with your Kevin Meßmer directory showing up as Kevin Me?mer in the error path.

Fix for Android Studio Build Failure (mergeDebugResources/AAPT2 Error)

The core issue here is special characters in your user directory path (like the ß in your name, which got garbled into ?). This messes up Gradle’s cache file paths, leading to all those "file not found" errors and the final mergeDebugResources failure. Here’s how to fix it step by step:

1. Move Gradle’s Cache to a Path Without Special Characters

Gradle uses your user folder’s .gradle directory by default, which is broken here. Let’s point it to a safe location:

  • Open Android Studio, go to File > Settings > Build, Execution, Deployment > Build Tools > Gradle
  • In the Gradle user home field, enter a path with only English letters/numbers, like D:\Android\GradleCache
  • Hit Apply then OK, and restart Android Studio

2. Clean & Rebuild Your Project

  • Click Build > Clean Project in the toolbar to wipe old, corrupted cache files
  • Then click Build > Rebuild Project—this should trigger a fresh build with the new, valid cache path

3. Double-Check Your JDK Path (Just in Case)

If the above steps don’t fix it, make sure your JDK is installed in a path without special characters too, like C:\Program Files\Java\jdk1.8.0_301. Avoid folders with Chinese characters, spaces, or special symbols.

Quick Explanation

AAPT2 (Android’s resource compiler) and Gradle don’t handle non-ASCII characters well in file paths. When your name’s ß got converted to ?, Gradle couldn’t find its cached files, which caused the resource merging step to crash.


内容的提问来源于stack exchange,提问作者Kevin Meßmer

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.22 07:43:41