Pawel Cioch
Pawel Cioch

Reputation: 3184

How to add new activity to existing project in Android Studio - "Project not ready"

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"

project not ready menu sample

Upvotes: 6

Views: 6485

Answers (5)

cfl
cfl

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
enter image description here

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 enter image description here

Upvotes: 4

NoviceCoder
NoviceCoder

Reputation: 59

I had the same issue. I fixed it by clearing the cache. (File > Invalidate caches & Restart).

Upvotes: -1

h8MyJob
h8MyJob

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

  • Cleaning the project (Build --> Clean Project)
  • Sync with Gradle ( Tools --> Android --> Sync project with Gradle files)

Upvotes: 5

unknown_seagull
unknown_seagull

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

Pawel Cioch
Pawel Cioch

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

Related Questions