该应用程序模块在Android Studio中消失了

时间:2018-10-20 01:58:56

标签: android android-studio

我打开了我的项目,并注意到默认模块(应用程序)已消失。我不确定如何重新添加它,因为它表明它不存在。

这是我为我的项目得到的错误。

org.gradle.api.ProjectConfigurationException: A problem occurred configuring root project 'MQsmartAccess'

这是项目当前的外观。

enter image description here

当我单击编辑配置时,它将说没有模块。

这是我的gradle版本:

   // Top-level build file where you can add configuration options common to all 
 sub-projects/modules.
 apply plugin: 'com.android.application'

buildscript {

repositories {
    google()
    jcenter()
 }
dependencies {
    classpath 'com.android.tools.build:gradle:3.2.0'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}
allprojects {
repositories {
    google()
    jcenter()
}
}
  task delete(type: Delete) {
delete rootProject.buildDir
}

dependencies{
implementation project(':app')
implementation fileTree(include: ['*.jar'], dir: 'libs')
}

如何解决此问题?

2 个答案:

答案 0 :(得分:0)

打开您的 buil.gradle 文件进行一些更改以同步项目。那可能是         成功同步后, versionName“ 1.1.1” 会返回到以前的versionName。希望它能解决您的问题。尽管这是一个荒谬的解决方案。我已经多次面对这个问题。并解决使用这种方式。

答案 1 :(得分:-1)

我在src文件夹中找到它。名称为build.gradle。内容与build.gradle(Module app)相同。万一您在那找不到。我首先从.gitignore中删除了所有内容。我不确定是否由于删除.gitignore文件而得到文件。