有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java I不断出现此错误(Gradle项目同步失败。基本功能无法正常工作)

我一直收到这个Gradle错误,尽管我确实更新了每个Gradle配置键,并仔细检查了每一行。我还是不明白怎么回事

Gradle project sync failed.Basic functionality(eg editing,debugging) will not work properly

它告诉我查看查看窗口中的错误信息,其中包括:

WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.安卓.com/r/tools/update-dependency-configurations.html
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
:wrapper UP-TO-DATE

BUILD SUCCESSFUL in 0s
1 actionable task: 1 up-to-date
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

CONFIGURE SUCCESSFUL in 0s

Gradle

apply plugin: 'com.安卓.application'

安卓 {
    compileSdkVersion 26

    dexOptions {
        javaMaxHeapSize "4g"
    }


    lintOptions {
        quiet true
        abortOnError false
        ignoreWarnings true
    }
    configurations {
        all*.exclude group: 'commons-io'

    }

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/ASL2.0'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE-FIREBASE.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'BinaryEncoder.java'
    }

    defaultConfig {
        applicationId 'com.xxx.xxx'
        minSdkVersion 16
        targetSdkVersion 26
        versionCode 3
        versionName '1.2'
         multiDexEnabled true
        ndk {
        abiFilters 'armeabi', 'armeabi-v7a', 'x86', 'mips'
         }
        resConfigs 'en'

    }
    sourceSets {
        main {
            java {
                exclude 'com.twilio:client-安卓:1.2.18.org.apache.http.lejacy.jar.org.apache.BinaryEncoder.java'
                exclude 'org.apache.commons.codec.BinaryEncoder.java'
            }
        }
        安卓Test {
            java {
                exclude 'commons-codec-1.10/**'
            }
        }
    }

    buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-安卓.txt'), 'proguard-rules.pro'
        }
    }
}

repositories {
    mavenCentral()
}


dependencies {
    configurations { all*.exclude group: 'com.安卓.support', module: 'support-v13' }
    implementation fileTree(include: '*.jar', dir: 'libs')
    implementation files('libs/YouTubeAndroidPlayerApi.jar')
    implementation('com.github.hotchemi:permissionsdispatcher:2.4.0') { exclude module: 'support-v13'}
    implementation 'com.stripe:stripe-安卓:7.0.1'
    implementation 'com.braintreepayments.api:braintree:2.7.0'
    implementation 'com.braintreepayments.api:drop-in:3.1.0'
    implementation 'jp.wasabeef:recyclerview-animators:2.2.7'
    implementation 'com.github.markomilos:paginate:0.5.1'
    implementation 'com.github.czy1121:segmentedview:1.0.0'
    implementation 'com.orhanobut:logger:2.2.0'
    implementation 'com.twilio:client-安卓:1.2.18'
    implementation 'com.squareup.okio:okio:1.11.0'
    implementation 'com.squareup.retrofit2:retrofit:2.2.0'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.6.0'
    implementation 'com.github.mukeshsolanki:country-picker-安卓:1.1.9'
    implementation 'com.google.安卓.gms:play-services-gcm:11.4.0'
    implementation 'com.google.安卓.gms:play-services-identity:11.4.0'
    implementation 'com.google.安卓.gms:play-services-plus:11.4.0'
    implementation 'com.google.安卓.gms:play-services-maps:11.4.0'
    implementation 'lib.kingja.switchbutton:switchbutton:1.1.3'
    implementation 'com.orhanobut:hawk:2.0.1'
    implementation 'com.afollestad:material-camera:0.4.4'
    implementation 'com.werb.pickphotoview:pickphotoview:0.3.0'
    implementation 'com.github.Kennyc1012:BottomSheet:2.3.4'
    implementation 'com.facebook.安卓:facebook-安卓-sdk:4.35.0'
    implementation 'com.安卓.support:design:26.0.1'
    implementation 'com.安卓.support:cardview-v7:26.0.1'
    implementation 'com.安卓.support:multidex:1.0.1'
    implementation 'com.google.code.gson:gson:2.8.1'
    implementation 'com.squareup.okhttp:okhttp:2.5.0'
    implementation 'de.greenrobot:eventbus:2.4.0'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.paypal.sdk:paypal-安卓-sdk:2.14.4'
    implementation 'com.koushikdutta.ion:ion:2.1.8'
    implementation 'com.afollestad.material-dialogs:core:0.8.6.0'
    implementation 'com.amitshekhar.安卓:安卓-networking:1.0.0'
    implementation 'de.hdodenhof:circleimageview:2.1.0'
    implementation 'com.安卓.support:support-v4:26.0.1'
    implementation 'com.安卓.support.constraint:constraint-layout:1.0.2'
    implementation 'com.google.firebase:firebase-messaging:11.4.0'
    implementation 'com.google.firebase:firebase-core:11.4.0'
    testImplementation 'junit:junit:4.12'
    annotationProcessor 'com.github.hotchemi:permissionsdispatcher-processor:2.4.0'
}
apply plugin: 'com.google.gms.google-services'

更新

这是项目梯度文件

buildscript {
    repositories {
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
        google()
    }
    dependencies {
        classpath 'com.安卓.tools.build:gradle:3.2.1'
        classpath 'com.google.gms:google-services:4.1.0'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        mavenCentral()
        maven { url 'https://dl.bintray.com/drummer-aidan/maven' }
        maven { url 'https://jitpack.io' }

        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }

}

task clean(type: Delete) {
    delete rootProject.buildDir
}

共 (2) 个答案

  1. # 1 楼答案

    我注意到Android Studio建议了一个动作Remove minSdkVersion and sync project,我点击了它,它被修复了。。!虽然它没有从我的模块的build.grdale文件中删除该行,但我不知道他所说的操作是什么意思,但无论如何它是固定的。!如果有人知道更多信息,请告诉我

  2. # 2 楼答案

    您可以使用以下命令标识compile配置依赖项:

    ./gradlew app:dependencies  configuration compile