VCS project import not working on Android Studio

老子叫甜甜 提交于 2019-12-24 19:22:50

问题


I am trying to import a git project from Bitbucket to Android Studio 3.2. However when I follow the steps New -> Project from Version Control-> Git, the project is imported but not in the right format and thus, it can't read the gradle file or identify the project as an android project.

After import, this is the view I see:

As you can see above, the only folder appearing is the java folder.

And when I switched to Project view, the following appears:

The app is seen as omasy however the real code is in omasyAndroid. Also the manifest file is not appearing in the right place.

This lead to the application not compiling because it can't read itself being an android project.

Any help would be highly appreciated.


回答1:


Importing a project like that implies (for AS) that your are importing a module, not starting a new project.

Start by creating a new, empty project. Then import the module or project from Github or Bitbucket

Voilá.

EDIT

By now you should've seen the only thing missing was a host directory and a build.gradle file for the whole project structured like this:

buildscript {
    ...
    repositories {
        google()
        jcenter()
    }

    dependencies {
        ....
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}


来源:https://stackoverflow.com/questions/49780644/vcs-project-import-not-working-on-android-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!