VCS项目导入在Android Studio上不起作用 [英] VCS project import not working on Android Studio

查看:130
本文介绍了VCS项目导入在Android Studio上不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将Bitbucket的git项目导入Android Studio 3.2. 但是,当我按照步骤从版本控制-> Git新建->项目时,该项目是导入的,但格式不正确,因此无法读取gradle文件或将该项目标识为android项目.

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:

如您在上面看到的,出现的唯一文件夹是java文件夹.

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

当我切换到项目"视图时,将显示以下内容:

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

该应用被视为omasy,但是真正的代码在omasyAndroid中. 清单文件也没有出现在正确的位置.

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

这导致应用程序无法编译,因为它无法读取本身是一个android项目.

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

任何帮助将不胜感激.

Any help would be highly appreciated.

推荐答案

导入这样的项目意味着(对于AS)您正在导入模块,而不是启动新项目.

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

首先创建一个新的空项目.然后从Github或Bitbucket导入模块或项目

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

Voilá.

编辑

现在,您应该已经看到唯一缺少的是整个项目的主机目录和build.gradle文件,其结构如下:

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
}

这篇关于VCS项目导入在Android Studio上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆