• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps API level anomaly in warning

An error is being displayed indicating that the API Level is inappropriate although within the UI, there is indicated (confirmed as I configured this through a wizard) that the API level is 21.

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:baselineAligned="false"
android:divider="?android:attr/dividerHorizontal"
android:eek:rientation="horizontal"
android:showDividers="middle"
Error: Attribute "showDividers" is only used in API level 11 and higher (current min is 8)
tools:context="com.example.androidprime.WidgetListActivity" >

<!--
This layout is a two-pane layout for the Widgets
master/detail flow. See res/values-large/refs.xml and
res/values-sw600dp/refs.xml for an example of layout aliases
that replace the single-pane version of the layout with
this two-pane version.


For more on layout aliases, see:
http://developer.android.com/training/multiscreen/screensizes.html#TaskUseAliasFilters
-->

<fragment
android:id="@+id/widget_list"
android:name="com.example.androidprime.WidgetListFragment"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
tools:layout="@android:layout/list_content" />

<FrameLayout
android:id="@+id/widget_detail_container"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3" />

</LinearLayout>

NOTE: I wanted to upload the complete source but it turns out that I cannot upload a .RAR file as an attachment, to allow you to replicate this issue within Eclipse, since the moderators in the Eclipse user forums indicate that this is preferred to be discussed in the Android forums, perhaps they are stressed out.
It is also still not an option to include an image as opposed to an image url within the content editor in this forum so an update to allow images (and Java source files amongst other code and resources files) would be appreciated. At least I can upload a .png file though :)
 

Attachments

  • Untitled.png
    Untitled.png
    188.4 KB · Views: 100
Your target API may be 21, but the min one is set to 8 according to the error message. android:showDividers seems to be only API level 11 and up, therefore your application will behave unexpectedly or may even crash on APIs under it.

Simple fix is to either not use showDividers, or set the minimum API level to 11 instead of 8.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones