0

I'm using android-apt:1.2 and gradle:1.10 to build an android-library with included androidannotations (3.0.1). All the code is compiled correctly excluding some 'cannot find symbol' errors in statements in my code where I must use directly the generated classes (in androidannotations to use @Pref you must use the generated class: https://github.com/excilys/androidannotations/wiki/SharedPreferencesHelpers). Maybe I've an error in my use of the plugin, someone have already used android-apt plugin with androidannotations referencing the generated classes in own source?

Here is my gradle build:

apply plugin: 'android-library'
apply plugin: 'android-apt'

def AndroidAnnotationsVersion = '3.0.1'

android {
    compileSdkVersion 19
    buildToolsVersion "19.0.3"

    defaultConfig {
        minSdkVersion 10
        targetSdkVersion 19
    }

    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    apt "org.androidannotations:androidannotations:$AndroidAnnotationsVersion"
    compile "org.androidannotations:androidannotations-api:$AndroidAnnotationsVersion"
    compile files('libs/androidannotations-api-3.0.1.jar')
    compile files('libs/gson-2.2.2.jar')
    compile files('libs/ormlite-android-4.41.jar')
    compile files('libs/ormlite-core-4.41.jar')
    compile files('libs/spring-android-core-1.0.0.RELEASE.jar')
    compile files('libs/spring-android-rest-template-1.0.0.RELEASE.jar')
}

apt {
    arguments {
        androidManifestFile variant.processResources.manifestFile
        resourcePackageName 'xxx'
    }
}

Thanks for the help.

botteaap
  • 5,790
  • 3
  • 29
  • 35
jean71
  • 143
  • 6
  • I don't use AA myself, but others have reported that this should work fine. Source should be generated in build/apt unless there's an error processing your sources by AA. Here's a test project that uses AA and generated fragments code https://bitbucket.org/hvisser/android-apt-example. – botteaap Apr 25 '14 at 07:36
  • By the way, referencing generated code is one of the main reasons I created `android-apt` and I use it on a daily basis for that :) – botteaap Apr 25 '14 at 07:42
  • It's really strange, I've downloaded your example project and added a use of @Pref and it builds correctly while in my project I've the cannot find symbol error. I've generated my project importing it from an eclipse project but I don't think this may be a problem. Besides now the gradle files are identical. – jean71 May 09 '14 at 07:45

0 Answers0