firebase/FirebaseUI-Android

Android studio does not recognize the project as android project

abdurahmanadilovic opened this issue ยท 17 comments

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?

@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.

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?

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.

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"?

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.

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

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.

What worked for me was

On Android Studio

Open the settings.gradle file

include your project

include ':myproject'

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

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).

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

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

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

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

What worked for me was

On Android Studio

Open the settings.gradle file

include your project

include ':myproject'

also worked for me, thanks man

in my case i downloaded zip file from telegram desktop & unzipped in same folder so i got this problem,

save your unzipped project at other location like desktop & than open project will solve your problem, good luck