theguru42
theguru42

Reputation: 3378

Gradle build error: Cannot get property 'dirName' on null object

I am getting gradle build error:

Error: Cannot get property 'dirName' on null object

I get this error with gradle version 1.3.1 or greater.

When I use gradle version 1.2.3 there is no error.

I google this error but was not able to find any solution. Please help!

My project gradle file:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        maven { url "http://dl.bintray.com/populov/maven"  }
        mavenCentral()
        jcenter()
        flatDir { dirs '/usr/local/DexGuard6.1.19/lib' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.2.3'
        classpath ':dexguard:'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    } 
}

allprojects {
    repositories {
        maven { url "http://dl.bintray.com/populov/maven" }
        maven { url "https://repo.commonsware.com.s3.amazonaws.com" }
        maven { url 'https://maven.fabric.io/public' }
        maven { url "https://jitpack.io" }
        mavenCentral()
        jcenter()
    }
}

Upvotes: 1

Views: 4111

Answers (1)

Eric Lafortune
Eric Lafortune

Reputation: 45668

The Android Gradle plugin is still evolving, with changing tasks and internals. You have to make sure you update the DexGuard Gradle plugin accordingly.

  • For Android plugin 1.3.1, you'll need DexGuard 7.0.01 or higher.
  • For Android plugin 1.5.0, you'll need DexGuard 7.0.31 or higher

Upvotes: 1

Related Questions