Skip to content Skip to sidebar Skip to footer

Android Setting Androidannotations Using Gradle At Androidstudio Not Show Layout

I was learning the gradle and AndroidAnnotations framework in android studio. But I encounter the problems at the initial...= = And then I create a new project using android studio

Solution 1:

You also have to add the processor as an apt dependency and a processing argument which tells AA the location of the manifest using the android-apt plugin. Also do not forgot to change your manifest to point to the generated Activity (underscore at end).

Check out the Gradle instructions:https://github.com/excilys/androidannotations/wiki/Building-Project-Gradle.

Or start from the example project:https://github.com/excilys/androidannotations/tree/develop/examples/gradle

So basically add these to your script, too:

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

apply plugin: 'android-apt'defAAVersion = '3.3.1'

dependencies {
    compile'com.android.support:appcompat-v7:22.2.0'
    apt "org.androidannotations:androidannotations:$AAVersion"compile"org.androidannotations:androidannotations-api:$AAVersion"
}

apt {
    arguments {
        androidManifestFile variant.outputs[0].processResources.manifestFile
    }
}

Solution 2:

dependencies {
    def aaVersion = "4.7.0"

    annotationProcessor "org.androidannotations:androidannotations:${aaVersion}"
    implementation "org.androidannotations:androidannotations-api:${aaVersion}"
} 

If you are using implementation then annotationProcessor is working, not apt.

Post a Comment for "Android Setting Androidannotations Using Gradle At Androidstudio Not Show Layout"