I have been creating an app for Android SDK 8 and it works fine. Since most users are using SDK 7 and above I tried to switch to SDK 7, but then my custom ImageViews disappear from my RelativeLayout. The app does not chrash. Is this likely happening because I am using some of the framework from SDK 8? If so: is there an easy way to find out which part of my code that makes use of SDK 8 (i.e. not checking the API level of each and every method against the developer docs)?
There is really too much code to post it here. My manifest file includes
<uses-sdk android:minSdkVersion="7"
android:targetSdkVersion="7">
and my project.properties file has the line
target=android-7
Until now they used to be 8, but I changed them all to 7.
Not sure if that's your issue, but to answer the general question of finding which APIs you're using that are above the minimum API version:
Update to the newest version of the Android Developer tools, and from the command line, run lint from the root folder of your project. Among other things, it checks for "API accesses to APIs that are not supported in all targeted API".
Helpful resources:
Developer tools page for lint
Complete list of Lint checks
Related
I tried the solution provided here but that doesn't solve the problem.
Full error:
The SDK platform-tools version ((23)) is too old to check APIs compiled with API 23; please update less... (Ctrl+F1)
This check scans through all the Android API calls in the application and warns about any calls that are not available on all versions targeted by this application (according to its minimum SDK attribute in the manifest). If you really want to use this API and don't need to support older devices just set the minSdkVersion in your build.gradle or AndroidManifest.xml files. If your code is deliberately accessing newer APIs, and you have ensured (e.g. with conditional execution) that this code will only ever be called on a supported platform, then you can annotate your class or method with the #TargetApi annotation specifying the local minimum SDK to apply, such as #TargetApi(11), such that this check considers 11 rather than your manifest file's minimum SDK as the required API level. If you are deliberately setting android: attributes in style definitions, make sure you place this in a values-vNN folder in order to avoid running into runtime conflicts on certain devices where manufacturers have added custom attributes whose ids conflict with the new ones on later platforms. Similarly, you can use tools:targetApi="11" in an XML file to indicate that the element will only be inflated in an adequate context.
I had the same error and then I just updated Android SDK platform-tools to the revision 23.0.1 from sdk manager. In Android Studio: File->Invalidate Caches/Restart. I hope it will help you. If it doesn't, you can press Ctrl + Shift + A, type Check for Update and press Enter. It is possible that you'll get an update where it is fixed.
1.First Update the platform-tools
Open SDK Manager,then open SDK Tools panel,update the Platform-tools
2.Invalidate Cache Then Restart
I am trying to use the code template provided by android in eclipse and I set my min SDK to API 8. I tried to choose the "blank activity with scrollable tab" for using the swipe feature but it wouldn't let me continue and complaining that this code template support version 11 and more.
However, I thought that's why the support library of version 4 is! To support Api 4 and above.
Am I missing the point here or is there something I need to do?
Thank you
Use the android.support.v7 compatibility libraries (which work together with the v4 libraries).
When you create the project in eclipse set the minimum API version to 11 but once the project is created, edit AndroidManifest.xml to set minSDKVersion to 8.
From time to time when building the project, eclipse may complain about min SDK version being required for certain things - in this case just Clean the project and it will build without problems.
I have gotten it to work using ActionBarSherlock and ViewTabPager. Look into those
I have a library project whose target in project.properties is android-11. I wanted to create an app which uses that library, but compatible with android 4.1.2, so i edited also the library target with android-16.
But when i've done this change, the application gave me some problems and didn't work as before: for example in devices with software menu buttons, the buttons did not appear.
Can you tell me why? Thanks
first of all pls goto the SDK manager and check if you have SDK for Android 16 or above installed. If not please install it, if you have already installed then don't change anything in then project.properties, goto AndroidManifest.xml and make sure that "maxSdkVersion" is equal to above 16, if not it means that the library is depreciated and you cannnot use it for latest version. But generally most of the old libraries would support new SDK builds, so I suggest you to leave it as android-11 as it makes no harm
<uses-sdk
android:minSdkVersion="3"
android:maxSdkVersion="16"/>
I would like to change Google API level for my app project in Eclipse. I have seen numerous responses to this question on other forums that state to Right-Click on Project, select Android and edit the API level. However in my version of Eclipse (Classic) the Target API level can not be edited in this way. The box can not be edited.
I have tried the other common method of updating the manifest file but this doesnt seem to work without completing the required step mentioned above.
Any solutions would be very welcome.
Open the Android SDK Manager and download the API of the version that you wanna work on .
Now you can follow the other steps.
I am already having one small project in android that is build in API-10.
And i am using the latest version of the API-17 and having the same SDK manager.
Now when i import this project it shows error like Unable to resolve target 'android-10' and some more lines.
So, when i Googled about this problem i found that i think i need to download API-10 and the SDK.
So i wanted to know why its needed?
Because my existing code is built in API-10 then i think it should be compatible with API-17.
I am new to Android i just understood some concepts like Activity, Services and many more but when i came around this issue i really shocked?
I just wanted to understand why its needed while i am already having SDK for API-17?
try by adding targetSdkVersion to the manifest file
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="17" />
and clean your project, that might also help
What that means is you need to start your Android SDK Manager and download and install API Level 10. Why do you need API Level 10 ? Well, the project you are importing needs that API level.