Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where's appcompat dependency comes from?

Tags:

android

In my Android project app module, I have this: implementation 'androidx.appcompat:appcompat:1.5.0.

And my activity is class AppActivity : AppCompatActivity().

Then I changed my theme to material design by adding implementation 'com.google.android.material:material:1.8.0'

At this point I'm not sure if I should delete appcompat, I think I can't because AppCompatActivity comes from it. As I want to prove it, so I deleted implementation 'androidx.appcompat:appcompat:1.5.0, after sync all goes well.

Also I can check the AppCompatActivity is from appcompat:1.5.0(sorry for the image is not that clear)

enter image description here

So my question is where is it from as I have deleted it?

To find if it's from any other libraries, I tried add it back but upgrade it to 1.6.1: implementation 'androidx.appcompat:appcompat:1.6.1'

Then If it's using from any other libraries it should be still 1.5.0.

But I got:

enter image description here

Anyway to know about it? Thanks!

EDIT

As the accepted answer described, use Project structures -> Dependencies.

At the first I tried this too but didn't find out my answer, here I expand a bit more. e.g.

I selected: androidx.appcompat:appcompat:1.5.0 Then on the right side Target Module/Artifacts it shows your module you want to check where's it from. Here is my project image:

enter image description here

Then I know it's from material:1.8.0 I can delete appcompat anyway. It's not from 3rd party libraries.

like image 804
William Hu Avatar asked Sep 15 '25 09:09

William Hu


1 Answers

If using AndroidStudio, check this way. Go to project structure -> Dependencies -> <All Modules> scroll AppCompat library and click the undesired version, this should show you the detail dependencies.

enter image description here

like image 113
Watermelon Avatar answered Sep 16 '25 22:09

Watermelon