Not targeting the latest versions of Android

android target
android sdk versions
recommended minimum sdk android 2019
api level
android target sdk
android os build version codes
targetsdkversion 26
android version code

I have a warning when trying to test theme on latest Android SDK Package 4.2.

Here is my manifest file:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.themetest"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="16" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppBaseTheme" >
        <activity
            android:name="com.example.themetest.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

Not targeting the latest versions of Android; compatibility modes apply. Consider testing and updating this version. Consult the android.os.Build.VERSION_CODES javadoc for details. AndroidManifest.xml /ThemeTest line 7 Android Lint Problem

I am using a custom theme called 'AppBaseTheme'. My question is what exactly Consult the android.os.Build.VERSION_CODES javadoc.. How could I solve this problem?

It says this because of targetSdkVersion="16". API 16 is Jellybean 4.1 and 4.1.1, while Jellybean 4.2 is API 17.

Try using:

<uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="17" />

Also, keep in mind that this is a Lint warning. These warning exist to help you better your code and make it easy to maintain, while being compatible with the latest Android changes. Ignoring this will not cause you any immediate problems.

EDIT: With Android 4.3, the latest SDK version is now 18, so you should use:

...
        android:targetSdkVersion="18" />

EDIT 2: With Android 4.4, the latest SDK version is now 19, so you should use:

...
        android:targetSdkVersion="19" />

EDIT 3: With Android L, you must use the following values, as described here:

compileSdkVersion="android-L"
minSdkVersion="L"
targetSdkVersion="L"

EDIT 4: With Android L's public release, you must use 21 instead:

...
        android:targetSdkVersion="21" />

20 was used for 4.4W, or for Android Wear.

EDIT 5: With Android M's public release, you must use 23 instead:

...
        android:targetSdkVersion="23" />

In the future please consult the official Android documentation to keep yourself up-to-date with the latest Android API Levels.

Meet Google Play's target API level requirement, Lint warning about target latest version of android: Not targeting the latest versions of Android; compatibility modes apply. Consider testing and� Not targeting the latest versions of Android; compatibility modes apply. Consider testing and updating this version. Consult the android.os.Build.VERSION_CODES javadoc for details.

You should not use android:maxSdkVersion="17" because it means that if someone using your app updates its android OS to a version greater than 17, your app will be removed.

Not targeting the latest versions of Android?, Not targeting the latest versions of Android; compatibility modes apply. Consider testing and updating this. version. Consult the android.os.Build� Here are the cases in gradle/Android Studio: Not targeting the latest versions of Android; compatibility modes apply. Consider testing and updating this version. Consult the android.os.Build.VERSION_CODES javadoc for details. less

This lint message is telling you that compatibility mode will be automatically applied to any features you may have used that are not available in later versions than your declared targetSdkVersion of 16 (and, it is also telling you that there are such later versions - e.g., 17).

These automatic compatibility mode adjustments may not be as ideal as what you could accomplish yourself by using whatever features were added in later (than level 16) versions to replace the functionality of the level 16 ones that you may have used, which have been removed in later versions (if any). But everything should still continue to work in later versions (due to the adjustments made by the compatibility code that is automatically applied for running on versions higher than your declared targetSdkVersion's API level); it just may not work as well as your own custom detection of, and use of, the new features (when your app detects that it is running in the later versions that have those features) would have worked.

Here is a discussion, with examples, of minSdkLevel vs. targetSdkLevel:

Android Min SDK Version vs. Target SDK Version

Another thing you will want to consider is the relationship of the Project Build Target (the level of the SDK used to compile your app) to the targetSdkLevel:

Difference between "Build Target SDK" in Eclipse and android:targetSdkVersion in AndroidManifest.xml?

Not targeting the latest versions of Android; compatibility modes , Not targeting the latest versions of Android; compatibility modes apply. Consider testing and updating this version. Consult the android.os.Build. After downloaded, targetSdkVersion of defaultConfig shows the warning message with yellow underline “Not targeting the latest versions of android compatibility modes apply. consider testing this version.” for being compatible with the latest Android changes, so let’s set targetSdkVersion to 25 (Android 7.1) and run gradle build.

Its a warning message if you want to solve it then you can set android:maxSdkVersion="17" but you have to take care of the fact that if someone currently using your app and upgrade his android OS to greater version than 17 then your app will automatically remove because of unsupported version.. So take care of this fact also..

[android警告]AndroidManifest.xml警告Not targeting the latest , “Not targeting the latest versions of android compatibility modes apply. consider testing this version.” for being compatible with the latest� Android 10 is the tenth major version of the Android operating system. The stable version of Android 10 was released on September 3, 2019. Version Release date Features Image(s) 10.0. September 3, 2019. New permissions required to access location in background and to access photo, video and audio files.

Add xmlns:tools="http://schemas.android.com/tools" tools:ignore="OldTargetApi".

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.themetest"
    android:versionCode="1"
    android:versionName="1.0" xmlns:tools="http://schemas.android.com/tools" tools:ignore="OldTargetApi">

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="16" />

From: Stuck on why my android app wont work?

How to check the latest version of android support library in your SDK?, This proposal keeps the current code and explicitly sets the android: targetSdkVersion in the AndroidManifest.xml to ensure there is no way� Verify that your existing app is fully functional on the new version of the platform. At this stage, you do not use new APIs or change your app's targetSdkVersion, but minor changes might be necessary. Target the new platform, compile with the Android 9 SDK, and build with Android 9 features

Setting Target Version to "Use Compile" Does not set , You would not be able to upload a new APK that targets API level 27. https:// support.google.com/googleplay/android-developer/answer/ or testing tracks— that aren't currently targeting API level 28 or higher. Apps are listed with the maximum version code and corresponding Last edited 10/13/19. Again, these restrictions do not apply to apps which received the SYSTEM_ALERT_WINDOW permission before the device was upgraded to Android 10. Warnings for apps targeting older Android versions. Devices running Android 10 or higher warn users the first time they run any app that targets Android 5.1 (API level 22) or lower.

What happens if I dont upgrade targetSDKVersion before 1st of , Not targeting the latest versions of Android って書いてある通り、最新のAndroid バージョンをターゲットにしましょうってことです。 ここに�

対処法: Not targeting the latest versions of Android; compatibility , Android: "Not targeting the latest version" inspection highlights "21" API as not the latest, but suggests to update targetSdkVersion to "21", not to "22".

Comments
  • How should I target L?
  • Note that this will be overwritten by whatever is in your build.gradle file!
  • add one for persistence ad long maintenance of the answer.
  • Indeed, this attribute shouldn't be used. However, since API 7 (included), meaning for Android 2.1 and above, no checking is done for that attribute by the system. Only for Android 2.0.1 and less, your application will be removed by the system if the current version is greater than the maxSdkVersion attribute, otherwise it is ignored. It is rather used by GooglePlay to filter what applications are displayed for a device, as explained here
  • this attribute is used to split targets for apk, i.e. you want to distribute different apk for froyo and gigerbread+ because of the different play services sdk
  • if the API level of the platform is higher than the version declared by your app's targetSdkVersion, the system may enable compatibility behaviors to ensure that your app continues to work the way you expect.
  • OP didnt ask about maxSDKVersion but targetSDKVersion