Android Studio运行报错求助:Unknown run configuration type AndroidRunConfigurationType
Hey there, let's work through this frustrating error together—this is a common glitch with straightforward fixes, so let's dive in:
Invalidate Caches & Restart (First Stop!)
This fixes most random Android Studio hiccups, and it's super easy:- Head to
File>Invalidate Caches... - Check all three options:
Clear file system cache and local history,Clear VCS logs,Clear downloaded shared indexes - Click
Invalidate and Restartand let Studio fully reboot. Don't skip the full restart—it matters.
- Head to
Verify Android Plugins Are Enabled
Sometimes the core Android plugins get disabled accidentally (especially after updates):- Open
File>Settings(orAndroid Studio>Settingson Mac) - Go to
Plugins>Installed - Look for Android Support and Android Studio Default Plugin—make sure both are checked. If not, enable them and restart Studio.
- Open
Delete Corrupted Run Configuration Files
If your run config files got messed up, manually removing them can help:- Close Android Studio entirely.
- Navigate to your project's root folder, then go to
.idea>runConfigurations - Delete any files linked to your app's run config (usually named
app.xmlor matching your module name). - Reopen Studio, then recreate the run config: click the dropdown next to the run button >
Edit Configurations>+>Android App> select your module and hit apply.
Reinstall Android Studio (Last Resort)
If nothing else works, your Studio installation might be corrupted:- Uninstall Android Studio completely (back up your projects first!)
- Delete leftover folders:
- Windows:
C:\Users\<YourName>\.AndroidStudio<Version>andC:\Users\<YourName>\.gradle - Mac:
~/Library/Application Support/AndroidStudio<Version>and~/.gradle
- Windows:
- Download the latest version and reinstall.
I’ve seen this error pop up after Studio updates or when moving projects between machines, so these steps should cover most scenarios. Let me know if you run into any roadblocks!
内容的提问来源于stack exchange,提问作者user9713861

