在Android平台运行libGDX时遇MissingResourceException错误求助
Hey there, let's tackle this frustrating AndroidJpsBundle missing issue you're hitting with your libGDX project. I've seen this error pop up fairly often, and it's almost always tied to IDE caching, version mismatches, or plugin resource glitches. Here are the most reliable fixes to get your app running on Android again:
Clean, rebuild, and invalidate caches (start here!)
This is the first go-to fix for almost all Android Studio build weirdness:- Click
Build > Clean Projectto wipe old build artifacts - Then run
Build > Rebuild Projectto generate fresh files - If that doesn't work, go to
File > Invalidate Caches..., check the "Invalidate and Restart" option, and let Android Studio restart. This clears out corrupted cached data that often causes resource bundle issues.
- Click
Check Android Gradle Plugin (AGP) and Gradle version compatibility
Mismatched AGP and Gradle versions are a common culprit here:- Open your project's root
build.gradlefile - Look for the
com.android.tools.build:gradledependency in thebuildscript > dependenciesblock - Make sure this version is compatible with your project's Gradle version. You can use Android Studio's built-in checker: go to
File > Project Structure > Projectand select a recommended AGP/Gradle version pair from the dropdowns.
- Open your project's root
Switch to Android Studio's Embedded JDK
System-installed JDKs sometimes have compatibility issues with Android Studio's plugins:- Go to
File > Project Structure > SDK Location - Check the box for "Use embedded JDK (recommended)"
- Restart Android Studio to apply the change. This ensures you're using a JDK that's fully tested with your IDE version.
- Go to
Verify libGDX Android module configuration
Double-check that your Android module's setup is consistent:- Open the Android module's
build.gradlefile - Ensure
compileSdkVersionandtargetSdkVersionmatch the Android SDK versions you have installed - Confirm all libGDX dependencies across modules use the same version (use the
gdxVersionvariable in your root build.gradle to keep this unified)
- Open the Android module's
Manually clear Android Studio's plugin cache (last resort)
If all else fails, the IDE's plugin resources might be corrupted:- On Windows: Delete the folder
C:\Users\<YourUsername>\.AndroidStudio<Version>\system\caches - On Mac: Delete
~/Library/Caches/AndroidStudio<Version> - On Linux: Delete
~/.AndroidStudio<Version>/system/caches
Restart Android Studio afterward—it will re-download and regenerate all necessary plugin resources, including the missing AndroidJpsBundle.
- On Windows: Delete the folder
Start with the first couple of steps—cleaning caches and checking version compatibility usually resolves this error quickly. If you're still stuck, work your way through the rest of the list.
内容的提问来源于stack exchange,提问作者sadeghpro

