简体   繁体   English

Build Gradle错误“名称不能为空”

[英]Build Gradle error “name must not be null”

I've changed compiles and test compiles to implementation and testImplementation but still get this error: 我已经将编译和测试编译更改为实现和testImplementation,但仍然收到此错误:

name must not be null 名称不能为空

...for this line in dependencies: ...对于依赖项中的这一行:

implementation(dir: 'libs', include: ['*.jar'])

Anything I could try to fix this? 有什么我可以尝试解决的吗?

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 23

defaultConfig {
    applicationId "com.fruitmarket";
    minSdkVersion 16
    targetSdkVersion 23
    versionCode 1

    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 
'proguard-rules.pro'
    }
}

packagingOptions {
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/LICENSE'
}
lintOptions {
    disable "ResourceType"
}

useLibrary 'org.apache.http.legacy'

}
repositories {
maven {
    // Used for downloading dependency com.github.lkorth:device-automator
    url "https://jitpack.io"
}
mavenCentral()
}

dependencies {
implementation(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.13-beta-3'
implementation 'com.android.support:appcompat-v7:26.0.0-alpha1'
implementation group: 'org.apache.httpcomponents' , name: 'httpclient- 
android' , version: '4.3.5.1'
implementation('org.apache.httpcomponents:httpmime:4.3') {
    exclude module: "httpclient"
}
compile('com.paypal.sdk:paypal-android-sdk:2.13.3') {
    //exclude group: 'io.card'
}

implementation "com.google.android.gms:play-services-gcm:9.0.0"
implementation 'com.karumi:dexter:2.3.1'
}

尝试这个:

implementation fileTree(include: ['*.jar'], dir: 'libs')

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM