错误:(40, 0) 找不到参数的方法实现() [目录 'libs']



我从 2 天开始尝试运行我的 android 工作室,最后它显示错误 400,我的build.gradle文件看起来像这样

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
}
}
allprojects {
repositories {
jcenter()
}
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '25.0.1'
defaultConfig {
applicationId "com.armenhovhannisyan.backpaper.backpaper"
minSdkVersion 25
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner                      "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('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.0.0-beta1'
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:design:25.0.0-beta1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-annotations:25.3.1'
}

更新并对我的 gradle.properties 文件进行一些更改后,它看起来像这样

# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details,  visit
#        http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decou    pled_projects
# org.gradle.parallel=true
distributionUrl=http://services.gradle.org/distributions/gradle-2.2.1-    all.zip

它应该是compile的,而不是implementation的,对于安卓特定的测试,它是androidTestCompile的。它应该看起来像这样

compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile'com.android.support:design:25.0.0-beta1'
compile'com.android.support.constraint:constraint-layout:1.0.2'

最新更新