Ashu Kumar
Ashu Kumar

Reputation: 832

Could not find property 'GROUP' on project Name File: build.gradle

I'm new to Android Studio so do not know how gradle works. Maybe it is a silly question.

Whenever I tried to import the GitHub project as module in my project and try to build the project, I always get this error:

Could not find property 'GROUP' on project build.gradle

I know Group need to recognize the project name. I tried to find the answer for this question but there is not much reference available, so I am posting the question here.

Recently I tried to import Fresco as module in project and got the same error.

Question is

  1. Why am I getting this error?
  2. How does the gradle build project?

Here is my build.gradle:

apply plugin: 'com.android.library'
apply plugin: 'maven'

project.group = GROUP
version = VERSION_NAME

dependencies {
    compile "com.android.support:support-v4:${SUPPORT_V4_VERSION}"
    provided "com.google.code.findbugs:jsr305:${JSR_305_VERSION}"
    provided "javax.annotation:javax.annotation-api:${ANNOTATION_API_VERSION}"

    compile project(':fbcore')

    testCompile "junit:junit:${JUNIT_VERSION}"
    testCompile "org.mockito:mockito-core:${MOCKITO_CORE_VERSION}"
    testCompile("org.robolectric:robolectric:${ROBOLECTRIC_VERSION}") {
        exclude group: 'commons-logging', module: 'commons-logging'
        exclude group: 'org.apache.httpcomponents', module: 'httpclient'
    }
}

apply from: rootProject.file('release.gradle')

android {
    buildToolsVersion rootProject.ext.buildToolsVersion
    compileSdkVersion rootProject.ext.compileSdkVersion

    packagingOptions {
        exclude 'NOTICE'
        exclude 'LICENSE'
        exclude 'LICENSE.txt'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
    }
}

task sourcesJar(type: Jar) {
    from android.sourceSets.main.java.srcDirs
    classifier = 'sources'
}
artifacts.add('archives', sourcesJar)

Upvotes: 2

Views: 4300

Answers (1)

Henry
Henry

Reputation: 43738

Replace GROUP and VERSION_NAME with actual values, for example:

project.group = 'the.group.of.my.module'
version = '1.0'

EDIT: you can write value project.group anything. but it should unique and identify your module name. in my case i wrote project.group = 'com.facebook.fresco'

Hope it will help future Visitors and save their time.

Credited goes to @Henry

Upvotes: 3

Related Questions