Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android studio does not recognize the project as android project #1349

Closed
abdurahmanadilovic opened this issue Jun 11, 2018 · 15 comments
Closed

Android studio does not recognize the project as android project #1349

abdurahmanadilovic opened this issue Jun 11, 2018 · 15 comments

Comments

@abdurahmanadilovic
Copy link

@abdurahmanadilovic abdurahmanadilovic commented Jun 11, 2018

I cloned the repository and I tried to open it with Android studio and got nowhere, what is a proper way to open this project with android studio 3.1.3?

@samtstern
Copy link
Member

@samtstern samtstern commented Jun 11, 2018

@abdurahmanadilovic I am also using Studio 3.1.x but (obviously) I can't see the same problem. Please provide more information, otherwise I think this is an issue with your machine/configuration.

@abdurahmanadilovic
Copy link
Author

@abdurahmanadilovic abdurahmanadilovic commented Jun 11, 2018

I tried to clone the project with and without android studio with no effect.

In the project explorer if I select android nothing shows up if I select Project view this is only what appears in the explorer

I guess the build.gradle.kts might cause this issues since android studio is looking for build.gradle without the .kts extension?

@SUPERCILEX
Copy link
Collaborator

@SUPERCILEX SUPERCILEX commented Jun 11, 2018

Oh, that's because you didn't import it from Gradle properly. Ctrl + E to get to the Gradle sidebar. Then click the + button to add the root module and start a sync. If that doesn't work, close the project and delete the .idea folder. Then choose import from existing sources and go through the Gradle flow.

@abdurahmanadilovic
Copy link
Author

@abdurahmanadilovic abdurahmanadilovic commented Jun 12, 2018

So this happens if I try to import a gradle project. It detects multiple android / java modules and none of them are runnable. If I understood you correctly I should select import project then select gradle, instead of "Open an existing Android Studio project"?

@SUPERCILEX
Copy link
Collaborator

@SUPERCILEX SUPERCILEX commented Jun 12, 2018

In the second step, you should have clicked the Import project from external model option. Be sure to delete the .idea folder again before importing.

@abdurahmanadilovic
Copy link
Author

@abdurahmanadilovic abdurahmanadilovic commented Jun 16, 2018

I managed to build the project by selecting "import project from external model", now everything works, thanks for helping me out.

@sushihangover
Copy link

@sushihangover sushihangover commented Jun 19, 2018

FYI: I am using AS 3.2C18 and since there is an existing repo-based file within the .idea directory:

  • .idea/codeStyleSettings.xml

Importing via Gradle fails to import the project properly.

Deleting the .idea directory and re-importing from external model works fine

And then, of course, doing to git checkout -- .idea/codeStyleSettings.xml to get the code styles back.

@sugoireed
Copy link

@sugoireed sugoireed commented Sep 20, 2018

What worked for me was

On Android Studio

Open the settings.gradle file

include your project

include ':myproject'

@ashomokdev
Copy link

@ashomokdev ashomokdev commented Sep 30, 2018

To open the project you need to have Gradle installed on your PC. Then
Download repo FirebaseUI-Android from github.
In your Android Studio File -> New -> Import Project -> FirebaseUI-Android-master Path -> Import project from external model -> Gradle (!) -> Use local gradle distribution

If it not helps, add local.properties file to the root of FirebaseUI-Android-master with next line (edited for you) sdk.dir=/home/yuliia/Android/Sdk

@AdamSHurwitz
Copy link

@AdamSHurwitz AdamSHurwitz commented Oct 14, 2018

Thanks for the recent update @ashomokdev ! I've followed your steps and am unfortunately running into the following build error message.

@abdurahmanadilovic, unfortunately this is still an issue for my machine on Android Studio 3.2.1 as well as others. May you please re-open this ticket.

@sugoireed , where in the directories can you find the name of the project name to include in the settings.gradle?

Implementation

  1. git clone git@github.com:firebase/FirebaseUI-Android.git
  2. Android Studio: File > New > Import Project > FirebaseUI-Android path > Import project from external model > Gradle > Use local gradle distribution > Select Yes to override existing .Idea file > Select Configure when Android framework is detected dialog is displayed.
  3. Once I received the build error above, I followed your advice and added the local.properties file to the root FirebaseUI-Android directory. I found the Android SDK path in terminal and used the pwd command to retrieve the path: sdk.dir=/Users/adamhurwitz/Library/Android/sdk
  4. I attempted re-importing after adding the local.properties file with the same build error.

Attempted Solutions

I've also attempted the following variations in the import process:

  1. Deleting the .idea file before importing as well as overwriting the file.
  2. All of the below variations were tested with both file paths 1) File > New > Import Project > FirebaseUI-Android path > ... and 2) File > New > Import Project > app path > ....
  3. File > New > Import Project > file_path > Create project from existing sources > ...
  4. File > New > Import Project > file_path > Import project from external model > Android Gradle > ... (different build error message).
@IshuDeve
Copy link

@IshuDeve IshuDeve commented Jun 17, 2019

Hi I have a problem when i connect Firebase to android It always occurred some error

@dotrachit
Copy link

@dotrachit dotrachit commented Dec 23, 2019

Doing a simple 'sync with gradle files' solved my problem :D

@jhonatansabadi
Copy link

@jhonatansabadi jhonatansabadi commented Jan 23, 2020

Close your project on Android Studio, then delete .idea folder, then open open your project.

@albertocapired
Copy link

@albertocapired albertocapired commented May 13, 2020

Same problem: lost gradle, github is useful to me about interesting code here, but the projects implementation and cloning is very complicate, I see this in multpipe github blogs like this, sorry Microsoft

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.