I'm doing some Android work in IntelliJ 13. I've created an Android test application so I can start writing unit tests. IntelliJ is reporting an error I haven't seen before and this error does not prevent the code from working:
Call requires API level 3 (current min is 1)
It will also have an error at the class level that is:
Class requires API level 3 (current min is 1)
And sometimes it will say level 11.
You need to set min SDK version in AndroidManifest like
<uses-sdk android:targetSdkVersion="18" android:minSdkVersion="11"/>
As Josef said, you need to increase the minimum SDK version specified in your AndroidManifest.xml
file - this is the minimum Android API version you support. The error messages you're getting ("requires API level 11") mean that the method or class you're trying to use was only introduced in API 11. There are ways around this - specifically, the support library is an official back-port of many newer features, included in your SDK.
Have a look at the Android Dashboards to choose a minimum API level (and hence your device/userbase coverage) - typically 8 or 10, if you plan on supporting "older" devices (Android 2.2 and 2.3 devices), and 14 or 15 if you plan on supporting only newer (Android 4.x) devices.
Generally you'd specify your targetSdkVersion
to be the latest version of Android - at the moment, this is 19. You need your SDK up-to-date, though.
The developer documentation has an in-depth explanation of what these things mean - I'd recommend having a read.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With