Reputation: 1767
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?
Upvotes: 16
Views: 37100
Reputation: 448
For my case I solved the same issue by just syncing the project with gradle files.
Upvotes: 1
Reputation: 114
For my case, it was an existing Android studio project. What I did was to first close the project, and to open it, I clicked on "Open An Existing Android Studio Project" and it opened the project properly
Upvotes: 0
Reputation: 1
i hope this can help you Click the "File" ,then select "New Module",and the next is "Import Gradle Project",find the folder of your module,finish.
Upvotes: 0
Reputation: 589
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.
Upvotes: 2
Reputation: 1539
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.)
Upvotes: 2