Problem resolving dependencies NPE with (no error message)


(Fahed) #1

I have a dependencies problem on my Android Project (Android Studio 3.1.3) and I want to learn how to solve it by myself, but the

gradlew :app:dependencies

command is giving me hard time, please help me. This is my scan:

https://scans.gradle.com/s/62hk5jsdd73xc


(François Guillot) #2

Hi

The build scans tells us there is a problem during the configuration phase of your build, especially for the :app sub-project.
Given the stacktrace of your problem, I’d say it’s a wrong use of the android gradle plugin.
It’s hard to tell more without looking at your build script. Maybe you can ask on the android user group and show them your stacktrace?


(Fahed) #3

Thank you for the answer.

Here is my top level gradle:

buildscript {

repositories {
    google()
    jcenter()
    mavenCentral()
    maven {
        url 'https://maven.fabric.io/public'
    }

}
dependencies {
    classpath 'com.android.tools.build:gradle:3.1.3'
    classpath "com.google.gms:google-services:4.0.1"
    classpath 'io.fabric.tools:gradle:1.25.4'
}

}

allprojects {
repositories {
google()
jcenter()
maven {
url ‘https://maven.google.com/
}
maven {
url ‘https://jitpack.io
}
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

And my app module gradle:

apply plugin: “com.android.application”
apply plugin: ‘io.fabric’

def supportVersion = ‘27.1.1’

android {
signingConfigs {
config {
keyAlias “garishat”
keyPassword “987456”
storeFile file(“D:/Fahed/LocalProjects/Android/Garishat/keys.jks”)
storePassword “Garisha@789”
}
}
compileSdkVersion 27
defaultConfig {
applicationId “com.test.test”
minSdkVersion 17
targetSdkVersion 27
versionCode 5
versionName “1.2.0”
multiDexEnabled true
testInstrumentationRunner “android.support.test.runner.AndroidJUnitRunner”
}

buildTypes {
    release {
        minifyEnabled true
        shrinkResources true
        proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
        signingConfig signingConfigs.config
    }
    debug {
        signingConfig signingConfigs.config
    }
}
dataBinding {
    enabled = true
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}
configurations.all {
    resolutionStrategy.force "com.android.support:cardview-v7:$supportVersion"
    resolutionStrategy.force "com.android.support:animated-verctor-drawable:$supportVersion"
    resolutionStrategy.force "com.android.support:customtabs:$supportVersion"
}

}

dependencies {

implementation fileTree(include: ["*.jar"], dir: "libs")
implementation "com.android.support:appcompat-v7:$supportVersion"
implementation "com.android.support:design:$supportVersion"
implementation "com.android.support:support-v4:$supportVersion"
testImplementation "junit:junit:4.12"
androidTestImplementation "com.android.support.test:runner:1.0.2"
androidTestImplementation "com.android.support.test.espresso:espresso-core:3.0.2"
implementation "com.android.support.constraint:constraint-layout:1.1.2"
implementation "com.squareup.picasso:picasso:2.5.2"
implementation "com.nineoldandroids:library:2.4.0"
implementation "com.daimajia.slider:library:1.1.5@aar"
implementation "com.android.volley:volley:1.1.0"
implementation "com.google.code.gson:gson:2.8.2"
implementation 'org.jsoup:jsoup:1.10.3'
implementation "com.facebook.android:facebook-android-sdk:4.34.0"

implementation "com.google.firebase:firebase-core:16.0.1"
implementation "com.google.firebase:firebase-messaging:17.0.0"
implementation "com.google.firebase:firebase-ads:15.0.1"
implementation "com.google.android.gms:play-services-base:15.0.1"
implementation "com.google.android.gms:play-services-auth:15.0.1"
implementation "com.google.android.gms:play-services-location:15.0.1"
implementation "org.jetbrains:annotations:15.0"

implementation 'com.crashlytics.sdk.android:crashlytics:2.9.4'
implementation 'com.android.support:multidex:1.0.3'

}

apply plugin: “com.google.gms.google-services”


(Fahed) #4

I solved this by using:

org.gradle.java.home=C\:\\Program Files\\Java\\jdk1.8.0_181 in the gradle.proprieties file