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:cr
Running ./gradlew assembleDebug command on Android Studio Terminal had solved my problem.
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" }
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"
}
}
}
Steps to fix:
Run flutter clean
in terminal.
Run your app again.
Full combo of build/ clean project + build/ rebuild project + file/ Invalidate caches / restart works for me!
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.