Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android studio. Module not specified after import

I use android studio. I import example project from official site

http://developer.android.com/training/contacts-provider/retrieve-names.html

When I try Run it I get Edit configuration window with Error: Module not specified.

I read this answer

https://stackoverflow.com/a/16625227/1864033

and mark (in Project structure -> modules) my res/ folder as resources folder and sources folders as sources.

Problem still alive.

Also Project structure -> modules say that .gradle and build is excluded folders.

What means "Module not specify" in android studio case?

like image 488
Stepan Loginov Avatar asked May 25 '14 14:05

Stepan Loginov


3 Answers

Probably you have to update your Android Studio Version and try again. I imported that sample without any issues and it's running fine on the Emulator.

This is my import report from Android Studio:

ECLIPSE ANDROID PROJECT IMPORT SUMMARY

Replaced Jars with Dependencies: -------------------------------- The importer recognized the following .jar files as third party libraries and replaced them with Gradle dependencies instead. This has the advantage that more explicit version information is known, and the libraries can be updated automatically. However, it is possible that the .jar file in your project was of an older version than the dependency we picked, which could render the project not compileable. You can disable the jar replacement in the import wizard and try again:

android-support-v4.jar => com.android.support:support-v4:19.1.0

Moved Files: ------------ Android Gradle projects use a different directory structure than ADT Eclipse projects. Here's how the projects were restructured:

  • AndroidManifest.xml => app\src\main\AndroidManifest.xml
  • res\ => app\src\main\res\
  • src\ => app\src\main\java\

Next Steps: ----------- You can now build the project. The Gradle project needs network connectivity to download dependencies.

Bugs: ----- If for some reason your project does not build, and you determine that it is due to a bug or limitation of the Eclipse to Gradle importer, please file a bug at http://b.android.com with category Component-Tools.

(This import summary is for your information only, and can be deleted after import once you are satisfied with the results.)

like image 145
Jürgen 'Kashban' Wahlmann Avatar answered Oct 19 '22 20:10

Jürgen 'Kashban' Wahlmann


This sample project was not created for Android studio but for an eclipse project. So try to import this project to eclipse, and then export it to a Gradle project.If successful, you should now be able to import to android studio without any issue.

like image 27
Thirumoorthy Avatar answered Oct 19 '22 20:10

Thirumoorthy


For my case I solved the same issue by just syncing the project with gradle files.

like image 1
kamau wairegi Avatar answered Oct 19 '22 19:10

kamau wairegi