6

I just imported my project in Android-studio and trying to create a new Activity in it. But I can't create an Activity in android-studio. I refer here and I can't see the option of Mark Directory As and it shows an UOE in Event Log as

Error message : UnsupportedOperationException: isDirectory is not implemented: isDirectory is not implemented.

After updating my android-studio only I has this problem

Community
  • 1
  • 1
No_Rulz
  • 2,679
  • 1
  • 20
  • 33

3 Answers3

2

Seems to be a recent bug in IntelliJ introduced in EAP 13, fixed in EAP 13.1. Check if an update is generally available for your platform and upgrade again.

Pedantic
  • 5,032
  • 2
  • 24
  • 37
  • Android Studio doesn't have the Mark Directory As option. It never worked correctly for Gradle-based projects and has been removed until it can be reimplemented the right way. – Scott Barta Mar 07 '14 at 17:28
  • I have no idea what you mean by "Mark Directory As" but since you linked to the IntelliJ bug report in the AOSP tracker maybe you can update your answer with some more details? – Pedantic Mar 11 '14 at 05:47
2

It is bug in Android Studio 0.5.1, I also faced same issue after upgrading to 0.5.1

This is a bug in IntelliJ which was merged into the subsequent EAP build. It'll be available in AS 0.5.2. Until then, the workaround is to copy over an existing file.

You can see this google thread http://code.google.com/p/android/issues/detail?id=66818

Update

Now, update your Android Studio to 0.5.2, it is working perfectly.

Ajay S
  • 48,003
  • 27
  • 91
  • 111
0

In the Project view, if you right-click on a Java package name and choose New > Activity, you can create an activity in that package:

Screen shot showing Project view, with context menu on Java package open

This works properly for me in 0.5.0.

Scott Barta
  • 79,344
  • 24
  • 180
  • 163
  • If i select the option of Activity then it recreate a new application in src directory – No_Rulz Mar 08 '14 at 08:30
  • It doesn't create a new application, just a new activity. – Scott Barta Mar 08 '14 at 14:57
  • nope I tried by choosing Activity inside my package it recreate my ApplicationName inside my package – No_Rulz Mar 10 '14 at 05:53
  • but anyway thanks for your help today again I updated my android-studio and now I can see Java class option while right clicking in my package name thanks dude but I can't find out the problem why it didn't show the option on 2 days before :) – No_Rulz Mar 10 '14 at 05:56