测试运行失败:权限拒绝:从pid = 766开始检测ComponentInfo {com.xxx.taskmanager.warehouse.tests /
android.test.InstrumentationTestRunner},不允许使用uid = 766因为包com.xxx.taskmanager.warehouse.tests不允许有一个匹配目标com.xxx.taskmanager.warehouse的签名
空的测试套件.
这是我的app.gradle文件
空的测试套件.
这是我的app.gradle文件
apply plugin: 'android-sdk-manager' apply plugin: 'com.android.application' android { signingConfigs { release { keyAlias 'xxx' keyPassword 'xxx' storeFile file('../keystore.jks') storePassword 'xxx' } } compileSdkVersion 16 buildToolsVersion "21.1.2" defaultConfig { applicationId "com.xxx.taskmanager.warehouse" minSdkVersion 16 targetSdkVersion 16 versionCode 3 versionName "3.0" testApplicationId "com.xxx.taskmanager.warehouse.tests" } packagingOptions { exclude 'Meta-INF/LICENSE.txt' exclude 'Meta-INF/LICENSE' exclude 'LICENSE' exclude 'NOTICE' exclude 'Meta-INF/NOTICE' exclude 'Meta-INF/NOTICE.txt' exclude 'Meta-INF/ASL2.0' } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro' signingConfig signingConfigs.release } } applicationVariants.all { variant -> variant.outputs.each { output -> output.outputFile = new File( output.outputFile.parent,"FLO_HANDHELD_V${variant.versionName}.apk" ) } } variantFilter { variant -> if(variant.buildType.name.equals('debug')) { variant.setIgnore(true); } } productFlavors { production_b2b { applicationId "com.xxx.taskmanager.warehouse" minSdkVersion 16 targetSdkVersion 16 versionCode 3 versionName "3.1-Prod-B2B" } stage_b2b { applicationId "com.xxx.taskmanager.warehouse" minSdkVersion 16 targetSdkVersion 16 versionCode 3 versionName "3.1-Stage-B2B" } production_b2c { applicationId "com.xxx.taskmanager.warehouse" minSdkVersion 16 targetSdkVersion 16 versionCode 3 versionName "3.1-Prod-B2C" } stage_b2c { applicationId "com.xxx.taskmanager.warehouse" minSdkVersion 16 targetSdkVersion 16 versionCode 3 versionName "3.1-Stage-B2C" } } } dependencies { compile fileTree(dir: 'libs',include: ['*.jar']) compile files ('libs/android-support-v7-appcompat.jar') compile files('libs/android-support-v4.jar') compile project(':taskmanagerlib') compile files('libs/DataCollection.jar') androidTestCompile fileTree(dir: 'libs',include: 'robotium-solo-5.3.0.jar') } task copyTask(type: Copy) { from 'build/outputs/apk' into 'apks' exclude '**/*-unaligned.apk' } task deleteApk(type: org.gradle.api.tasks.Delete){ // delete 'apks' } task appBuild(dependsOn: ['deleteApk','clean','assembleRelease','copyTask']){ assembleRelease.mustRunAfter deleteApk clean.mustRunAfter deleteApk copyTask.mustRunAfter assembleRelease
}
我认为这个错误正在发生,因为我没有为测试包声明signedConfigs.如果是这样,我该如何申报. ?
请帮忙. !