7

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?

Minas
  • 1,422
  • 16
  • 29
  • 1
    Tools do not require any API level. Projects do. – CommonsWare Jun 26 '14 at 21:20
  • 1
    Yeah you are right, I mean this is related to the latest tools, because it appeared right after I installed it – Minas Jun 26 '14 at 21:25
  • 1
    possible duplicate of [Manifest merger failed : uses-sdk:minSdkVersion 14](http://stackoverflow.com/questions/24438170/manifest-merger-failed-uses-sdkminsdkversion-14) – hichris123 Jun 27 '14 at 16:40

2 Answers2

11

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.

Community
  • 1
  • 1
jonatbergn
  • 410
  • 5
  • 10
6

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

koesclem
  • 169
  • 4