Android Studio 4.0.1新建Java类时类向导消失问题咨询
Hey there! Let's dig into why your Android Studio class wizard isn't showing up with those handy options (like parent class selection, auto-generating onCreate()) after updating to 4.0.1. I've seen this pop up a few times, so here are the most likely fixes:
First: Double-Check Your Creation Path
This is the most common culprit! If you're trying to create an Android component (like an Activity or Fragment) but selecting Java Class instead of the specific component template, you'll only get an empty class file.
- To get the full wizard back: Right-click your target package →
New→ Choose the component type you need (e.g.,Activity→Empty Activity). This will launch the familiar wizard where you can set the parent class, enableonCreate()generation, and more. - If you actually want a plain Java class (not an Android component), the empty class behavior is totally normal—no bug here!
If Path Is Correct: Fix IDE Configuration Issues
If you're definitely using the right component template but still missing the wizard, try these steps to reset or repair your Android Studio setup:
Invalidate Caches & Restart
Corrupted caches often cause weird post-update glitches. Go toFile > Invalidate Caches..., check all the boxes, then clickInvalidate and Restart. Wait for the IDE to rebuild everything—this usually fixes most odd behavior.Restore Default IDE Settings
Sometimes update processes mess up custom settings. Head toFile > Manage IDE Settings > Restore Default Settings(make sure to back up your custom shortcuts or preferences first!). This will reset the IDE to its out-of-the-box state, which should bring the wizard back.Verify Template Files Aren't Corrupted
Android Studio stores component templates in its installation directory (typicallyplugins/android/lib/templates/activitiesfor Activity templates). If these files got damaged during the update, the wizard won't load properly. You can:- Reinstall Android Studio to replace corrupted template files, or
- Copy the template folder from a working instance of Android Studio 4.0.1 (if you have access to one) into your installation directory.
Test with a New Project
If the wizard works in a fresh project but not your current one, the issue is likely with your project's configuration files. Try deleting the .idea folder (back it up first!) and re-syncing your project with Gradle—this often resolves project-specific setup bugs.
内容的提问来源于stack exchange,提问作者Guy Michael

