In my build.gradle file I have the support library dependencies:
compile \"com.android.support:appcompat-v7:22.2.0\"
compile \"com.android.support:recyclervi
Try this:
// Testing dependencies
androidTestCompile 'com.android.support.test:runner:0.4.1'
androidTestCompile 'com.android.support.test:rules:0.4.1'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1'
androidTestCompile 'com.android.support.test.espresso:espresso-intents:2.2.1'
androidTestCompile('com.android.support.test.espresso:espresso-contrib:2.2.1') {
exclude group: 'com.android.support', module: 'appcompat'
exclude group: 'com.android.support', module: 'support-v4'
exclude module: 'support-annotations'
exclude module: 'recyclerview-v7'
}
Try this in your build.gradle:
androidTestCompile ('com.android.support.test.espresso:espresso-contrib:2.2'){
exclude group: 'com.android.support', module: 'appcompat-v7'
exclude group: 'com.android.support', module: 'support-v4'
exclude module: 'recyclerview-v7'
}
I have the same problem about error inflating class recycler view, and tried several times with various codes, finally i resolved this problem with added these codes in project gradle:
androidTestCompile 'com.android.support.test.espresso:espresso-intents:2.2.1'
androidTestCompile ('com.android.support.test.espresso:espresso-core:2.2.1') {
exclude module: 'support-annotations'
}
androidTestCompile ('com.android.support.test.espresso:espresso-contrib:2.2.1') {
exclude module: 'support-annotations'
exclude module: 'support-v4'
exclude module: 'recyclerview-v7'
}
Secondly, you have to make sure you're using card view and recycler view in the latest version:
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
Then you can run your test which has recycler view in it's activity layout. It'll work fine and no error happens again.