Error when adding CardView to layout

前端 未结 7 1271
借酒劲吻你
借酒劲吻你 2020-12-17 15:20

I wanted to try out the new toys that google gave us and I\'ve run into some trouble.

Here is my build.gradle:

apply plugin: \'com.android.applicatio         


        
7条回答
  •  独厮守ぢ
    2020-12-17 16:05

    I was able to get it to work on the emulator by changing my build.gradle to this:

    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile 'com.android.support:cardview-v7:+'
    }
    

    Make sure you have the support repository installed from the SDK Manager! Hope this helps

    EDIT: as someone suggested using 'com.android.support:cardview-v7:23.1' is a better practice but it not required.

提交回复
热议问题