android powermock,Powermock在Android Studio中无法运行

郎欣然
2023-12-01

apply plugin: 'com.android.application'

android {

compileSdkVersion 27

defaultConfig {

applicationId "com.sachintitus.instafy.instafy"

minSdkVersion 24

targetSdkVersion 27

versionCode 1

versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

}

buildTypes {

release {

minifyEnabled false

proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

}

}

compileOptions {

targetCompatibility 1.8

sourceCompatibility 1.8

}

android {

testOptions {

unitTests {

includeAndroidResources = true

}

}

}

dependencies {

implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation 'com.android.support:appcompat-v7:27.1.1'

implementation 'com.android.support:support-v13:27.1.1'

implementation 'com.android.support:support-media-compat:27.1.1'

implementation 'com.android.support.constraint:constraint-layout:1.1.0'

implementation 'com.android.support:cardview-v7:27.1.1'

//my support implementations

implementation 'com.android.support:design:27.1.1'

//my support implementations

implementation 'com.google.firebase:firebase-auth:15.1.0'

implementation 'com.google.firebase:firebase-core:15.0.2'

implementation 'com.google.firebase:firebase-firestore:16.0.0'

implementation 'com.google.firebase:firebase-storage:15.0.2'

implementation 'com.firebaseui:firebase-ui-firestore:4.0.0'

//imageCropper

implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.+'

//imageCropper

//animations

implementation 'com.android.support:support-dynamic-animation:27.1.1'

//animations

//glide

implementation 'com.github.bumptech.glide:glide:4.7.1'

implementation 'com.android.support:support-v4:27.1.1'

annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'

//glide

//circleImageView

implementation 'de.hdodenhof:circleimageview:2.2.0'

//circleImageView

implementation 'com.google.android.gms:play-services-auth:15.0.1'

//guava

implementation group: 'com.google.guava', name: 'guava', version: '23.5-android'

def lifecycle_version = "1.1.1"

implementation "android.arch.lifecycle:extensions:$lifecycle_version"

implementation "android.arch.lifecycle:common-java8:$lifecycle_version"

annotationProcessor "android.arch.lifecycle:compiler:$lifecycle_version"

androidTestImplementation 'org.hamcrest:hamcrest-core:1.3'

androidTestImplementation 'junit:junit:4.12'

androidTestImplementation 'com.android.support.test:runner:1.0.2'

androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

// androidTestImplementation 'org.mockito:mockito-core:2.7.22'

androidTestImplementation 'org.mockito:mockito-core:2.4.0'

androidTestImplementation 'org.powermock:powermock-api-mockito:1.7.0RC2'

androidTestImplementation 'org.powermock:powermock-core:1.7.0RC2'

androidTestImplementation 'org.powermock:powermock-module-junit4:1.7.0RC2'

androidTestImplementation 'org.powermock:powermock-module-junit4-rule-agent:1.7.0RC2'

androidTestImplementation 'com.linkedin.dexmaker:dexmaker-mockito:2.16.0'

androidTestImplementation 'com.linkedin.dexmaker:dexmaker-mockito:2.2.0'

}

apply plugin: 'com.google.gms.google-services'

}

这是我的Android清单文件 . 我一直在尝试为我的项目启用 powermock 和 mockito . 我收到了几个错误!使用什么是正确的依赖项?

 类似资料: