Reputation: 393
In Android studio, I just want to define a custom project structure for android project(follow this, http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Project-Structure), but when run: ./gradlew tasks I got the error: A problem occurred evaluating root project 'greendao-example'.
No signature of method: org.gradle.api.java.archives.internal.DefaultManifest.srcFile() is applicable for argument types: (java.lang.String) values: [AndroidManifest.xml]
The build.gradle is:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
apply plugin: 'android'
apply plugin: 'java'
repositories {
mavenCentral()
}
dependencies {
compile 'com.android.support:support-v4:13.0.+'
}
android {
testBuildType = "debug"
defaultConfig {
versionCode = 1
versionName = "0.1"
minSdkVersion = 9
targetSdkVersion = 17
compileSdkVersion = 17
buildConfig "private final static boolean DEFAULT = true;", \
"private final static String FOO = \"foo\";"
}
buildTypes {
debug {
packageNameSuffix = ".debug"
buildConfig "private final static boolean DEBUG2 = false;"
}
}
aaptOptions {
noCompress "txt"
}
sourceSets {
manifest.srcFile 'AndroidManifest.xml'
}
}
Upvotes: 2
Views: 5202
Reputation: 131
You need to add the manifest to the main sourceSet.
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
}
}
See the migrated example in the gradle samples from Google: http://tools.android.com/tech-docs/new-build-system/gradle-samples-0.5.zip
Upvotes: 3