1

I tried many options from google and stackoverflow. Android studio 0.4.6 and aa 2.7.1. My build.gradle looks like this

buildscript {
repositories {
    mavenCentral()
}
dependencies {
    classpath 'com.android.tools.build:gradle:0.7.+'
}
}
apply plugin: 'android'

repositories {
    mavenCentral()
}


android {
    compileSdkVersion 19
    buildToolsVersion "19.0.1"

    defaultConfig {
        minSdkVersion 8
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}
ext.daggerVersion = '1.0.0';
ext.androidAnnotationsVersion = '2.7.1';

configurations {
    apt
}

dependencies {
    compile 'com.android.support:appcompat-v7:+'
    apt "com.googlecode.androidannotations:androidannotations:${androidAnnotationsVersion}"
    compile "com.googlecode.androidannotations:androidannotations-api:${androidAnnotationsVersion}"
    apt "com.squareup.dagger:dagger-compiler:${daggerVersion}"
    compile "com.squareup.dagger:dagger:${daggerVersion}"
}

I've checked Activities_ in AndroidManifest.xml too.

If this quesion were not banned due to other "similar" questions I would prefer answers from people who did it with exacly the same as version. I know there will be next version's and maybe new questions but this looks litle tricky imho. Even though android development with aa is very robust.

"sync project with gradle files", clean, rebuild etc brings no effect.

EDIT:

I tryied with

ext.daggerVersion = '1.2.0';
ext.androidAnnotationsVersion = '3.0.1';

but it brings no result.

After switching to: classpath 'com.android.tools.build:gradle:0.8.+' and ext.daggerVersion = '1.2.0';

it builds succesfully but outputs with:

Default Activity not found

I checked Error: Default Activity Not Found with no effect.

Community
  • 1
  • 1
Jacob
  • 14,949
  • 19
  • 51
  • 74

1 Answers1

1

It looks like you need to add the android-apt dependency within the BuildScript dependencies and let gradle know to use it as a plugin.

buildscript {
repositories {
    mavenCentral()
}
dependencies {
    classpath 'com.android.tools.build:gradle:0.8.+'
    classpath 'com.neenbedankt.gradle.plugins:android-apt:1.2'
    }
}
apply plugin: 'android'
apply plugin: 'android-apt'

This is my apt config section, you may need other settings but this should get you started

apt {
arguments {
    resourcePackageName android.defaultConfig.packageName
    androidManifestFile variant.processResources.manifestFile
}
}

Lot's more info here: https://bitbucket.org/hvisser/android-apt

Jed
  • 8,022
  • 3
  • 19
  • 19