Could not determine the dependencies of task ':app:crashlyticsStoreDeobsDebug' if I enable the proguard
Asked Answered
S

18

111

I get following error when I was running an app within Android Studio 2.

Gradle tasks [:app:assembleDebug]
Could not determine the dependencies of task ':app:crashlyticsStoreDeobsDebug'.
> Task with path 'dexDebug' not found in project ':app'.
BUILD FAILED

Here is the build.gradle for module

buildscript {
    repositories {
        maven { url 'http://download.crashlytics.com/maven' }
        maven { url "http://dl.bintray.com/populov/maven" }
    }

    dependencies {
        classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
    }
}

apply plugin: 'com.android.application'
apply plugin: 'crashlytics'

repositories {
    maven { url 'http://download.crashlytics.com/maven' }
    maven { url "http://dl.bintray.com/populov/maven" }
    maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}

android {
    compileSdkVersion 23
    buildToolsVersion '23.0.2'

    defaultConfig {
        minSdkVersion 17
        targetSdkVersion 19
    }


    buildTypes {
        debug {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile 'com.android.support:appcompat-v7:23.+'
    compile 'com.crashlytics.android:crashlytics:1.+'
}

The error is gone if I set the minfyEnabled to "false". But I do want it enabled.

Here is the build.gradle in project level.

buildscript {
    repositories {
        mavenCentral()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.0.0-alpha3'
    }
}

allprojects {
    repositories {
        maven { url "http://dl.bintray.com/populov/maven" }
        mavenCentral()
        jcenter()
    }
}

The error is also gone if I replace "2.0.0-alpha3" to "1.3.1". But I do want "2.0.0" because I want the "Instant Run" feature.

Here is the gradle-wrapper.properties.

#Mon Dec 21 14:43:00 CST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip

Does anyone know how to fix it? Thank you.

Stevie answered 22/12, 2015 at 17:17 Comment(2)
Just run flutter clean and rebuild your app. The issue came when a previous build was cancelled before completion. I didn't have to revert any of my dependencies.Scalping
try accepting the licences before building. checkout this: #54273912Felker
T
14

I had the same issue a few days ago and I found this thread Twitter Developer Forum that points to some incompatibility with versions of gradle/build-tools/crashalics.

My problem was slightly different from yours as I'm not using alpha-3 I'm using 1.5. But on my update I also changed to the latest gradle distribution gradle-2.9-all.zip.

So probably/maybe you can fix it by changing to the latest gradle version. But If it does not work, you'll really have to be patient and wait until build tools V2.0 is not in alpha anymore OR the Crashalitycs team, fix the incompatibility.

Tlemcen answered 22/12, 2015 at 17:36 Comment(3)
I had the same problem and I updated to the latest version of Crashlytics (as of today it is io.fabric.tools:gradle:1.21.2 for the plugin and com.crashlytics.sdk.android:crashlytics:2.5.5 for the library, and that fixed the issue. I am using the gradle android plugin 2.0.0-alpha3 (it also works with 1.5.0).Scansion
You have to check if it is not because of the Proguard. You have to disable minify.Homopterous
for me, disabling minify on debug works, and I'm still able to build my production app with minify enabled.Igorot
A
26

Full combo of build/ clean project + build/ rebuild project + file/ Invalidate caches / restart works for me!

Anemophilous answered 2/1, 2019 at 16:5 Comment(4)
Please share the code for aboveBelldas
@Belldas that's not code, those are options in the menu of the Android Studio (or IntelliJ) IDEBaumgartner
@Baumgartner you missed the jokeChengteh
Thank you! It worked for me for Ionic v7 (Angular) + Capacitor I successfully built my .APK fileProudfoot
T
14

I had the same issue a few days ago and I found this thread Twitter Developer Forum that points to some incompatibility with versions of gradle/build-tools/crashalics.

My problem was slightly different from yours as I'm not using alpha-3 I'm using 1.5. But on my update I also changed to the latest gradle distribution gradle-2.9-all.zip.

So probably/maybe you can fix it by changing to the latest gradle version. But If it does not work, you'll really have to be patient and wait until build tools V2.0 is not in alpha anymore OR the Crashalitycs team, fix the incompatibility.

Tlemcen answered 22/12, 2015 at 17:36 Comment(3)
I had the same problem and I updated to the latest version of Crashlytics (as of today it is io.fabric.tools:gradle:1.21.2 for the plugin and com.crashlytics.sdk.android:crashlytics:2.5.5 for the library, and that fixed the issue. I am using the gradle android plugin 2.0.0-alpha3 (it also works with 1.5.0).Scansion
You have to check if it is not because of the Proguard. You have to disable minify.Homopterous
for me, disabling minify on debug works, and I'm still able to build my production app with minify enabled.Igorot
L
10

I was facing the same issue when integrating Firebase Cloud Store in my project. Inside the project level gradle, I added

classpath 'com.google.gms:google-services:4.0.1'

that fixed the issue.

Lubra answered 12/4, 2019 at 8:51 Comment(0)
G
6

You can run this command in your project directory. Basically it just cleans the build and gradle.

   cd android && rm -R .gradle && cd app && rm -R build

In my case, I was using react-native using this as a script in package.json

"scripts": { "clean-android": "cd android && rm -R .gradle && cd app && rm -R build" }
Gratifying answered 19/1, 2021 at 11:25 Comment(0)
R
5

Running ./gradlew assembleDebug command on Android Studio Terminal had solved my problem.

Rosetta answered 9/12, 2019 at 11:20 Comment(0)
S
5

I was facing the same issue, I resolved this by replacing dependencies in App level Build.gradle file

"""

implementation 'com.google.firebase:firebase-analytics:17.2.2'
implementation 'androidx.multidex:multidex:2.0.0'
testImplementation 'junit:junit:4.12'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
androidTestImplementation 'com.androidx.support.test:runner:1.1.0'
androidTestImplementation 'com.androidx.support.test.espresso:espresso-core:3.1.0'

BY

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation platform('com.google.firebase:firebase-bom:26.1.1')
implementation 'com.google.firebase:firebase-analytics'
implementation 'androidx.multidex:multidex:2.0.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.androidx.support.test:runner:1.1.0'
androidTestImplementation 'com.androidx.support.test.espresso:espresso-core:3.1.0'

This resolves my issue.

Snakemouth answered 1/2, 2021 at 15:52 Comment(0)
W
3

In place of 1.+ use the latest version of crashlytics -

 dependencies {
        classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
    }

you should use this way -

dependencies {
            classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:2.6.8'
        }

your problem will be resolved for sure. Happy coding !!

Winnick answered 17/8, 2017 at 5:27 Comment(0)
I
3

build.gradle

allprojects {
    repositories {
        google()
        mavenLocal()
        jcenter()
        maven {
            url 'https://maven.google.com'
        }
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
    }
}
Ibanez answered 29/6, 2020 at 10:11 Comment(0)
T
3

Go To Files>Settings>System Settings> Android SDK> Enable Android SDK Command-Line Tools (latest) in SDK Tools and press OK. Step 1

Then go to terminal and

flutter doctor --android-licenses

and accept all the licenses

Step 2

Techno answered 17/10, 2021 at 10:41 Comment(0)
C
2

Steps to fix:

  1. Run flutter clean in terminal.

  2. Run your app again.

Cepheus answered 20/8, 2020 at 8:41 Comment(1)
Please add more details to your answer in regards to what flutter is, etc. for users who do not have it.Globeflower
R
2

I had the same issue with my project. I solved it by Downgrading my google-services version to 4.1.0 in my project's build.gradle file.

  buildscript {
dependencies {
    classpath 'com.google.gms:google-services:4.1.0' //decreased from 4.2.0
 }
}
Redundancy answered 18/3, 2021 at 11:39 Comment(0)
D
1

I had similar issue with below error:

Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.

It started when I added below dependency in Gradle:

    implementation 'com.google.android.gms:play-services-tagmanager:11.0.4'

I fixed it by upgrading the dependency version as below:

implementation 'com.google.android.gms:play-services-tagmanager:17.0.0'
Dewhurst answered 26/4, 2020 at 8:43 Comment(0)
O
1

I didn't specify the sdk.dir in my local.properties file

Ot answered 21/4, 2021 at 8:10 Comment(0)
D
1

I solved the same problem by updating build.gradle like below:

    buildscript {
    ext.kotlin_version = "1.5.10"
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.2.1"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.3.8'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
Decern answered 7/6, 2021 at 7:6 Comment(0)
C
1

You have to sync sdk path with correct one

sdk.dir

Columbuscolumbyne answered 18/7, 2021 at 18:18 Comment(0)
M
0

Upping SolArabhetty's answer, these steps worked for me:
1. Invalidating caches (Files -> Invalidate Caches)
2. Clean Project (Build -> Clean)
3. Re-build project (Build -> Rebuild Project)

Manxman answered 8/11, 2022 at 3:41 Comment(0)
V
0

For me, the issue was Android SDK PATHS needed to repath it. Doing source ~/.bash_profile fixed it.

In others' cases, it can be source ~/.zshrc or source ~/.bashrc.

Villus answered 2/2, 2023 at 9:0 Comment(0)
B
0

If none of the above has worked, check if you project is running on the correct Java version (SDK), changing the SDK to the correct one fixed the issue for me.

Here is how to change the project SDK if you are using IntelliJ:

  1. Open Project Settings: Open your project in IntelliJ IDEA.

  2. Access Project Structure: Go to the "File" menu at the top left corner and select "Project Structure." Alternatively, you can use the shortcut Ctrl + Alt + Shift + S (or Cmd + ; on macOS).

  3. Select Project: In the Project Structure dialog, on the left side, you'll see a list of settings. Select "Project" under "Project Settings."

  4. View Project SDK: On the right side, you will see a section labeled "Project SDK." Here, you can see the Java version currently used for your project. It will display the path to the JDK and the Java version, such as "1.8" or "11."

Bostow answered 11/8, 2023 at 9:8 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.