now that i've decided to use Android Annotations with Android Studio i wanted to implement it through Gradle. After some thoughtful research i've found out that there are older and newer ways of implementing Android Annotations through Gradle depending on which version android studio, gradle or android annotations have. i came to this useful tutorial -> http://www.jayway.com/2014/02/21/androidannotations-setup-in-android-studio/ , and tried to implement this , at first, with the new 'android-L' as target SDK like
targetSDKversion "android-L" + compileSdkVersion 20 + buildToolsVersion "20.0.0"
until i tried it with
targetSDKversion 20 + compileSdkVersion 20 + buildToolsVersion "20.0.0"
and also
targetSDKversion 19 + compileSdkVersion 19 + buildToolsVersion "19.1.0".
Everytime i was getting 2 warnings that my java classes dont seem to get precompiled. even though it seems that it pre-creates the build/generated/source/apt directory. but without my pre-processed class from my MainActivity -> MainActivity_
I always do get following Warnings:
Note: Resolve log file to D:\AndroidProjects\GradleTest\app\build\generated\source\apt\androidannotations.log Note: Initialize AndroidAnnotations 3.0.1 with options >{androidManifestFile=D:\AndroidProjects\GradleTest\app\build\intermediates\manifests\debug\AndroidManifest.xml, resourcePackageName=at.gradle.defuex.gradletest}
warning: Unclosed files for the types '[dummy1407928544078]'; these types will not undergo annotation processing
warning: The following options were not recognized by any processor: '[androidManifestFile, resourcePackageName]'
My build.gradle file looks like this:
buildscript{
repositories{
mavenCentral()
}
dependencies{
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.3'
}
}
repositories{
mavenCentral()
}
apply plugin: 'com.android.application'
apply plugin: 'android-apt'
android {
compileSdkVersion 19
buildToolsVersion "19.1.0"
defaultConfig {
applicationId "at.gradle.defuex.gradletest"
minSdkVersion 10
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
signingConfigs{
releaseConfig{
storeFile file("gradlekeystore.jks");
storePassword ("*************");
keyAlias "keyAlias";
keyPassword "*************";
}
}
buildTypes {
release {
runProguard false
debuggable false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.releaseConfig
}
debug {
debuggable true
applicationIdSuffix ".debug"
}
}
}
apt {
arguments {
androidManifestFile variant.processResources.manifestFile
resourcePackageName "at.gradle.defuex.gradletest"
}
}
dependencies {
apt "org.androidannotations:androidannotations:3.0+"
compile "org.androidannotations:androidannotations-api:3.0+"
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:19.+'
}
Im using following Versions:
- Android Studio version 0.8.2
- Gradle version 0.12.2
- android-apt version 1.3
- android annotations version 3.0.1 (as seen in the build.gradle file)
- If there should be a solution to this problem please tell me, because im confused now.
- If there should be a better annotations framework or a way of using cool annotations, please tell me that too.
- And if it should not be a common way anymore to use annotations for android projects anyway, please pleeeeease tell me that too.
,but i would prefer a solution to my problem :)
Cheers!