简体   繁体   中英

Failed to resolve: com.google.android.material.material:1.0

I've been trying to get the floatingActionButton to work but it seems it's not working due to my gradle dependencies, the gradle code is shown below please i need some help on this,

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "-------------"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    implementation 'com.google.android.material.material:1.0.0-alpha1;'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

}

There's a typo in your dependency definition. Remove semi-colon at end and replace . with : between com.google.android.material and material:1.0.0-alpha1

So all together, change

implementation 'com.google.android.material.material:1.0.0-alpha1;'

To

implementation 'com.google.android.material:material:1.0.0-alpha1'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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