PhoneGap Build构建失败:config.xml指定图标缺失问题求助
Hey there, let's work through this error you're facing. I've run into this exact issue multiple times when using PhoneGap Build, so here are targeted fixes to try:
Common Troubleshooting Steps
1. Validate Path Casing and Exact Filenames
PhoneGap Build runs on a Linux environment, which is case-sensitive for file paths. Even a tiny mismatch (like Resources vs resources or Drawable-ldpi-icon.png vs drawable-ldpi-icon.png) will cause the build to fail.
- Open the zip file you're uploading to PhoneGap Build
- Navigate to
resources/android/icon/and confirm every file listed in your config exists with the exact name (e.g.,drawable-ldpi-icon.pngis present, no typos) - Do the same for the splash screen files—your config snippet cuts off, but ensure all
<splash>entries point to existing files
2. Check Zip Package Structure
The root of your uploaded zip must contain your config.xml and the resources folder directly. If you zipped a parent folder (e.g., all your app files are inside a my-project folder), PhoneGap Build will look for my-project/resources/... instead of resources/..., which breaks the paths.
Correct structure example:
my-app.zip/ ├─ config.xml ├─ resources/ │ ├─ android/ │ │ ├─ icon/ │ │ │ ├─ drawable-ldpi-icon.png │ │ │ ├─ ... (other icons) │ │ ├─ splash/ │ │ │ ├─ drawable-port-hdpi-screen.png │ │ │ ├─ ... (other splashes) ├─ www/ │ ├─ ... (your app code)
3. Remove Hidden System Files
Hidden files like .DS_Store (Mac) or Thumbs.db (Windows) can sometimes interfere with PhoneGap Build's file detection.
- Delete all hidden files from your
resourcesfolder and subfolders - Re-zip your app files from scratch, making sure only necessary files are included
4. Test with a Minimal Config
To isolate the issue, create a simplified config.xml with just the Android icon entries (temporarily remove all splash screen lines) and try building again. If it succeeds, add the splash entries one by one to find which file/path is causing the error.
Your Config Reference
For context, here's the Android platform config you shared (formatted):
<platform name="android"> <icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" /> <icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" /> <icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" /> <icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" /> <icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" /> <icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" /> <splash src="resources/android/splash/drawable-port-hdpi-screen.png" /> <splash qualifier="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" /> <splash qualifier="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" /> <splash qualifier="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" /> <splash qualifier="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png" /> <splash qualifier="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png" /> <splash qualifier="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png" /> <splash qualifier="port-ldpi" src="resources/a...
And the error you're seeing:
Error - An icon specified in your config.xml could not be found. Make sure all icons specified in your config.xml exist in your app package.
Start with the path validation and zip structure checks—those are the most common culprits. Let me know if any of these steps resolve your issue!
内容的提问来源于stack exchange,提问作者Daniel Smith

