Failed to resolve: com.google.android.material:material:1.0.0-alpha1

前端 未结 6 1994
暗喜
暗喜 2020-12-17 08:36

So I\'m following the official documentation to add the Material Components library to my project https://github.com/material-components/material-components-android/blob/mas

相关标签:
6条回答
  • FOR ANDROIDX USERS.
    You can implement as follows...

    AndroidX
    implementation 'com.google.android.material:material:1.0.0-alpha3'

    Old build artifact users can use the following implementation
    implementation 'com.android.support:design:[Enter Design library version here]'

    *use that version without square brackets.
    you can find design library version via this link : https://mvnrepository.com/artifact/com.android.support/design/28.0.0-alpha1

    0 讨论(0)
  • 2020-12-17 09:14

    Thought I'd share what fixed this for me now that I|O has started.

    I had about the same initial setup as you. To get it working I had to change the following:

    • compileSdkVersion to 'android-P'
    • Support Libraries to '28.0.0-alpha1'
    • include api 'com.android.support:design:28.0.0-alpha1' in the dependencies block.
    • SDK Platform update - Android P Preview (latest)
    • targetSdkVersion 'P'

    I then did the ritualistic 'Invalidate Caches / Restart' and rebuilt the project for good measure.

    0 讨论(0)
  • 2020-12-17 09:26

    For androidx users: My problem got solved by just updating all the dependencies with latest version. It got solved in just 2 minutes. My previous version was 1.0.2 and showed same error. I just clicked on 'Show in Project Structure dialog' which appeared below the error. From there you will get options to update dependencies to latest version. For users other than androidx might be the same soution works.

    0 讨论(0)
  • 2020-12-17 09:36

    Instead of:

    implementation 'com.google.android.material:material:1.1.0'
    

    Use:

       implementation group: 'com.google.android.material', name: 'material', version: '1.1.0-alpha05'
    

    And it works.

    0 讨论(0)
  • 2020-12-17 09:36
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    androidTestImplementation 'androidx.test:runner:1.2.0'`
    
    0 讨论(0)
  • 2020-12-17 09:40

    Make sure your gradle.properties enabled AndroidX using the following Line:

    android.useAndroidX = true
    

    If not added then add this line and sync project again

    Visit For More Details

    0 讨论(0)
提交回复
热议问题