Android Annotations in Android Studio 0.8.9

I'm new to Android Studio and gradle, so I'm not sure how to properly set up my project to use android annotations.

I followed this tutorial and ended up with this build.gradle file:

buildscript {
   repositories {
      mavenCentral()
   }
   dependencies {
      classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4+'
   }
}

apply plugin: 'com.android.application'
apply plugin: 'android-apt'

android {
   compileSdkVersion 20
   buildToolsVersion '20.0.0'

   defaultConfig {
      applicationId "com.example.test"
      minSdkVersion 11
      targetSdkVersion 20
      versionCode 1
      versionName "1.0"
   }
   buildTypes {
      release {
         runProguard false
         proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
      }
   }
}

configurations {
   apt
}

apt {
   arguments {
      androidManifestFile variant.processResources.manifestFile
      resourcePackageName "com.example.test"
   }
}

dependencies {
   compile fileTree(dir: 'libs', include: ['*.jar'])
   apt "org.androidannotations:androidannotations:3.0+"
   compile "org.androidannotations:androidannotations-api:3.0+"
   compile 'com.android.support:appcompat-v7:20.0.0'
}

      

The .idea / compiler.xml file has also changed to enable annotation processing

<profile default="true" name="Default" enabled="true">

      

Gradle syncs successfully, however no file is generated. I can create an application, but when I try to add an underline to the AndroidManifest.xml file, it gives me this error:

Cannot resolve symbol 'MainActivity_'

What am I doing wrong?

+3
android android-studio gradle android-annotations


source to share


No one has answered this question yet

See similar questions:

0
Android Android with android studio

or similar:

3606
Close / hide Android soft keyboard
3295
Why is the Android emulator so slow? How can we speed up the development of an Android emulator?
3288
Correct use cases for Android UserManager.isUserAGoat ()?
2609
Is there a unique identifier for an Android device?
1345
Where can I put the "assets" folder in Android Studio?
1214
Rename package in Android Studio
1206
What is Gradle in Android Studio?
947
Android Studio: add jar as library?
2
Can't open layout in Android Studio
1
Could not find class 'dalvik.system ....'



All Articles
Loading...
X
Show
Funny
Dev
Pics