Minas
Minas

Reputation: 1422

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?

Upvotes: 7

Views: 5030

Answers (2)

koesclem
koesclem

Reputation: 169

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

Upvotes: 6

jonatbergn
jonatbergn

Reputation: 420

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.

Upvotes: 11

Related Questions