Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Adlight Sibanda
5,701 PointsINSTALL_FAILED_OLDER_SDK
I have been working on a project for days now until today when I tried to launch an emulator. it gave an error [INSTALL_FAILED_OLDER_SDK]. Please assist if anyone else knows the solution.
2 Answers
Harry James
14,780 PointsHey Adlight Sibanda - I'll try and reword what Seth Kroger said for you (Which is still correct).
When we create our project, we set a Minimum SDK - this is the minimum version of Android that the app can run on. If we try to run our app on a device below this minimum version, it will fail with the error you just got.
So, if we set the minimum SDK to 21 (Lollipop), our app is only compatible with devices running on Lollipop or higher. Anything below that (KitKat, Jelly Bean, Ice cream sandwich etc...) will not be compatible and will fail with the error.
We can check what version our Android device/emulator is running on by going to Settings >> About phone >> Android version.
If we want to make our app compatible with earlier versions of Android, we can do so by opening the build.gradle file for the app module. Then, look for this line and update it to the minimum SDK of your choice:
minSdkVersion 14
(Here, 14 being the minimum SDK version which is equivalent to 4.0 or Ice Cream Sandwich)
Now, you may be thinking "Why don't we just set the minimum to 1? Surely then every device can use it?" well, that's true but it also means that we wouldn't be able to use some of the newer features in the SDK. Therefore, we need to keep a balance of being able to use new features in Android but also supporting a wide audience. We can take a look at the Android Developer Dashboard to see an up-to-date split of current Android versions, allowing us to see the market split of Android versions right now.
It's also worth taking a look at the New Project menu in Android Studio and clicking the Help me choose button to see the cumulative distribution that will be supported.
Hopefully this should help explain things for you but if you have any more questions, give me a shout :)
Seth Kroger
56,416 PointsIt means the Android version of the app you're trying to install requires is higher that the Android version of the emulator. You should run an emulator with image of the latest (non-preview) Android unless you are specifically testing for backward compatibility. You can also lower the minimum SDK version required in the app's manifest if you set it too high for the features you're using.
Adlight Sibanda
5,701 PointsHi Seth
I am not following your explanation i got lost along the way still cant figure it out.....
Adlight Sibanda
5,701 PointsAdlight Sibanda
5,701 Pointsawesome thank you Harry.