android-studio – 测试运行失败:权限拒绝:启动检测ComponentInfo

android-studio – 测试运行失败:权限拒绝:启动检测ComponentInfo,第1张

概述测试运行失败:权限拒绝:从pid = 766开始检测ComponentInfo {com.xxx.taskmanager.warehouse.tests / android.test.InstrumentationTestRunner},不允许使用uid = 766因为包com.xxx.taskmanager.warehouse.tests不允许有一个匹配目标com.xxx.taskmanager 测试运行失败:权限拒绝:从pID = 766开始检测ComponentInfo {com.xxx.taskmanager.warehouse.tests / android.test.InstrumentationTestRunner},不允许使用uID = 766因为包com.xxx.taskmanager.warehouse.tests不允许有一个匹配目标com.xxx.taskmanager.warehouse的签名
空的测试套件.
这是我的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 16buildToolsversion "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 deleteApkclean.mustRunAfter deleteApkcopyTask.mustRunAfter assembleRelease

}

我认为这个错误正在发生,因为我没有为测试包声明signedConfigs.如果是这样,我该如何申报. ?
请帮忙. !

解决方法 我已经解决了这个问题.回答它,以便它对其他人有用. 解决方案适用于AndroID Studio: 要运行测试,构建变量应该是deBUG. Build Variants窗口出现在androID studio的左侧,如果没有激活,则点击androID studio左侧的Build variants选项卡激活它. 总结

以上是内存溢出为你收集整理的android-studio – 测试运行失败:权限拒绝:启动检测ComponentInfo全部内容,希望文章能够帮你解决android-studio – 测试运行失败:权限拒绝:启动检测ComponentInfo所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1137418.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-30
下一篇 2022-05-30

发表评论

登录后才能评论

评论列表(0条)

保存