首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法解析AndroidJunit4

无法解析AndroidJunit4
EN

Stack Overflow用户
提问于 2018-06-19 03:18:15
回答 1查看 219关注 0票数 0

我已经在所有的论坛上搜索过了,但解决方案似乎对我没有帮助。它们都涉及到将我的测试转移到我已经拥有的androidTest上

这是我的文件夹结构的图片

这是我的build.gradle

代码语言:javascript
复制
buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
        jcenter()
        mavenCentral()
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
        classpath "com.newrelic.agent.android:agent-gradle-plugin:5.+"
    }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'newrelic'

repositories {
    jcenter()

    flatDir {
        dirs '../../xxx-native-app-android/trunk/baseline/UrbanAirshipLib/aars'
    }

    maven { url 'https://maven.fabric.io/public' }
    mavenCentral()
}


android {
    useLibrary 'org.apache.http.legacy'
    signingConfigs {
        config {
            keyAlias 'xxxkey'
            keyPassword ''
            storeFile file('../app/key/xxx_key.jks')
            storePassword ''
        }
    }

    compileSdkVersion 26
    buildToolsVersion '26.0.0'
    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 26
//        signingConfig signingConfigs.gtn
        signingConfig signingConfigs.config
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
        xxx {
            applicationId "com.bluestem.xxx.android"
            // both flavor should have same version and incremental
            versionCode 66
            versionName "1.1.3"
//            signingConfig signingConfigs.gtn
        }
        yyy {
            applicationId "com.bluestem.yyy.android"
            versionCode 21
            versionName "1.1.3"
//            signingConfig signingConfigs.gtn
        }
    }
    lintOptions {
        abortOnError false
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile project(path: ':custompin', configuration: 'default')
    compile project(path: ':view_pager_indicator_lib', configuration: 'default')
    compile 'com.android.support:appcompat-v7:26.1.0'
    compile 'com.android.support:support-v4:26.1.0'
    compile 'com.android.support:support-v13:26.1.0'
    compile 'com.android.support:recyclerview-v7:26.1.0'
    compile 'com.google.code.gson:gson:2.2.4'
    compile 'com.google.android.gms:play-services-gcm:7.0.0'
    compile 'com.squareup.okhttp:okhttp:2.7.5'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.jakewharton:butterknife:7.0.1'
    compile 'com.joooonho:selectableroundedimageview:1.0.1'
    compile 'com.joanzapata.pdfview:android-pdfview:1.0.4@aar'
    compile 'de.greenrobot:eventbus:2.4.0'
    compile 'com.urbanairship:urbanairship-lib:6.0.2@aar'
    compile 'org.parceler:parceler-api:1.0.1'
    compile 'com.wdullaer:materialdatetimepicker:1.4.2'
    compile 'com.newrelic.agent.android:android-agent:5.+'
    annotationProcessor "org.parceler:parceler:1.0.1"
    compile('com.crashlytics.sdk.android:crashlytics:2.5.6@aar') {
        transitive = true;
    }

    // https://mvnrepository.com/artifact/com.android.support.test/runner
    androidTestCompile 'com.android.support:support-annotations:26.1.0'
    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.0'
    androidTestCompile 'com.android.support.test:runner:0.5'
    androidTestCompile 'com.android.support.test:rules:0.5'
    androidTestCompile 'junit:junit:4.12'
    androidTestCompile 'org.hamcrest:hamcrest-library:1.3'
}

我已经尝试了我能想到的所有方法,重建项目,所有东西的不同版本。

有什么帮助吗?

EN

回答 1

Stack Overflow用户

发布于 2018-06-19 14:32:31

请按照以下步骤操作:

  • 打开应用程序的模块设置
  • 在依赖项选项卡下,单击'+‘并逐个添加依赖项
  • 单击apply

这应该是可行的。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50916143

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档