Reputation: 347
I have completed the basics of android application using eclipse. I am now trying to create games using the ANDengine which I'm sure I have done correctly.
To make sure I'm on the right track, I downloaded examples and tried to run them on my tablet. After importing the sample code, I received an error "cannot resolve target android-15" which I solved by installing SDK 4.0.3 which had the Api level 15. I downloaded the bundle with sdk 4.4 and api level 19. I would have thought level 19 would be sufficient but I downloaded it anyway.
I downloaded a second example and it now cannot resolve "android-8" which I'm assuming is going to require another SDK.
How does the api levels work? Am I required to install all of the SDK versions?
Upvotes: 0
Views: 1577
Reputation: 7863
The SDKs themselves are not downwards compatible. If it say in your AndroidManifest.xml
that the target SDK version is 15, you'll need exactly that version to compile the project.
Anyway, the code itself is upwards compatible. Just open your AndroidManifest.xml
and look for something like that:
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="15" />
Change it to
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="19" />
and you can compile with API level 19.
Upvotes: 2
Reputation: 20348
I do not know about AndEngine, but for using different API levels in your code, you need to download the required files for each platform using SDK manager
. You can check in $SDK_ROOT/platforms
folder which API levels are already downloaded on your machine. You need to download each API-level, before using them in your project. Downloading the highest one is not enough.
And yeah you need to download the version which you're going to target i.e. the version which is going to be used to compile the project (targetSdkVersion
), not the one you want to use as minimum api level (minSdkVersion
)
Upvotes: 0