Как решить не удалось найти метод compile () для аргументов com. android .support: recyclerview-v7: 25.3.1? - PullRequest
0 голосов
/ 07 марта 2020

В моей android сборке студии произошел сбой. Я не знаю, как так, затем я проверяю журнал и вижу эту ошибку

Ошибка: не удалось найти метод compile () для аргументов [com . android .support: recyclerview-v7: 25.3.1] для объекта типа org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

Пожалуйста, установите репозиторий поддержки Android из Android Менеджер SDK. Откройте Android SDK Manager

, затем я проверяю его, но репозиторий поддержки android уже установлен, версия 47.0.0. Я перезапускаю android studio, но он показывает ту же ошибку, как и я могу решить эту ошибку из android studio, пожалуйста, помогите мне решить эту проблему? Я думаю, что что-то не так на моем сборщике сборок, но я не могу понять, где что-то не так или что здесь происходит, это мой пример сборщика сборок -------

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
maven {
url "https://github.com/Blox/blox-android-sdk-releases/raw/master/"
}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.google.gms:google-services:3.0.0'
classpath 'com.android.tools.build:gradle:2.3.0'

    ext {
        compileSdkVersion = 23
        buildToolsVersion = "23.0.2"

        minSdkVersion = 14
        targetSdkVersion = 23

        sourceCompatibility = JavaVersion.VERSION_1_7
        targetCompatibility = JavaVersion.VERSION_1_7

        lintAbortOnError = false

        // Blox SDK version
        ext.qbSdkVersion = '3.3.1'

        ext.versionName = '3.3.0'

        ext.testRunnerVersion = "0.4.1"


        // Dependency versions
        playServicesVersion = '10.2.1'
        supportV4Version = '23.1.1'
        appcompatV7Version = '23.1.1'
        recyclerviewV7Version = '23.2.1'
        supportAnnotationsVersion = '23.1.1'
        designVersion = '23.1.1'

        uilVersion = '1.9.0'
        glideVersion = '3.6.1'
        pullToRefreshVersion = '3.2.3'
        stickyListHeaders = '2.7.0'
        robotoTextViewVersion = '2.4.3'
        stickersVersion = '0.7.3'
        crashlyticsVersion = '2.2.2'
    }


    compile "com.android.support:recyclerview-v7:25.3.1"
    compile "com.android.support:recyclerview-v7:27.1.1"
    compile "com.android.support:cardview-v7:23.+"
    compile "com.android.support:support-annotations:${rootProject.supportAnnotationsVersion}"

    compile "com.navercorp.pulltorefresh:library:${rootProject.pullToRefreshVersion}@aar"
    compile("com.crashlytics.sdk.android:crashlytics:${rootProject.crashlyticsVersion}@aar") {
        transitive = true;
    }
    compile 'com.github.bumptech.glide:glide:3.6.1'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
// Blox SDK version
qbSdkVersion = '3.3.1'

versionName = '3.4.1'

testRunnerVersion = "0.4.1"

allprojects {
    repositories {
        maven { url 'http://maven.pipe.com/artifactory/factory' }
        jcenter()
        maven { url "https://jitpack.io" }
    }
}

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

Android \ build gradle

`apply plugin: 'com.android.application'

android {
// signingConfigs {
// config {
// keyAlias 'abc'
// keyPassword 'abc'
// storeFile file(D:\Users\Lake\Desktop\myap_keystore\myap.jks)
// storePassword 'abc'
// }
// defaultConfig {
// applicationId "abcd.com.myap"
// minSdkVersion 19
// targetSdkVersion 23
// versionCode 1
// versionName "1.0"
// }
// }
compileSdkVersion 25
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "abc.com.myap"
minSdkVersion 23
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable true
// signingConfig signingConfigs.config
resValue "string", "versionName", "Blox WebRTC\nBuild version " + defaultConfig.getVersionName()
signingConfig signingConfigs.debug
}
}
// debug {
resValue "string", "versionName", "Blox WebRTC\nBuild version " + defaultConfig.getVersionName()
signingConfig signingConfigs.debug
}
// signingConfig signingConfigs.config
// debuggable true
// }
}
}
def pipeSdkVersion = '0.15.1'
dependencies {
compile "com.blox-android-sdk-videochat-webrtc:$rootProject.qbSdkVersion"

compile(project(":sample-core"))
// online dependencies, from remote repository, aar files

compile fileTree(include: ['*.jar'], dir: 'libs')
dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
}
androidTestCompile('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.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile 'com.google.firebase:firebase-core:9.2.0'
compile 'com.android.support:design:25.3.1'
compile 'junit:junit:4.12'
compile 'com.google.android.gms:play-services-appindexing:9.8.0'
compile 'com.android.support:gridlayout-v7:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.google.android.gms:play-services:11.0.4'
compile 'com.github.apl-devs:intro:v4.2.2'
compile("vc908.stickers:sfactory:$pipeSdkVersion") {
    transitive = true;
}
compile("vc908.stickers:gcmintegration:$pipeSdkVersion") {
    transitive = true;
}
compile("vc908.stickers:jpushintegration:$pipeSdkVersion") {
    transitive = true;
}
compile files('libs/StartAppInApp-3.6.3.jar')
compile 'com.blox:blox-android-sdk-core:2.5.1'
compile('com.blox:blox-android-sdk-chat:2.5.1@aar') {
    transitive = true
}
compile "com.blox:blox-android-sdk-chat:$rootProject.qbSdkVersion"
compile "com.blox:quickblox-android-sdk-content:$rootProject.qbSdkVersion"
compile "com.blox:quickblox-android-sdk-customobjects:$rootProject.qbSdkVersion"
compile "com.blox:quickblox-android-sdk-location:$rootProject.qbSdkVersion"
compile ("com.blox:blox-android-sdk-messages:$rootProject.qbSdkVersion" )
compile "com.github.johnkil.android-robototextview:robototextview:${rootProject.robotoTextViewVersion}"

apply plugin: 'com.google.gms.google-services'
}
`

[ПРИМЕЧАНИЕ: я использую javascript фрагменты здесь для правильного отображения кода]

1 Ответ

0 голосов
/ 07 марта 2020

Вы добавляете эти зависимости в build.gradle (Project)

compile "com.android.support:recyclerview-v7:25.3.1"
    compile "com.android.support:recyclerview-v7:27.1.1"
    compile "com.android.support:cardview-v7:23.+"
    compile "com.android.support:support-annotations:${rootProject.supportAnnotationsVersion}"

    compile "com.navercorp.pulltorefresh:library:${rootProject.pullToRefreshVersion}@aar"
    compile("com.crashlytics.sdk.android:crashlytics:${rootProject.crashlyticsVersion}@aar") {
        transitive = true;
    }
    compile 'com.github.bumptech.glide:glide:3.6.1' 

Вместо этого поместите зависимости в build.gradle (Module: app) и замените compile на реализацию, так как 'compile' устарел и был устаревшим заменено на «реализацию»

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...