NewUserSO
NewUserSO

Reputation: 211

error running build target module is undefined

I have just installed Android Studio and when I'm trying to build I get this message:

error running build   
target module is undefined

Upvotes: 2

Views: 9269

Answers (5)

Doogle
Doogle

Reputation: 1264

In Android Studio Edit Configuration section look for Android Application. Then in the module select your app name. By default if project is imported this will be DEFAULT. Change this with your app name rebuild the app with gradle build and everything else will be good to go. Hope this helps.

Upvotes: 1

Billy Damdin
Billy Damdin

Reputation: 1

Try to run the gradlew.bat file. This file will try to build your project. When the execution fail will prompt you the version of building tools your sdk miss. Install this version and your project will build.

gradlew.bat calls the environmental variable ANDROID_HOME which has to have as value the path of the android sdk, See from more information, Android Studio Path (ANDROID-HOME) not able to set?

Upvotes: 0

user3102100
user3102100

Reputation: 51

Today I had the same problem, these steps worked for me:

  • Close Android Studio
  • Edit local.properties in project folder, set sdk.dir path to the original android-sdk path which eclipse uses (ie. sdk.dir=c:\Users\Foo\android-sdks)
  • Load project again, a dialog appears which asks if you really want to use the other path, click yes. if it still does not work, then
  • Close Android Studio again
  • Edit local.properties again and set the path back to the original path
  • Load the project again, the dialog appears again, select yes

My project has been loaded correctly now, maybe it will also work for others, weird problem ;-)

Upvotes: 2

Nmc Ins
Nmc Ins

Reputation: 34

Click Help -> Check For Update

Upvotes: 1

dilettante
dilettante

Reputation: 584

  • Go Run -> Edit Configurations...
  • Check Android Application (on the left)
  • Select your project
  • In the General tab slect a module (your app)

That worked for me

Upvotes: 2

Related Questions