Android Espresso : cannot resolve symbol AndroidJUnit4.class处理办法备忘
来源:互联网 发布:淘宝网登录不上 编辑:程序博客网 时间:2024/06/05 16:58
我是在dependencies中加了以下配置后,gradle同步后就解决了。
// Set this dependency to use JUnit 4 rules androidTestCompile 'com.android.support.test:rules:0.3' // Set this dependency to build and run Espresso tests androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2' // add this for intent mocking support androidTestCompile 'com.android.support.test.espresso:espresso-intents:2.2' // add this for webview testing support androidTestCompile 'com.android.support.test.espresso:espresso-web:2.2' // Set this dependency to build and run UI Automator tests androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.1' androidTestCompile 'com.android.support.test.espresso:espresso-contrib:2.2'
完整的gradle
apply plugin: 'com.android.application'android { compileSdkVersion 25 buildToolsVersion "25.0.1" defaultConfig { applicationId "cn.com.zifar.sqllite1" minSdkVersion 23 targetSdkVersion 25 versionCode 1 versionName "1.0"// //ADD THIS LINE: testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } //ADD THESE LINES: packagingOptions { exclude 'LICENSE.txt' }}dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:25.0.1' androidTestCompile 'junit:junit:4.12'// //Add this line,the version must same with compile's version androidTestCompile 'com.android.support:support-annotations:25.0.1'// Set this dependency to use JUnit 4 rules androidTestCompile 'com.android.support.test:rules:0.3' // Set this dependency to build and run Espresso tests androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2' // add this for intent mocking support androidTestCompile 'com.android.support.test.espresso:espresso-intents:2.2' // add this for webview testing support androidTestCompile 'com.android.support.test.espresso:espresso-web:2.2' // Set this dependency to build and run UI Automator tests androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.1' androidTestCompile 'com.android.support.test.espresso:espresso-contrib:2.2'}参考:http://stackoverflow.com/questions/32175847/android-espresso-cannot-resolve-symbol-androidjunit4-class
0 0
- Android Espresso : cannot resolve symbol AndroidJUnit4.class处理办法备忘
- Cannot resolve symbol XXX 处理
- Android Studio --“Cannot resolve symbol”
- Android:Cannot resolve symbol’R’
- Android Studio --“Cannot resolve symbol”
- android Cannot resolve symbol'R'
- Android Studio :cannot resolve symbol R
- android studio Cannot resolve symbol 'R'
- android studio cannot resolve symbol R
- cannot resolve symbol r android studio
- ANDROID STUDIO “CANNOT RESOLVE SYMBOL” 解决办法
- android studio 的 cannot resolve symbol R
- Android Studio “Cannot resolve symbol xxx” 解决办法
- Android Studio “Cannot resolve symbol” 解决办法
- android studio cannot resolve symbol 'R'
- Android Studio “Cannot resolve symbol” 解决办法
- Android Studio --“Cannot resolve symbol” 解决办法
- InterlliJ /Android Studio “Cannot resolve symbol” 解决办法
- Codeforces 742C Arpa's loud Owf 思维
- 第15周项目3 B-树的基本操作
- 【第十五周 项目1 (2)—验证直接插入排序】
- tf学习
- 初学MFC——对话框
- Android Espresso : cannot resolve symbol AndroidJUnit4.class处理办法备忘
- Android 开发者福利Google Developers中国网站发布
- Android 关于Shape画ring和line的问题
- 第15周项目2-用哈希法组织关键字
- 使用ItemDecoration 为 RecyclerView设置可 推动的 悬浮导航栏效果
- 实施远程项目常见的问题及总结
- Java反射机制详解
- 所学6
- 多个activity怎么共享一个socket,实际应用中怎么保持socket的长连接?