ivy_the
ivy_the

Reputation: 280

Does Android Studio use appcompat v7 even if not required?

After migrating from eclipse my APK size grew roughly by 1.5MB. Checking in the .iml file I see: <orderEntry type="library" exported="" name="appcompat-v7-22.0.0" level="project" /> I guess AS includes appcompat always. Even if not required by build.gradle script and not used in the app.

R.java also has tons of references to appcompat.

I repeat my build.gradle has no reference to appcompat:

dependencies {
    compile 'com.android.support:support-v4:22.2.0'
    compile 'com.google.android.gms:play-services:7.5.0'
}

Does anybody have this issue?

Upvotes: 2

Views: 423

Answers (2)

Priya B
Priya B

Reputation: 96

Google Play Services version com.google.android.gms:play-services:7.5.0 or above now uses appcompat-v7, you have to use the previous version of play services:

compile 'com.google.android.gms:play-services:7.0.0'.

It's better described in this post https://stackoverflow.com/a/32096389/5135768

Upvotes: 4

Gabriele Mariotti
Gabriele Mariotti

Reputation: 364684

Check your build.gradle in your module.

If the dependencies block contains

dependencies {
    compile 'com.android.support:appcompat-v7:XX.X.X'
}

it means that your app is using AppCompat.

If you don't use it, remove this line from the build.gradle and sync the project.

Upvotes: 0

Related Questions