我按照本指南在Android Studio 1.3.0 RC1上使用gradle-experimental:0.1.0构建了一个ndk混合项目.
一切都很好,但如果我尝试添加测试库依赖项,我发现该方法androidTestCompile
不再受支持.像这样:
并且testCompile
还会导致同样的错误.
官方指南没有谈到这一点.那么,我该如何添加添加测试依赖性gradle-experimental或者这个版本不支持这个功能呢?
这是我的build.gradle(项目):
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle-experimental:0.1.0'
}
}
allprojects {
repositories {
jcenter()
}
}
Run Code Online (Sandbox Code Playgroud)
这是build.gradle(moudle):
apply plugin: 'com.android.model.application'
model {
android {
compileSdkVersion = 22
buildToolsVersion = "23.0.0 rc3"
defaultConfig.with {
applicationId = "co.yishun.onemoment.app"
minSdkVersion.apiLevel = 15
targetSdkVersion.apiLevel = 22
versionCode = 5 …
Run Code Online (Sandbox Code Playgroud)