Reputation: 3184
What needs to be done to add a new activity to existing project that works and compiles but has "Project not ready" in the menu. Please see the picture.
Other than that all works, so I don't know what IDE means by "Project not ready"
Upvotes: 6
Views: 6485
Reputation: 1049
What I did to solve this was to open up specifically the Android project in a new Android studio instance (not from the flutter project, which has everything)
Note if you don't see the option to do this in your project -> flutter options
Then you can just open the folder containing the project, followed by opening up the Android project specifically from there.
Now you should get the options
Upvotes: 4
Reputation: 59
I had the same issue. I fixed it by clearing the cache. (File > Invalidate caches & Restart).
Upvotes: -1
Reputation: 183
This is a little bit over a year but i thought i would provide an answer for anyone (novice like me) who may encounter the same problem. I had the exact same problem as depicted and denoted. It was fixed by
Upvotes: 5
Reputation: 91
If you want to add a Activity to an android application, you have to Extend Activity from one of your classes like this:
public class SecondActivity extends Activity
And add that activity to your manifest.
<activity
android:name=".ActivitySecondClass"
android:label="@string/app_name2" >
</activity>
You have to give the project time to build first. Wait a minute or two before jumping in.
Upvotes: 0
Reputation: 3184
(Not an exact answer) Observation:
I don't know exactly what happened, but it works now, all I could notice is that gradle had some error from unclean build likely I must have had some code changes resulting in invisible compilation errors. After good build menus available again.
Please post your "observation" if you don't know exact answer.
Thanks
Upvotes: 0