Gradle не может найти плагин

Я пытаюсь интегрировать TestFairy с моим проектом. Я использую Android Studio 0.8.2 Beta.

Официальный сайт: http://testfairy.com/

Вот пример как это работает: 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) Плагин с идентификатором 'testfairy' не найден.

Горячий, чтобы это исправить?

1 ответ

Решение

Я предполагаю, что вы добавили зависимость TestFairy только в закрытие хранилища вашего приложения. Должен быть еще один блок репозиториев для buildscript, в моем проекте он находится в корневом файле 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
    }

}

Это позволяет вам определять репозитории для зависимостей сборки и приложений друг от друга.

Другие вопросы по тегам