0

I'm new to Android Studio im facing the below error.

ERROR: Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve project :floatinglibrary. Show Details Affected Modules: app

ERROR: Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve project :datetimepickerlibrary. Show Details Affected Modules: app

ERROR: Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve project :BottomBar. Show Details Build. Gradle App Affected Modules: app enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

1 Answers1

0

You are using 3 libraries: floatinglibrary, datetimepickerlibrary and BottomBar. But gradle cannot find these libraries where you told it that they are.

In your build.gradle you define the dependency as implementation project(:BottomBar). :BottomBar is a reference to a library. You can also find this reference in your settings.gradle file where you can also set the file path to it like this:

include ':BottomBar', ':other', ':libraries'

project(':BottomBar').projectDir = new File('the/file/path')

where "this/file/path" ist relative to the project root.

In rare cases AndroidStudio gets confused due to caching issues. So you may also try File -> Invalid Caches and restart in the Android Studio menu.

Another reason may be found here: Android studio 3.0: Unable to resolve dependency for :app@dexOptions/compileClasspath': Could not resolve project :animators

muetzenflo
  • 5,653
  • 4
  • 41
  • 82
  • this is the build.gradle of your project folder. And only half of it. Please post the "dependencies" part of the build.gradle in your app folder. – muetzenflo Sep 23 '19 at 12:07
  • required screenshot added –  Sep 23 '19 at 12:08
  • please check now –  Sep 23 '19 at 12:09
  • Hi, @muetzenfo yeah, you are correct the folder exists in the directory but not included in the project. So how to include it in the project. For details refer screenshots –  Sep 23 '19 at 12:13
  • i added two more possible solutions: Try invalidate caches of Android Studio. Try the gradle setup as described in the other SO post. It's either something wrong with the library paths or some internal cache problem of Android Studio. – muetzenflo Sep 23 '19 at 12:28
  • hi @muetzenflo on the last question I have added a last screenshot.Which shows the folders are not included in the project how to included it –  Sep 23 '19 at 12:39
  • either just copy them into your project or you have to set the path in the settings.gradle as I described in my answer: `project(':BottomBar').projectDir = new File('the/file/path')` – muetzenflo Sep 23 '19 at 12:40
  • if this answer helped you solving your problem it is common courtesy to mark it as correct answer. Also to help others with the same problem in the future to find the answer quicker. – muetzenflo Sep 23 '19 at 16:05