我已将Android Studio从2.x更新为3.x.起初它显示gradle sync失败,然后我在Stack Overflow的帮助下以某种方式修复它。在那个过程中,我更新了gradle。之后通过遵循Stack Overflow帖子中的步骤修复了一段时间。我在gradle中删除了一个文件,现在已经出来了:
Gradle sync失败:找不到ID为“com.android.application”的插件
这是文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.demoandroid.udacitybdcard"
minSdkVersion 19
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-
rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2',
{
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.0'
testCompile 'junit:junit:4.12'}