当前位置: 首页 > 知识库问答 >
问题:

AS 3.0测试专用模块无法在以下项目配置中进行选择:abcMobile:

吕天逸
2023-03-14

我为android UI测试创建了仅测试模块。它与AS2.3找到工作,但当我升级到AS3.0我看到下面的问题:

>Cannot choose between the following:
configurations of project :abcMobile:
 - normalDebugApiElements
 - xxxDebugApiElements
 - yyyDebugApiElements
 - zzzDebugApiElements
All of them match the consumer attributes:
 - Configuration 'normalDebugApiElements':
     - Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible value 'debug'.
     - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Apk' and found compatible value 'Apk'.
     - Found com.android.build.gradle.internal.dependency.VariantAttr 'normalDebug' but wasn't required.
     - Found market 'normal' but wasn't required.
     - Required org.gradle.api.attributes.Usage 'java-api' and found compatible value 'java-api'.
 - Configuration 'xxxDebugApiElements':........

以下是来自仅测试模块的渐变片段:android{compileSdkVersion project.ext.compileSdkVersion targetProjectPath':abcMobile'targetVariant'normalDebug'

defaultConfig {
    applicationId "com.abc.mobile.functional.tests"
    minSdkVersion project.ext.ebayMinSdkVersion
    targetSdkVersion project.ext.ebayTargetSdkVersion
    multiDexEnabled true
} 
buildTypes {
    debug {........
           .....
    }
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

dependencies {
implementation project(':xyz')

implementation group: 'org.apache.httpcomponents' , name: 'httpclient-android' , version: '4.3.5.1'
....
....
....
....
}

共有1个答案

张浩阔
2023-03-14

通过添加missingDimensionStrategy'解决了此问题

有关更多详细信息,请参阅:https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html#flavor_dimensions

 类似资料:
  • null client.admin(eclipse-plugin打包) client.admin.test.fragment(eclipse-test-plugin packaging) sonar.junit.reportsPath sonar.jacoco.reportpath, sonar.jacoco.itreportpath sonar.core.codecoveragePlugin s

  • 问这个问题的另一种方法是: 如何使用Azure个人访问令牌验证项目,以便maven build可以下载发布在

  • 下面是select选项的代码段: 我试过: 这给了我以下错误: 有谁能帮我解决这个问题,或者说我可能做错了什么。

  • 我在eclipse中设置了一个“Maven项目”(简单项目),并为其添加了类和单元测试。测试运行良好。 但是,当我在“src/main/java”中添加“module info.java”时,单元测试未能启动: 信息:“workspace2”是我工作区的名称,“unittest”是项目名称。 如果我通过控制台运行maven(相同的maven和java版本),它运行良好。 设置: -eclipse:

  • 问题内容: 我正在尝试使用量角器从下拉菜单中选择一个选项进行角度e2e测试。 这是select选项的代码片段: 我努力了: 这给我以下错误: 指定了无效或非法字符串Build info:版本:‘2.35.0’,修订版:’c916b9d’,时间:‘2013-08-12 15:42:01’系统信息:os.name:’Mac OS X’ ,os.arch:’x86_64’,os.version:‘10

  • 我正在开发一款Android Wear手表,在测试/使用我的掌上电脑配置活动时遇到了一些问题。虽然我对Android开发一般来说并不陌生,但这是我的第一个watchface应用程序,因此如果其中一些问题很明显,请参阅适当的文档。 我有我的可穿戴模块和手持模块。目前手持模块只有一个活动作为伴侣配置。 我有两个问题: 当通过通过USB连接到计算机的手持设备连接的磨损模拟器进行测试/调试时,我如何启动伴