Skip to content

Instantly share code, notes, and snippets.

@Pierry
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Pierry/b3eab411c8865573b985 to your computer and use it in GitHub Desktop.
Save Pierry/b3eab411c8865573b985 to your computer and use it in GitHub Desktop.
Buidle Gradle - Root and App
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
}
}
repositories {
mavenCentral()
mavenLocal()
}
apply plugin: 'com.android.application'
apply plugin: 'android-apt'
def AAVersion = '3.1'
dependencies {
compile 'com.android.support:appcompat-v7:21.0.0'
apt "org.androidannotations:androidannotations:$AAVersion"
compile "org.androidannotations:androidannotations:$AAVersion"
}
apt {
arguments {
androidManifestFile variant.outputs[0].processResources.manifestFile
resourcePackageName 'your complete manifest package name'
}
}
android {
compileSdkVersion 21 (Important!)
buildToolsVersion '20.0.0' (Important!)
defaultConfig {
minSdkVersion 11
targetSdkVersion 21
}
sourceSets {
main {
manifest.srcFile 'src/main/AndroidManifest.xml'
java.srcDirs = ['src/main/java', 'build/generated/source/apt/${variant.dirName}']
resources.srcDirs = ['src/main/res']
res.srcDirs = ['src/main/res']
assets.srcDirs = ['assets']
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
}
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
}
}
allprojects {
repositories {
mavenCentral()
}
}
@kozlowskijakub
Copy link

How about the:
"Error: Could not find property 'processResources' on com.android.build.gradle.internal.api.ApplicationVariantImpl_Decorated@48f217d0."
that points to:
"androidManifestFile variant.processResources.manifestFile" ?

@Pierry
Copy link
Author

Pierry commented Dec 9, 2014

change:
androidManifestFile variant.processResources.manifestFile

to:
androidManifestFile variant.outputs[0].processResources.manifestFile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment