I am developing an Android app using eclipse. When I try to run my project I get the error
Call requires API level 13 (current min is 8): android.view.Display#getSize which refers to the line display.getSize(size);.
So in the AndroidManifest.xml I made the following change:
<uses-sdk
android:minSdkVersion="13"
android:targetSdkVersion="17" />
However when I try running the project again, I still get the same error. The target SDK is Android 4.0. Does anyone know what is causing this error?
Try to clean your project. If it still shows error after cleaning then right click on project goto Properties>Android tab and select the Android Build target Android 3.2. And after performing this Build your project. I think it should work after this.
Related
I am trying to create an android project and it gives me errors
and errors appear only if I have more than one android project (R cannot be resolved to a variable ) and if i import it errors change to (R.menu.main,R.layout.activity_main,R.id.action_settings
Change android:minSdkVersion to 11 in your androidmanifest.xml. Yours is currently 8 which does not allow the call your are trying to make in onCreateView() method. First error in your screenshot clearly says it.
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="23" />
target SDK could be what you want.
Based on your comment if you still want to continue using API level 8. You should determine the API level at runtime and then call the method that works for the Android version on device. Read this for more info: Check System Version at Runtime
Using Eclipse, I was using android:minSdkVersion="10", got the error message that this was too low, and updated it to 18. After cleaning the project, refreshing and building Android Environment, I still get the same error message!
In Properties -> Android -> Project Build Target, I have selected Android 4.4.2, with an API level of 19.
in AndroidManifest.xml:
<uses-sdk android:minSdkVersion="18" android:targetSdkVersion="19"/>
ERROR:
"Call requires API level 17(current min is10):android.app.AlertDialog.Builder#setOnDismissListener"
How do I make sure my update in AndroidManifest really works?
Thanks in advance.
It has been a while since I've used Eclipse for Android development. If you're new to Android, I'd highly recommend that you check out Android Studio, instead.
Anyway, this sounds like a build issue. I'm imagining that you're using the default ant build script so in that case the most likely culprit is your project properties file.
Look for a file called "project.properties"
and add/modify a line to contain the following:
# Project target
target=android-18
It sounds like it's currently pointing to android-10. You can find more information on this file and others here.
I just imported my old Android Project that I just checkout from my git repo.
When I try to create a new Master/Detail Flow Activity using Eclipse :
New > Android > Android Activity > Login Activity > Next
The Eclipse reports me error saying :
This template requires a minimum SDK version of at least 3,
and the current min version is 1
Where as my actual entries in my AndroidManifest.xml is :
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />
Can someone tell me what am I missing here?
I am using Android SDK Tools of version 23.2 and Android SDK Platform-Tools version 19.0.1.
Looks like Eclipse does this when you refactor your code that affects entries in your AndroidManifest.xml.
So, before doing anything else Close your eclipse project from workspace and open the project again by double clicking it. This will force Eclipse to reinitialize your project and will also run Lint & Other checks.
If this doesn't work, try any of the above things suggested by other users.
I think this is a Lint rule triggered only by the current version of the tools (likely this is something that was added, of the severity was changed in the rule-set).
You can disable this rule in the Lint Perspective, or by right-clicking on it from the Android XML editor.
Not sure what the actual fix is (hopefully someone will answer) - this will silence it, so your build works (but you should really fix the original problem).
Check your Android manifest file. When this happened to me there were obvious errors in the file.
When running my Android app I often get a list of errors, wich says
Class requires API level 3 (current min is 1): android.hardware.SensorEventListener
I've searched for the correct answer to this, like Android tools > Clear Link Markers, but this doesn't solve the problem. Every once in a while the list of errors keeps coming back. Is it something in my project settings or are my methods deprecated? I've installed the latest SDK for Android 4.4.
In your manifest file set the sdk like this based on your requirement..
<uses-sdk
android:maxSdkVersion="17"
android:minSdkVersion="8" />
Restart and invalidate cache if this error just started up for no apparent reason
Change your application minsdk from Preference>Android>select the api level Android1.6
I am creating a project in android using eclipse.
Now my problem is when i create a android application project, I set Build Sdk version to 4.1 (API 16). But when i saw in manifest file the android:targetSdkVersion="15" . Can anyone explain me why this is happening ? see the below screenshots.
Thanks in advance
Updated Answer:
Here it goes,
Solution is,
goto:
Your
Directory\android-sdk-windows\tools\templates\projects\NewAndroidApplication\root
Open :
AndroidManifest.xml.ftl File
Change :
default :
<uses-sdk android:minSdkVersion="${minApi}"
android:targetSdkVersion="${targetApi}" />
Modified :
<uses-sdk android:minSdkVersion="${minApi}"
android:targetSdkVersion="${buildApi}" />
So the Problem goes here:
In the ftl file the attribute name ${targetApi} has been set, but we are selecting the buildApi value in the project creation window.
${targetApi} or ${buildApi} default value is the higher version , that means in your SDK tool it is API 15. So it is always 15 in the Manifest.
If you tried to create a new project with target API less than 10 or more than 15 anything , in the manifest it will be denoted as 15 only always.
Try this:
Create a project with API target 8 and see , manifest target will be 15 only. (Before modify the ftl file).
But project.properties has been updated properly.
So if you change ${targetApi} to ${buildApi} in the Manifest.xml.ftl, the problem solved.
It is a possible error in SDK tools revision 20, Even i updated the SDK tools itsn't resolved in the recent revision also.
Hope this one might be helpful for somebody, those who facing the same.
Older Answer:
It is showing for me too. But in my case, I selected API 14 and it is showing android:targetSdkVersion="15" in the manifest.
I guess some reason should be there... 4.0 or 4.2 , it is assigning 4.1 in the manifest... Or may be a bug with Eclipse IDE. Why cant you update the newer version of Eclipse IDE and try it out. This might be a IDE Problem only.
Can you see that Right click- Properties - Android , Checked one is same what you selected in the beginning.
And also project.properties has the same version what you selected in the beginning.
well the Project target you set is got set in the default.properties file if you change that and save it the the attached sdk will change you can try it.
the entry in menifiest is used after compilation on the device . don't know why it is taking wrong value.but in my eclipse it takes only minsdkversion and its value is same what i entered on start.however my point is it does not matter