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.
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 homefield, enter a path with only English letters/numbers, likeD:\Android\GradleCache - Hit
ApplythenOK, and restart Android Studio
2. Clean & Rebuild Your Project
- Click
Build > Clean Projectin 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

