2

in my Gradle build im not able to set the manifest path for a sourceset. Here is the block of code in question:

sourceSets{
        manifest.srcFile 'AndroidManifest.xml' //im getting a error here
        main.res.srcDirs += 'src/main/res-other'
        betatest.java.srcDirs = ['src/qaInt/java']
        betatest.res.srcDirs = ['src/qaInt/res']
        betatest.assets.srcDirs = ['src/qaInt/assets']
    }

The error im getting is that there is no such method srcFile in manifest. How do i set the manifest path for a sourceSet ?

Error:Gradle DSL method not found: 'srcFile()'

my gradle dependencies look like this:

 dependencies {
    classpath 'com.android.tools.build:gradle:1.3.0'
    classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
}

im on android studio 2.0 preview 4 but same issue occurs on android studio 1.5

UPDATE: I just realized sourceSets closure is handling multiple things not just for betatest. So what i really want is to change the bestatest flavor's androidmanifest. I want to set its path. So really , how do i set the path of the androidmanifest for a flavor ?

j2emanue
  • 60,549
  • 65
  • 286
  • 456

1 Answers1

-1

It seems that you need to check/add that this line:

apply plugin: 'com.android.application'

Is at the top of you app module build.gradle file, before the android { }.

The android stuff goes to a module (subdirectory) specific build.gradle, not the project-level that usually just configures repositories and so on

Please also share your build.gradle file the one that has this settings, to help you further

android { compileSdkVersion 19 buildToolsVersion "19.0.0" sourceSets {
Mauricio Gracia Gutierrez
  • 10,288
  • 6
  • 68
  • 99