project structure file is missing in existing project in android studio - android

I opened existing project in Android Studio.There are some missing files and I am not able to run existing project. Any help is appreciated. There is no project structure file.

It depends on how you opened the project. Typically, I would open it by selecting the build gradle project.
Check out: Android Studio: import project from Gradle
If this does not help it may be helpful to let us know what files are missing exactly. A copy/paste or screenshot of the your logs may be useful.

Related

Unable to build Demo Project in Android Studio 2.x

I downloaded the Navigation Drawer demo described in the docs that is (as of this writing) available here: http://developer.android.com/shareables/training/NavigationDrawer.zip
The zip file for this project does not contain a build.gradle file and seems to use a different structure than is conventional. My guess is that this an old project but I want to build and run it in Android Studio 2.x (currently 2.2.3). Since this is part of the official documentation I guess I might be doing something wrong, or did the creator of this file intend for me to create a gradle build file on my own?
Any help for getting this running?
Whenever you import an Android project you should essentially go to menu File > New > Import Project. As a result, it will automatically create a build.gradle file in case it does not exist in the project.
I'm using Android Studio 2.3.
Hope it helps :)
Delete all gradle related files out side your app folder and import project again it will rebuild and it will include all gradle related dependencies again

Android Studio doesn't recognize my imported Github project

Ok, so I decided to import my github project into my other machine on AS. The problem however is that AS seems to completely forget it's an Android project and treats the project as a simple directory. I can't build, rebuild or even run my project. Additionally my file structure is gone.
I've tried importing based on external models but my Android Manifest can't seem to recognize my strings resource folder either. So importing is out of the question.
Any help is appreciated thanks.
It's because you're missing a lot of the files that AndroidStudio creates with you start a new project.
A simple way to fix this will be to create a new project with the same name, package name, all that, and then just copy over your app folder.
When you reopen the project it will recognise it.
this happened to me due to that the file called build.gradle and other similar files wasn't in the root directory like when I opened my imported project I see these files :
but it should be like this :
so I navigated to the directory that contains the files in the above photos and imported that file as an android project and I succeeded, but there may other reasons for your problem , so you should clarify.
You do not have a build.gradle in the root folder of the project, maybe that is the reason.
Without the build.gradle file android studio cannot perform a correct import of the project.

Android Studio can not find R when importing module

I was trying to import an Eclipse "library project" as module to Android Studio.But I am consistantly getting "Cannot find R.java" error.The weird thing is the module has already R.java in /gen file.What am I supposed to do?
Thank you in advance!
EDIT:I have already an app in Android Studio.Now I am trying to import a library project to it.So what I am doing is open the project(my actual app),then File-Import Module in Android Studio.But getting the above error.
You need to import your library using gradle (assuming you are using gradle). After that you would have several R.java to choose from based on their package.
Try this File > Settings > Compiler > check use-in progress checkbox. then rebuild the project. I hope it helps.

How to import google code project to android studio?

I recently came across a cool project (https://code.google.com/p/android-wheel/) I would like to import to android studio. Is it possible to import this without trying to copy-paste individual code?
Thanks
you would have to extract the apk to make it easier, or if you just want to run it the apk is located in the downoads section
Those projects contains .project and .classpath files. Those are meta-data for eclipse IDE and unfortunately there is no build.gradle so it cannot be imported immediately in Android-Studio.
The best thing to do is to write a build.gradle yourself for this project and then opening it into Android-Studio. It's a good exercise to learn gradle if you are not familiar with it yet.

How do I build these libraries from GitHub

I'm having a lot of trouble figuring out how to build a jar of the Showcase View library so that I can import it into my application.
I've searched all around but can't find a process for it. I tried importing into Eclipse but I can't get it in there since it isn't a project and I'm not sure what type of project to create from source with.
Any help would be greatly appreciated.
Easiest way is:
Create an empty Android Application project in your Eclipse workspace.
Copy files in ShowcaseView/library/ folder of github to your new project base folder.
Refresh project in Eclipse.
Goto project properties - Android and select "Is Library"
Clean unnecessary stuff and build.
It should be ready to add as dependency of your app.
Alternatively you can pick another library project .project file and copy it inside this library folder, edit it to match your new project name, etc... And then import in Eclipse. But this is more hardcore if you don't know what you're doing.

Categories

Resources