Reputation: 9103
In Android Studio, I'm implementing some libraries in the gradle file to be used in my app, these libraries got added to the external libraries section in the project, each with it's own version.
Now when I delete the dependency of one of these libraries from my gradle file, it's not getting deleted from the external libraries section, and it's extracted classes can be imported and used normally in the app, which is a big ques mark for me.
Also when changing one of these libraries version(downgrading at my case), the updated version is not getting reflected in the external libraries section, and instead, the version in the external libraries section is the one who is used in the app, which forces me to use a version that I don't want to use.
I've tried "build project" and even "invalidate and restart" but nothing changes, what am I missing here?!!
Upvotes: 4
Views: 1947
Reputation: 14500
The most likely explanation, and confirmed in comments of another answer, is that the library that was declared as a first level dependency also was a transitive dependency of another library.
Similarly for the version, when changing it on the first level dependency declaration, it was still upgraded to another version through a transitive dependency and conflict resolution.
Upvotes: 2
Reputation: 76807
in directory .idea/libraries
there's a cached xml
file, which has to be deleted.
also "invalidate caches and restart" should cause this to refresh.
Additionally, there are further caches; build directory/directories and ~/.gradle/caches in the user profile... or there might be some other module, which still has it referenced.
Upvotes: 4