android - 从 git 推拉后出错
问题描述
我有一个 android 工作室项目,它是 wroks。我把它推到了 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 Studio 中:文件 -> 使缓存无效/重新启动
共享项目的 build.gradle 文件可能会有所帮助。
推荐阅读
- vue.js - 数组中的 bootstrap-vue 嵌套对象以显示在表中
- kubernetes - AKS 群集 pod 正在由未知的 pod IP 轮询
- r - 如何使用 dplyr 从每一行中获取最大的列值
- tensorflow - 如何在张量流损失中使用内核过滤器?
- ios - Xcode 11,使用 iOS 10.3.3 设备,设备和模拟器对话框中没有“通过网络连接”
- c - c 中的 strcpy() 给了我分段错误
- php - $row 未正确回显 mySql 数据库中的一行
- python - 根据条件更新数据框列的有效方法
- rust - “关联类型...必须指定”,但未使用
- ios - 使用令牌从 HerokuApp 请求数据的正确 POST 格式是什么?