找不到参数的方法 compile() [com.android.support:cardview-v7:27.0.2]



我尝试将两个项目结合起来。我的SDK已更新,但是每次运行代码时都会收到此错误。

Error:(19, 0) Could not find method compile() for arguments 
[com.android.support:cardview-v7:27.0.2] on object of type 
org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Please install the Android Support Repository from the Android SDK Manager.

我的所有支持存储库都已下载。寻找这个解决方案太久了,但失败了。这是我的android/app/build.gradle文件的代码。

apply plugin: 'com.android.application'
android {
     compileSdkVersion 27
defaultConfig {
    applicationId "pingo.betnek.hospiva"
    minSdkVersion 17
    targetSdkVersion 27
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
}
}
repositories {
    mavenCentral()
 }
allprojects {
repositories {
    jcenter()
    maven {
        url "https://maven.google.com"
    }
}
}
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:27.0.2'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:27.0.2'
//    compile 'cn.pedant.sweetalert:library:1.3'
compile 'com.github.f0ris.sweetalert:library:1.5.1'
compile 'com.android.support:cardview-v7:27.0.2'
compile 'com.google.firebase:firebase-database:11.8.0'
compile 'com.google.firebase:firebase-storage:11.8.0'
compile 'com.google.firebase:firebase-auth:11.8.0'
compile 'com.android.support:recyclerview-v7:27.0.2'
testCompile 'junit:junit:4.12'
// For Alert Notifications from top
compile 'com.tapadoo.android:alerter:2.0.1'
 }

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

请帮助我度过难关。

我遇到了同样的问题,只是将其更改为

compile "com.android.support:appcompat-v7:27.0.0"

相关内容

  • 没有找到相关文章

最新更新