Android 配置';编译';已过时,并已替换为';实施';和';api&x27;

Android 配置';编译';已过时,并已替换为';实施';和';api&x27;,android,Android,这是我在尝试构建我的项目时遇到的错误,请帮助我解决这个问题。我被困在这个问题上,我是android的初学者 配置“compile”已过时,已替换为“implementation”和“api”。将于2018年底拆除。有关更多信息,请参阅: 我还附加了我的应用程序级别和构建级别的gradle文件 应用程序级基本等级 buildscript { repositories { maven { url 'https://maven.fabric.io/public' } } depende

这是我在尝试构建我的项目时遇到的错误,请帮助我解决这个问题。我被困在这个问题上,我是android的初学者

配置“compile”已过时,已替换为“implementation”和“api”。将于2018年底拆除。有关更多信息,请参阅:

我还附加了我的应用程序级别和构建级别的gradle文件

应用程序级基本等级

buildscript {
    repositories { maven { url 'https://maven.fabric.io/public' } }
    dependencies { classpath 'io.fabric.tools:gradle:1.25.3' }
}
plugins {
    id 'com.onesignal.androidsdk.onesignal-gradle-plugin' version '0.8.1'
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
repositories {
    maven { url 'https://maven.google.com' }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories { maven { url 'https://maven.fabric.io/public' } }
android {
    compileSdkVersion 27
    useLibrary 'org.apache.http.legacy'
    defaultConfig {

        minSdkVersion 19
        targetSdkVersion 27
        versionCode 102
        versionName "1.0.2"
        multiDexEnabled true
//        resConfigs "en"
        manifestPlaceholders = [onesignal_app "code",
                                // Live
                                onesignal_google_project_number: "REMOTE"]

////
//        manifestPlaceholders = [onesignal_app_id               : "b35433d4-be61-473f-94f8-65364b2cd501",
//                                // Internal Testing
//                                onesignal_google_project_number: "REMOTE"]
    }
    android {
        lintOptions {
            checkReleaseBuilds false
            abortOnError false
        }
    }
    android {
        buildTypes {
            packagingOptions {
                exclude 'META-INF/NOTICE' // will not include NOTICE file
                exclude 'META-INF/LICENSE' // will not include LICENSE file
                // as noted by @Vishnuvathsan you may also need to include
                // variations on the file name. It depends on your dependencies.
                // Some other common variations on notice and license file names
                exclude 'META-INF/notice'
                exclude 'META-INF/notice.txt'
                exclude 'META-INF/license'
                exclude 'META-INF/license.txt'
            }
            debug {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
            release {
                debuggable false
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
                consumerProguardFiles 'proguard-file.pro'
            }
        }
    }
    dexOptions {
        preDexLibraries = false
        javaMaxHeapSize "12g"
    }
}
repositories
        {
            maven { url 'https://repo.commonsware.com.s3.amazonaws.com' }
            maven { url 'https://jitpack.io' }
            maven { url "https://s3.amazonaws.com/repo.commonsware.com" }
        }
//configurations.all {
//    resolutionStrategy {
//        force 'com.android.support:design:23.4.0'
////        force 'com.android.support:support-v4:23.4.0'
//        force 'com.android.support:appcompat-v7:23.4.0'
//    }
//}
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.android.support:cardview-v7:27.1.1'
//    implementation 'com.helpshift:android-aar:3.7.2'
    implementation 'com.mcxiaoke.volley:library:1.0.19'
    implementation files('libs/universal-image-loader-1.6.1-with-src.jar')
    implementation project(':library')
    implementation files('libs/Parse-1.8.0.jar')
    implementation project(':gallery')
    implementation project(':indicator')
    implementation 'com.amplitude:android-sdk:2.9.2'
    implementation 'com.razorpay:checkout:1.4.1'
    implementation('com.crashlytics.sdk.android:crashlytics:2.6.6@aar') {
        transitive = true;
    }
//    implementation 'com.hokolinks:hoko:2.3.0'
    implementation 'cat.ereza:customactivityoncrash:1.5.0'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.google.android.gms:play-services-auth:15.0.1'
    implementation 'com.google.android.gms:play-services-base:15.0.1'
    implementation 'com.google.firebase:firebase-appindexing:15.0.1'
    implementation 'com.google.android.gms:play-services-appinvite:16.0.0'
    implementation 'com.google.android.gms:play-services-gcm:15.0.1'
    implementation 'com.google.android.gms:play-services-location:15.0.1'
    implementation 'com.google.android.gms:play-services-plus:15.0.1'
    implementation 'com.google.android.gms:play-services-maps:15.0.1'
    implementation 'com.github.jaydeepw:poly-picker:v1.0.22'
    implementation 'com.github.Commit451:NativeStackBlur:1.0.2'
    implementation 'com.github.Hitta:RippleEffect:82cf00e551'
    implementation 'com.github.zplesac:android_connectionbuddy:v1.0.7'
    implementation 'com.github.paolorotolo:expandableheightlistview:1.0.0'
    implementation 'com.github.tony19:timber-loggly:1.0.1'
    implementation 'com.neumob:neumob-android:3.7.2'
    implementation 'com.facebook.fresco:fresco:1.8.0'
    implementation 'com.firebase:firebase-client-android:2.5.2'
    implementation 'com.google.android.exoplayer:exoplayer:r1.5.10'
    implementation project(':common')
    implementation project(':commonwidget')
    implementation project(':videowidget')
    implementation 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-7'
    implementation project(':Spotlight-library')
    implementation 'com.onesignal:OneSignal:3.9.1@aar'
    implementation files('libs/YouTubeAndroidPlayerApi.jar')
    implementation files('libs/dropbox-android-sdk-1.6.3.jar')
    implementation 'com.pitt.fresh.library:freshdownloadview:1.0'
    implementation 'es.voghdev.pdfviewpager:library:1.0.1'
    implementation('com.crashlytics.sdk.android:answers:1.3.11@aar') {
        transitive = true;
    }
//    implementation 'com.bugsee:bugsee-android:+'
    implementation 'com.stripe:stripe-android:5.0.0'
    implementation 'com.google.firebase:firebase-core:16.0.0'
    implementation 'com.google.firebase:firebase-perf:16.0.0'
    implementation 'io.branch.sdk.android:library:2.18.1'
    implementation project(path: ':androidQuery')
    implementation 'com.onesignal:OneSignal:[3.9.1, 3.99.99]'
    implementation 'com.instabug.library:instabug:4.11.0'
    implementation ('io.branch.sdk.android:library:2.+') {
        exclude module: 'answers-shim'
    }
}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.firebase-perf'
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
        classpath 'com.google.gms:google-services:3.2.0'
        classpath 'com.google.firebase:firebase-plugins:1.1.1'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}
allprojects {
    repositories {
        jcenter()
        google()
        maven {
            url "https://maven.google.com" // Google's Maven repository
        }
    }
}
项目级建筑等级

buildscript {
    repositories { maven { url 'https://maven.fabric.io/public' } }
    dependencies { classpath 'io.fabric.tools:gradle:1.25.3' }
}
plugins {
    id 'com.onesignal.androidsdk.onesignal-gradle-plugin' version '0.8.1'
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
repositories {
    maven { url 'https://maven.google.com' }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories { maven { url 'https://maven.fabric.io/public' } }
android {
    compileSdkVersion 27
    useLibrary 'org.apache.http.legacy'
    defaultConfig {

        minSdkVersion 19
        targetSdkVersion 27
        versionCode 102
        versionName "1.0.2"
        multiDexEnabled true
//        resConfigs "en"
        manifestPlaceholders = [onesignal_app "code",
                                // Live
                                onesignal_google_project_number: "REMOTE"]

////
//        manifestPlaceholders = [onesignal_app_id               : "b35433d4-be61-473f-94f8-65364b2cd501",
//                                // Internal Testing
//                                onesignal_google_project_number: "REMOTE"]
    }
    android {
        lintOptions {
            checkReleaseBuilds false
            abortOnError false
        }
    }
    android {
        buildTypes {
            packagingOptions {
                exclude 'META-INF/NOTICE' // will not include NOTICE file
                exclude 'META-INF/LICENSE' // will not include LICENSE file
                // as noted by @Vishnuvathsan you may also need to include
                // variations on the file name. It depends on your dependencies.
                // Some other common variations on notice and license file names
                exclude 'META-INF/notice'
                exclude 'META-INF/notice.txt'
                exclude 'META-INF/license'
                exclude 'META-INF/license.txt'
            }
            debug {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
            release {
                debuggable false
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
                consumerProguardFiles 'proguard-file.pro'
            }
        }
    }
    dexOptions {
        preDexLibraries = false
        javaMaxHeapSize "12g"
    }
}
repositories
        {
            maven { url 'https://repo.commonsware.com.s3.amazonaws.com' }
            maven { url 'https://jitpack.io' }
            maven { url "https://s3.amazonaws.com/repo.commonsware.com" }
        }
//configurations.all {
//    resolutionStrategy {
//        force 'com.android.support:design:23.4.0'
////        force 'com.android.support:support-v4:23.4.0'
//        force 'com.android.support:appcompat-v7:23.4.0'
//    }
//}
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.android.support:cardview-v7:27.1.1'
//    implementation 'com.helpshift:android-aar:3.7.2'
    implementation 'com.mcxiaoke.volley:library:1.0.19'
    implementation files('libs/universal-image-loader-1.6.1-with-src.jar')
    implementation project(':library')
    implementation files('libs/Parse-1.8.0.jar')
    implementation project(':gallery')
    implementation project(':indicator')
    implementation 'com.amplitude:android-sdk:2.9.2'
    implementation 'com.razorpay:checkout:1.4.1'
    implementation('com.crashlytics.sdk.android:crashlytics:2.6.6@aar') {
        transitive = true;
    }
//    implementation 'com.hokolinks:hoko:2.3.0'
    implementation 'cat.ereza:customactivityoncrash:1.5.0'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.google.android.gms:play-services-auth:15.0.1'
    implementation 'com.google.android.gms:play-services-base:15.0.1'
    implementation 'com.google.firebase:firebase-appindexing:15.0.1'
    implementation 'com.google.android.gms:play-services-appinvite:16.0.0'
    implementation 'com.google.android.gms:play-services-gcm:15.0.1'
    implementation 'com.google.android.gms:play-services-location:15.0.1'
    implementation 'com.google.android.gms:play-services-plus:15.0.1'
    implementation 'com.google.android.gms:play-services-maps:15.0.1'
    implementation 'com.github.jaydeepw:poly-picker:v1.0.22'
    implementation 'com.github.Commit451:NativeStackBlur:1.0.2'
    implementation 'com.github.Hitta:RippleEffect:82cf00e551'
    implementation 'com.github.zplesac:android_connectionbuddy:v1.0.7'
    implementation 'com.github.paolorotolo:expandableheightlistview:1.0.0'
    implementation 'com.github.tony19:timber-loggly:1.0.1'
    implementation 'com.neumob:neumob-android:3.7.2'
    implementation 'com.facebook.fresco:fresco:1.8.0'
    implementation 'com.firebase:firebase-client-android:2.5.2'
    implementation 'com.google.android.exoplayer:exoplayer:r1.5.10'
    implementation project(':common')
    implementation project(':commonwidget')
    implementation project(':videowidget')
    implementation 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-7'
    implementation project(':Spotlight-library')
    implementation 'com.onesignal:OneSignal:3.9.1@aar'
    implementation files('libs/YouTubeAndroidPlayerApi.jar')
    implementation files('libs/dropbox-android-sdk-1.6.3.jar')
    implementation 'com.pitt.fresh.library:freshdownloadview:1.0'
    implementation 'es.voghdev.pdfviewpager:library:1.0.1'
    implementation('com.crashlytics.sdk.android:answers:1.3.11@aar') {
        transitive = true;
    }
//    implementation 'com.bugsee:bugsee-android:+'
    implementation 'com.stripe:stripe-android:5.0.0'
    implementation 'com.google.firebase:firebase-core:16.0.0'
    implementation 'com.google.firebase:firebase-perf:16.0.0'
    implementation 'io.branch.sdk.android:library:2.18.1'
    implementation project(path: ':androidQuery')
    implementation 'com.onesignal:OneSignal:[3.9.1, 3.99.99]'
    implementation 'com.instabug.library:instabug:4.11.0'
    implementation ('io.branch.sdk.android:library:2.+') {
        exclude module: 'answers-shim'
    }
}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.firebase-perf'
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
        classpath 'com.google.gms:google-services:3.2.0'
        classpath 'com.google.firebase:firebase-plugins:1.1.1'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}
allprojects {
    repositories {
        jcenter()
        google()
        maven {
            url "https://maven.google.com" // Google's Maven repository
        }
    }
}

错误


主机名“repo.commonware.com.s3.amazonaws.com”与对等方提供的证书主题不匹配(CN=*.s3.amazonaws.com,O=Amazon.com Inc.,L=西雅图,ST=华盛顿,C=US)

这不是错误,而是警告。现在就不要麻烦了。 将此部分更改为:

之前:

repositories {
    jcenter()
}
之后:

repositories {
        jcenter()
        mavenCentral()
        google()
    }

您好,请更换或更新您的播放服务版本与贝娄,它将删除警告

classpath 'com.google.gms:google-services:3.2.0'

请附上错误的屏幕截图,因为这只是一条警告消息&即使有此警告消息,代码也能编译/运行良好。请检查更新的问题我认为在allproject->repository中添加google()可以解决您的问题请检查我更新的问题,现在这是错误。使用google()或maven{…}我很确定你不需要mavenCentral在这里请检查我的更新问题,现在这是错误。请检查我的更新问题,现在这是错误。我知道,但在我的成绩中,我得到了相同的警告,就像让你鞠躬一样,在参考了一些关于StackOverflow的问题后,我喜欢的解决方案,我建议你,它对我有效。