Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
361 views
in Technique[技术] by (71.8m points)

java - android.support.v7.widget.CardView could not be found (Android Studio 1.1 Preview)

enter image description here

I'm trying to add CardView to my activity as the official sample. But it doesn't work.

If I run my project directly, it would lead to java.lang.ClassNotFoundException: android.support.v7.widget.CardView .

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You should add it to your build.gradle:

dependencies {
    ...
    implementation 'com.android.support:cardview-v7:21.+'
    implementation 'com.android.support:recyclerview-v7:21.+'
    ...
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...