【问题标题】:error after push and pull from git从 git 推拉后出错
【发布时间】:2018-05-04 22:22:05
【问题描述】:

我有一个 android studio 项目,它很糟糕。我把它推到了 gitlab 并在删除它之后,我又拉了它。 现在当我想构建我的 gradle 时出现此错误:

Error:The module 'app' is an Android project without build variants, and cannot be built.Please fix the module's configuration in the build.gradle file and sync the project again.

这是我的 build.gradle:

 apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.0"
    defaultConfig {
        applicationId "sample.spart.com"
        minSdkVersion 21
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.android.support:support-v4:26.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    implementation 'com.android.support:cardview-v7:27.0.2'
    implementation 'com.android.support:design:27.0.2'
    implementation 'com.nineoldandroids:library:2.4.0'
    implementation 'com.android.support:recyclerview-v7:26.0.0-alpha1'
}

是什么问题,我该如何解决??

【问题讨论】:

    标签: android android-studio gradle build.gradle


    【解决方案1】:

    也许您可以尝试使您的现金无效。 在 Android Studio 中: 文件 -> 使缓存无效/重新启动

    分享您项目的 build.gradle 文件可能会有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-01-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-04-10
      相关资源
      最近更新 更多