Error minSdkVersion 1 cannot be smaller than version 4

Asked

Viewed 82 times

0

I’m studying a script and at the time of building the project it accuses version problem, but only I’m having this problem in my class.

  <uses-sdk android:minSdkVersion="1" android:targetSdkVersion="1" />

Error:(5, 5) uses-sdk:minSdkVersion 1 cannot be smaller than version 4 declared in library C: Player aALibV4 build Intermediates exploded-Aar projects with.android.support support-v4 21.0.3 Androidmanifest.xml

It would be the Android version I used to build the project the problem?

  • Wouldn’t you want to change the version to a more current one? 22 for example. You tried to copy another student’s project and test?

2 answers

1

There is no version "1" android, so the error message. Utilze the 19, for example, which is the Kitkat.

Place: <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="19" />.

Don’t forget to update the build.gradle.

  • He would also have to execute a Clean Project nay?

  • 1

    It may be necessary. It should wait a while for there to be a project Sync. A message is displayed in the tool.

  • If the answer solves your problem, please mark it as correct by "ticking" the green mark below the answer score.

1

This error happens because you are setting a minimum version in your project (version 1), but it is importing a library that needs a higher version to work (version 4). In your case, it’s the Android compatibility library: com.android.support:support-v4.

You can fix this by modifying the android:minSdkVersion="1" for android:minSdkVersion="16", which encompasses since version 4.1 of Android (Jellybean) and which covers about 90% of Android devices today, according to Google itself.

The other setting is just a way for you to declare for which version of Android your app has been developed and tested. Almost always the recommended is to set to the latest version (which today would be version 22). For this just change the android:targetSdkVersion="1" for android:targetSdkVersion="22".

In the end it’ll be like this:

<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="22" />

Browser other questions tagged

You are not signed in. Login or sign up in order to post.