我试图将TestFairy与我的项目集成。我使用Android Studio 0.8.2 Beta。
有一个例子:https://github.com/testfairy/testfairy-gradle-plugin
这是我的 build.gradle :
repositories {
maven { url 'http://clinker.47deg.com/nexus/content/groups/public';; }
maven { url 'https://www.testfairy.com/maven';; }
}
apply plugin: 'com.android.application'
apply plugin: 'testfairy'
android {
compileSdkVersion 19
buildToolsVersion '20.0.0'
defaultConfig {
minSdkVersion 14
targetSdkVersion 19
versionCode 1
versionName '1.0'
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
productFlavors {
}
testfairyConfig {
apiKey "Here is my real api key"
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.2'
compile 'org.roboguice:roboguice:2.0'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.android.support:support-v4:19.+'
compile 'com.google.android.gms:play-services:4.2.42'
compile 'se.emilsjolander:stickylistheaders:2.3.0'
classpath 'com.testfairy.plugins.gradle:testfairy:1.+'
}
我得到的错误是:
错误:(6,0)带有id' testfairy'的插件没找到。
热修复它?
答案 0 :(得分:5)
我的猜测是,您只在应用程序的存储库关闭中添加了TestFairy依赖项。 buildcript应该有另一个存储库块,在我的项目中它位于根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:0.12.+'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
这使您可以为构建依赖关系和应用程序依赖关系定义彼此之间的存储库。