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

Android Studio新手遇Gradle构建错误:aaptFriendlyManifestOutputDirectory=null

解决Gradle构建报错:aaptFriendlyManifestOutputDirectory=null

Hey there, sorry to hear you're stuck with this frustrating Gradle build error—let's work through this step by step. I've run into similar null value glitches with Android Studio before, so here are some actionable fixes to get your build back on track:

  • Clean & Rebuild your project
    Start with the basics: head to Build > Clean Project, wait for it to finish, then run Build > Rebuild Project. Corrupted cached build files are often the culprit behind weird null value errors like this, and this step clears them out.

  • Invalidate Caches & Restart Android Studio
    Sometimes Android Studio's internal cache holds onto outdated data that a clean build doesn't fix. Go to File > Invalidate Caches..., check all three available options, then click Invalidate and Restart. This gives Studio a fresh start and often resolves odd build inconsistencies.

  • Check your app-level build.gradle for misconfigurations
    Since the error references the manifest output directory, double-check your app's build.gradle file for any custom settings related to manifest processing. Look for blocks like android { sourceSets { ... } } or manifestPlaceholders—make sure none of these are accidentally setting a null value or pointing to a missing folder. Also, confirm that your compileSdkVersion, targetSdkVersion, and buildToolsVersion are compatible (sticking to the latest stable versions you have installed is a safe bet).

  • Update Gradle & Android Gradle Plugin
    Outdated versions can cause unexpected compatibility issues. Go to File > Project Structure > Project, then check the Gradle Version and Android Gradle Plugin Version dropdowns. Update them to the latest stable recommended versions, then sync your project with File > Sync Project with Gradle Files.

  • Manually delete .gradle and build folders
    If the above steps don't work, try deleting the hidden .gradle folder in your project root, plus the build folders in both the project root and app module. Restart Android Studio afterward and sync the project—this forces Gradle to regenerate all build files from scratch, which can fix persistent cache-related problems.

Give these steps a go in order (start with the quickest ones first!). If you still hit a wall, feel free to share more details like your app-level build.gradle code or your Android Studio version, and I can help dig deeper.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.20 07:54:01