【发布时间】:2019-03-29 14:15:41
【问题描述】:
我之前有一个正在运行的项目,其中版本已升级到最新版本。由于以下构建错误,现在我无法构建项目。
无法解决:监控
打开文件
“打开文件”链接指向 build.gradle(模块)文件。我尝试了“无效并重新启动”,但没有帮助。
在“无法解析:监视器”或“无法解析:”下搜索未找到任何解决方案。
在这一点上我完全被难住了。
模块:build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.example.android.sunshine"
minSdkVersion 14
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
}
}
productFlavors {
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:preference-v7:28.0.0'
androidTestImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support:support-annotations:28.0.0'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test:rules:1.0.2'
}
【问题讨论】:
-
在删除 androidTestImplementation 'com.android.support.test:runner:1.0.2' 并增加你的 min sdk 版本后尝试构建
-
@singh.indolia 解决方案由 Son Truong 提供,但您能否提供更多信息说明您为什么觉得 'com.android.support.test:runner:1.0.2' 和 mind sdk 版本可能是个问题?它将帮助我解决未来的构建错误。
-
@Radesh 在发布此问题之前,我尝试彻底搜索解决方案。也许是因为我缺乏 gradle 构建故障排除方面的知识,所以我永远不会找到您提到的帖子。
标签: android android-studio gradle