【问题标题】:Android androidTestCompile espresso-core causing FileNotFoundException R.txtAndroid androidTestCompile espresso-core 导致 FileNotFoundException R.txt
【发布时间】:2017-07-19 12:46:01
【问题描述】:

我正在尝试添加

androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'

到我的 gradle 文件,但出现错误:

Error:Execution failed for task ':app:processProdDebugAndroidTestResources'.
> java.io.FileNotFoundException: /home/pstafford/workspace/mobile-android-ladenzeile/app/build/intermediates/symbols/androidTest/prod/debug/R.txt (No such file or directory)

有什么想法吗?

dependencies {

    compile 'com.appboy:android-sdk-ui:1.15.+'
    compile 'com.android.support:design:25.1.1'
    compile 'com.google.code.gson:gson:2.4'
    compile 'com.facebook.android:facebook-android-sdk:3.20.0'
    compile 'com.google.android.gms:play-services:9.8.0'
    compile 'com.squareup.okhttp:okhttp:2.1.0'
    compile 'com.squareup.okio:okio:1.0.1'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.viewpagerindicator:library:2.4.1'
    compile 'com.github.chrisbanes.photoview:library:1.2.2'
    compile 'com.android.support.test:runner:0.5'
    compile 'com.android.support.test:rules:0.5'
    compile 'com.facebook.stetho:stetho:1.3.1'
    compile 'com.facebook.stetho:stetho-okhttp:1.2.0'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.android.support:recyclerview-v7:25.1.1'
    compile 'com.android.support:appcompat-v7:25.1.1'
    compile 'com.android.support:preference-v7:25.1.1'
    compile 'com.android.support:support-annotations:25.1.1'
    compile 'com.android.support:support-v4:25.1.1'
    compile 'com.android.support:cardview-v7:25.1.1'

    testCompile 'com.android.support:support-annotations:25.1.1'
    testCompile 'com.android.support:design:25.1.1'
    testCompile 'org.mockito:mockito-core:2.7.11'
    testCompile 'org.powermock:powermock-api-mockito:1.6.4'
    testCompile 'org.powermock:powermock-module-junit4-rule-agent:1.6.6'
    testCompile 'org.powermock:powermock-module-junit4-rule:1.6.6'
    testCompile 'org.powermock:powermock-module-junit4:1.6.6'
    testCompile 'junit:junit:4.12'
    testCompile "org.robolectric:robolectric:3.2.2"
    testCompile "org.robolectric:shadows-multidex:3.0"




    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })


}

由于代码行太多,我必须添加几行 cmets。

【问题讨论】:

    标签: android android-espresso r.java-file


    【解决方案1】:
      androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
            exclude group: 'com.android.support', module: 'support-annotations'
        })
    
      Use this please ...
    

    【讨论】:

    • 感谢您的评论。我仍然有同样的问题。我将上传有关该问题的完整 gradle。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多