ealden / gradle-androidannotations-plugin

AndroidAnnotations plugin for Gradle
http://androidannotations.org
Apache License 2.0
40 stars 10 forks source link

Android Studio and Gradle #8

Closed theDazzler closed 10 years ago

theDazzler commented 10 years ago

I'm trying to get AA to work in Android Studio using Gradle and nothing seems to work. This is the error I'm getting: : 20:21:07.345 [Daemon] ERROR o.a.h.AndroidManifestFinder:134 - Could not find the AndroidManifest.xml file, going up from path

This is a brand new android project. I haven't done anything except try to get AA working.

Here is my build.gradle file

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.7.+'
        // the latest version of the android-apt plugin
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.1'
    }
}

repositories {
    mavenCentral()
}

apply plugin: 'android'
apply plugin: 'android-apt'
def AAVersion = '3.0'

dependencies {
    apt "org.androidannotations:androidannotations:$AAVersion"
    compile "org.androidannotations:androidannotations-api:$AAVersion"
}

apt {
    arguments {
        // you can set annotation processing options here, like these commented options:
        // logLevel 'INFO'
        // androidManifestFile 'path to file'
    }
}

android {
    compileSdkVersion 19
    buildToolsVersion "19.0.0"

    defaultConfig {
        minSdkVersion 7
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }

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

dependencies {
    compile 'com.android.support:appcompat-v7:+'
}

I've tried changing the paths in the sourcesets but it doesn't work. How can I get this to work with Android Studio? The code in the wiki for Gradle does not work