将Dagger-2添加到Android Studio

将Dagger-2添加到Android Studio,android,android-studio,dependencies,dagger-2,android-instrumentation,Android,Android Studio,Dependencies,Dagger 2,Android Instrumentation,我以前问过这个问题,它说明仪器化对棒棒糖和更高版本不起作用。经过一些深入的搜索,我发现我们应该添加Dagger-2,与项目一起编译。我使用了此处提供的与gradle相关的步骤: 这是我的身材。格雷德尔: buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:1.1.0' classpa

我以前问过这个问题,它说明
仪器化
棒棒糖
和更高版本不起作用。经过一些深入的搜索,我发现我们应该添加
Dagger-2
,与项目一起编译。我使用了此处提供的与gradle相关的步骤:

这是我的身材。格雷德尔:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.1.0'
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'

android {
    compileSdkVersion 19
    buildToolsVersion "19.1.0"

    defaultConfig {
        applicationId "com.project.android.vecsat"
        minSdkVersion 10
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:19.0.0'
    compile 'com.android.support:support-v4:19.0.0'
    apt 'com.google.dagger:dagger-compiler:2.0.2'
    compile 'com.google.dagger:dagger:2.0.2'
    provided 'org.glassfish:javax.annotation:10.0-b28'
    compile project(':libraries:opencv')

}
这是app/build.gradle:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.1.0'
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'

android {
    compileSdkVersion 19
    buildToolsVersion "19.1.0"

    defaultConfig {
        applicationId "com.project.android.vecsat"
        minSdkVersion 10
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:19.0.0'
    compile 'com.android.support:support-v4:19.0.0'
    apt 'com.google.dagger:dagger-compiler:2.0.2'
    compile 'com.google.dagger:dagger:2.0.2'
    provided 'org.glassfish:javax.annotation:10.0-b28'
    compile project(':libraries:opencv')

}
同步项目后,没有修复任何内容。仪器仍然不工作。我在这里找到了另一个指南:

但是,我不知道把DaggerJAR文件放在哪里,我也不知道
JavaGradle
在哪里


谁能帮帮我吗?向项目中添加
Dagger-2
的正确步骤是什么

查看教程。它将指导you@iAnum谢谢我看到它使用了两个类,我不需要创建类,我只需要调用instrumentation来模拟触摸事件,在这种情况下我如何添加dagger?