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

Git/github project import into Android Studio does not load modules properly #1

Closed
Cliabhach opened this issue Jun 21, 2016 · 16 comments

Comments

@Cliabhach
Copy link
Collaborator

I suspect that the root cause is the .idea folder. This contains ide-specific information and really shouldn't be in the repo in the first place.

Errors seen:

3:56:52 AM Gradle sync started
3:56:59 AM Error Loading Project: Cannot load 2 modules Details...
3:57:03 AM Gradle sync failed: Failed to find target with hash string 'android-24' in: /opt/android/sdk

Note: The last line, about the gradle sync, is a different issue.

@Cliabhach
Copy link
Collaborator Author

Although, now that I look into it a bit more, https://intellij-support.jetbrains.com/hc/en-us/articles/206544839-How-to-manage-projects-under-Version-Control-Systems recommends that most of the .idea folder be included in vcs. Which is what you've got already. So there's probably a different problem here.....

@paulscott56
Copy link
Collaborator

Has the iml file loaded? Did you import the project? There is a manual way to add the modules too though, by adding the missing modules via the project structure menu

@Cliabhach
Copy link
Collaborator Author

The iml files weren't loaded, as you suspect. They weren't autogenerated right away either. I'll add the modules manually, but I want to know why the fresh checkout didn't do that for me.

@Cliabhach
Copy link
Collaborator Author

Cliabhach commented Jun 21, 2016

Ok, apparently changing the targetSDKVersion and compileSDKVersion to 23 (which I did have installed) meant I could run the gradle sync ok, which seems to have triggered creation of the iml files. So this might be a non-issue after all.

On that note, why doesn't it offer to install SDK 24 for me when it can't be found? The build tools do that sort of thing just fine. Maybe I should file a bug on Android Studio.

@paulscott56
Copy link
Collaborator

Not sure! I'm using Android Studio pre release Canary, so that may be a
thing too...

On Tue, 21 Jun 2016, 10:22 Cliabhach notifications@github.com wrote:

Ok, apparently changing the targetSDKVersion and compileSDKVersion to 23
(which I did have installed) meant I could run the gradle sync ok,
which seems to have triggered creation of the iml files. So this might be a
non-issue after all.

On that note, why doesn't it offer to install SDK 24 for me when it can't
be found? The build tools work fine that way. Maybe I should file a bug on
Android Studio.


You are receiving this because you commented.

Reply to this email directly, view it on GitHub
#1 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ABUfyAbgiSflL9YQqQck58zcClLctHgyks5qN61YgaJpZM4I6e7F
.

@Cliabhach
Copy link
Collaborator Author

I'm using pre-release canary builds as well (2.2 Preview 3 rn) FWIW. I'm just trying a clean close/reopen from disk without any of my local modifications, to see whether SDK 24 was the missing link.

@Cliabhach
Copy link
Collaborator Author

And what do you know, it was. Great. I guess I'll close this and make a real issue.....

@paulscott56
Copy link
Collaborator

Great then! Glad you're up and running!

On Tue, 21 Jun 2016, 10:31 Cliabhach notifications@github.com wrote:

And what do you know, it was. Great. I guess I'll close this and make a
real issue.....


You are receiving this because you commented.

Reply to this email directly, view it on GitHub
#1 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ABUfyIUjaZ3iRjtfkqI6kVQrt5DHaVLVks5qN69agaJpZM4I6e7F
.

paulscott56 pushed a commit that referenced this issue Aug 26, 2016
@FTWJAY
Copy link

FTWJAY commented Oct 28, 2018

i open android-studio and open a Git project. It downloads the project but only recognizes the Gradle files and such. It doesn't recognize the MainActivity even though the project was created in android-studio. Am I doing something wrong myself?

@skraynick
Copy link
Collaborator

What do you mean by "it doesn't recognize the MainActivity"? Or do you mean the MainActivity is not imported?

@FTWJAY
Copy link

FTWJAY commented Oct 29, 2018 via email

@skraynick
Copy link
Collaborator

@FTWJAY It has got to be something your doing... The app works fine on both an emulator and on a real device. Perhaps if you want to hop on the android chat on mattermost we can chat more there and see if we can debug the situation. skr8ynick is handle on there. Thanks, sarah.

@FTWJAY
Copy link

FTWJAY commented Oct 31, 2018 via email

@panmona
Copy link

panmona commented Oct 31, 2018

@FTWJAY Should there have been a screenshot or log in your post?

@FTWJAY
Copy link

FTWJAY commented Oct 31, 2018 via email

skraynick pushed a commit that referenced this issue Nov 20, 2018
@john123rose
Copy link

I am very very new to this. Even I dont find the file to run the project on android studio

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

No branches or pull requests

6 participants