Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The latest support library v4 requires minSdk(API 20, L Preview)?

I'm trying to run a project with the Android Studio 0.8.0 beta and the latest tools, it requires API 20, so it fails to run on the device with API 19

Any ideas?

like image 617
Minas Avatar asked Jun 26 '14 21:06

Minas


People also ask

How do I add the v7 Appcompat support library to my project?

In the Properties window, select the "Android" properties group at left and locate the Library properties at right. Select /path/to/appcompat/ and Click Remove. Click Add to open the Project Selection dialog. From the list of available library projects, select v7 appcompat library and click OK.

Should you use legacy Android support libraries?

We recommend using the AndroidX libraries in all new projects. You should also consider migrating existing projects to AndroidX as well. So all Android apps should now aim to use AndroidX, instead of the old support library.

Which v7 support libraries are used for modifying UI settings?

v7 appcompat library Part of Android Jetpack. This library adds support for the Action Bar user interface design pattern. This library includes support for material design user interface implementations.

What is the Android support library?

The Android Support Library package is a set of code libraries that provide backward-compatible versions of Android framework APIs as well as features that are only available through the library APIs. Each Support Library is backward-compatible to a specific Android API level.


2 Answers

If you configured your gradle settings to compile the latest version of

  • 'com.android.support:support-v4:+'
  • 'com.android.support:appcompat-v7:+'

then the RC will be downloaded, which requires the L - Preview.

See the Answers here.

Use

  • 'com.android.support:support-v4:20.+'
  • 'com.android.support:appcompat-v7:20.+'

everywhere in your project instead.

like image 191
jonatbergn Avatar answered Nov 16 '22 00:11

jonatbergn


The problem still arises with transitive dependencies. Gradle offers a way to force the usage of a specific version of a dependency.

For example you can add something like:

configurations.all {
    resolutionStrategy {
        force 'com.android.support:support-v4:20.+'
        force 'com.android.support:appcompat-v7:20.+'
    }
}

to your build.gradle.

If you want to learn more about gradle resolution strategies refer to this guide http://www.gradle.org/docs/current/dsl/org.gradle.api.artifacts.ResolutionStrategy.html

I found this while reading the corresponding issue which I will link here

like image 39
koesclem Avatar answered Nov 16 '22 01:11

koesclem