apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.example.administrator.barcode2ds"
minSdkVersion 19
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(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation '<u>com.android.support:appcompat-v7:26.0.0-alpha1</u>'
testImplementation 'junit:junit:4.12'
implementation files('libs/cw-deviceapi20171026.jar')
}
错误:
ERROR: Could not find method implementation() for arguments [directory 'libs'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
答案 0 :(得分:0)
implementation '<u>com.android.support:appcompat-v7:26.0.0-alpha1</u>'
在此行中的从依赖项的开头和结尾处删除,然后进行同步。最后应该是这样:
implementation 'com.android.support:appcompat-v7:26.0.0-alpha1'