Firebaseui-android: Android studio does not recognize the project as android project

Created on 11 Jun 2018  路  16Comments  路  Source: firebase/FirebaseUI-Android

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?

Most helpful comment

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.

All 16 comments

@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 [email protected]: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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ozican picture ozican  路  6Comments

long1eu picture long1eu  路  4Comments

RedCider picture RedCider  路  5Comments

sbotev5 picture sbotev5  路  4Comments

imax531 picture imax531  路  3Comments