16

I am newbie in the world of android app development. I was creating a project Example on Android Studio. I have my LunchList.java file in src/main/java/apt.tutorial.lunchlist .Till yesterday Everything was working fine. But when I open android Studio today I got an error saying

"The modules below have been removed from Gradle structure. Check those to be removed from the project too:"

☑ LunchList

☑ LunchList-LunchList

And there is OK and Cancel Button. I don't want to remove them. So I click cancel and proceed.

Then when I tried to run the application in emulator the emulator runs but nothing happens. And I got this error

Waiting for device.

Target device: emulator-5554 (Android)

ERROR: APK path is not specified for module "LunchList-LunchList"

I don't know what went wrong. Please help me.

[Edit: I tried unchecking both of them and click OK. But after that I'm not getting the first error but still getting the second error ]

Community
  • 1
  • 1
Ratan Parai
  • 309
  • 1
  • 2
  • 13
  • Android Studio is not in a great state at the moment. It's still an early beta version. But just like any other IDE, it will have its quirks. I haven't played enough with it yet. But expect there to be issues as you progress with it. – Jay Snayder May 23 '13 at 19:54
  • I am confused about selecting the correct IDE. At first I started with Eclipse but then google announce android studio in Google I/O. So far as a newbie I was enjoying it. – Ratan Parai May 23 '13 at 19:59
  • 1
    Since you are new to android development, I would advise you to use the IntellJ IDEA Community Edition until Android Studio becomes more stable. It could be very frustrating to learn android while constantly struggling with issues in an early release IDE. – free3dom May 24 '13 at 07:47
  • 1
    I am getting this exact issue. For me at least, the project works fine when within the default "AndroidStudioProjects" folder but not if I move it elsewhere. I think I also get this issue if I try to relocate the "AndroidStudioProjects" – Matt Whetton May 29 '13 at 17:57
  • 1
    @MattWhetton adding a symlink from AndroidStudioProjects fixed it for me, but it's a hack. – Charles Munger Jun 07 '13 at 23:43

13 Answers13

13

Exit Android studio. Launch it with Administrator Privilege.
This solved the problem with Android Studio v0.1 in Windows 7.

ridoy
  • 6,274
  • 2
  • 29
  • 60
Jit
  • 131
  • 2
10

I had the same issue, I unselected the 2 files and then received the error

"ERROR: APK path is not specified for module"  

I just restarted Android Studio and reopened the project and then it worked normal again.

It is indeed a bug but there's a simple work around.

Patricia
  • 7,752
  • 4
  • 37
  • 70
Jonas Aarts
  • 101
  • 2
9

Here's what worked for me: delete .idea/ and *.iml files, then open a project again (as gradle project) - all the idea files will be recreated - and everything works fine

ridoy
  • 6,274
  • 2
  • 29
  • 60
huge
  • 123
  • 2
  • 9
    WARNING: This completely broke my project beyond repair... use with caution. –  Sep 07 '13 at 20:33
  • 5
    DO NOT DO THIS! Project is ruined beyond repair. – Chad Bingham Oct 28 '13 at 22:17
  • 1
    This could get some problem, but it's not because you deleted the files and folder. Only if there is a problem with the gradle files from the beginning, will this cause problem with importing the project again. Be sure there is nothing wrong with the gradle files AND THIS IS HARMLESS! – Joakim Engstrom Dec 09 '13 at 12:23
4

I had the same error with IntelliJ CE.

I fixed it by choosing "Inherit project compile output path" in the strong text imodule settings (Paths tab > Compiler output)

ridoy
  • 6,274
  • 2
  • 29
  • 60
Jokahero
  • 1,074
  • 10
  • 21
3

In my case, I imported the same project over again. Android Studio overrode the old settings. Then this error went away!

IgorGanapolsky
  • 26,189
  • 23
  • 116
  • 147
3

this happened when i update to 2.0. i had to change the dependencies in the build.gradle file under src dir not gradle dir. change from

dependencies {
classpath 'com.android.tools.build:gradle:0.4.0'
}

to

dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
cubeloid
  • 149
  • 1
  • 6
2

Not sure how much help this will be, but I saw that same error this morning after updating to Android Studio 0.2.0. First, I needed to modifying my build.gradle file to indicate that the correct gradle plugin to use with my project was version 0.5.0 (rather than 0.4). After modifying build.gradle, I saw the "APK path is not specified for module .." error when attempting to build. I solved this by simply quitting and restarting Android Studio.

Justin Pollard
  • 6,661
  • 1
  • 18
  • 20
1

I had the same issue and found the solution. Stackoverflow Question this is the same way to fix the error

Also lower down in there is "SDKs" i also had to make them match. Name and Build Target. Hope it helps it did me. apparently the IntelliJ is what Android Studio is.

Community
  • 1
  • 1
1

I've found that the issue is usually if you've changed or moved the folder to a different location.

If you open up the .idea folder in AndroidStudio, have a search for any reference to the old location. If you find some, just replace with the new location. It would seem some of the lines are hardcoded.

1

There is a manual "how to move project" here

I moved progect, got your problem, followed this manual, got window like you and choose "OK". And now it works very well.

mario.san
  • 11
  • 1
1

It helped me to set the right SDK... I used the one in Program Files, what did not work!

Then i found out to use the following SDK (set in local.properties):

sdk.dir=C:/Program Files (x86)/Android/android-studio/sdk

Hope this helps...

Martin We
  • 11
  • 1
1

I find this:

http://www.chrisdew.com/blog/2013/07/17/android-studio-nosuchmethoderror-lazystringarraylist/

it is realy help for me.

Thus, in my case, the problem was to have two libraries:

protobuf-2.4.1.jar and new protobuf-2.5.0.jar

it resulted error:

APK path is not specified for module “Example-Example”

To correct this, rename file protobuf-2.4.1.jar to protobuf-2.4.1.jar.disabled

mv protobuf-2.4.1.jar protobuf-2.4.1.jar.disabled

Kozlov V
  • 146
  • 5
  • 17
0

Finally! Updated solution found here:

Android APK path is not specified for module

  • Open Project structure
  • Click on Modules tab
  • Expand your project and click on Android
  • On right side click on Compiler tab
  • Looking for "APK path" field Enter your project root folder, i.e. /Users/bla/project/my.apk Click Apply and Ok
Airon Tark
  • 8,900
  • 4
  • 23
  • 19
Anona112
  • 3,724
  • 4
  • 21
  • 30