3

Im using Android studio 0.4.2 (Gradle project) with AA

My gradle.build looks like below

apply plugin: 'android'

android {
    compileSdkVersion 17
    buildToolsVersion "17.0.0"


    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
        }
    }

......

dependencies {
    compile 'com.android.support:support-v4:19.0.0+'
    compile 'com.android.support:appcompat-v7:19.0.0+'
    compile 'com.googlecode.androidannotations:androidannotations-api:2.7.1'
    compile 'com.googlecode.androidannotations:androidannotations:2.7.1'
    compile fileTree(dir: 'libs', include: '*.jar')
}

android.applicationVariants.each { variant ->
    println 'Generation dir: ' + annotationDirs
    variant.javaCompile.dependsOn annotationsDir
    variant.javaCompile.options.compilerArgs += [
            '-processor', 'com.googlecode.androidannotations.AndroidAnnotationProcessor',
            '-s', annotationDirs
    ]
}

in my project I just use genereted java class like replaceFragment(new RegistrationFragment_()); , this is a correct way to use annotated class and it works well when I run build task, but IDE shows me an error - 'cannot resolve symbol RegistrationFragment_'. All gen _.java files are stored in PROJECT_NAME\app\build\classes\debug\com\witness\app\RegistrationFragment_.java. How can I fix this?

Gorets
  • 2,414
  • 5
  • 25
  • 43

0 Answers0