Can't Solve the Error - View requires API level 14 (current min is 8): <GridLayout>

20,953

Solution 1

In your manifest use:

<uses-sdk minSdkVersion="14" />

However, this will mean that any device running an android API below 14 will not be able to use your app.

Solution 2

Now you can use the v7 Android Support Library that provides a GridLayout with compatibility for API Level 7+.

This way, you just have to use the android.support.v7.widget.GridLayout on your XML to have a backwards compatible GridLayout with native behavior.

See:

Solution 3

Set the android:minSdkVersion="14" in AndroidManifest.xml

<uses-sdk android:minSdkVersion="14"/>

Solution 4

If you want to use GridLayout and target devices with API versions below 14, you could also try the backported GridLayout library from the Android support library. See the answers to this question for details: Grid Layout support in android API 10

Share:
20,953
Saumya Rastogi
Author by

Saumya Rastogi

I'm a simple guy and a techie, born in Udaipur, brought up in Delhi and now working in Bangalore. Having learned tech basics at Squareboat as a Software Engineer for almost half a decade. To brag about my skills, I’ve majorly worked on Node JS, Laravel, MySQL, Docker, Angular, Vue JS, ES6/Typescript, React Native and I love working on UI/UX stuff. I enjoy having long conversations with other like-minded designers for new ideas and suggestions. The things I love other than Software Engineering is Football &amp; CR7 (Yes I’m human too: 😊 I am a gameaholic and mad about Games, with my favorite being EA Sports's FIFA Game Series. Everything doesn’t end here for me. I am a man consumed by wanderlust.

Updated on May 23, 2020

Comments

  • Saumya Rastogi
    Saumya Rastogi about 4 years

    My Code is -

    <GridLayout 
    xmlns:android= "http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:columnCount="4"
    android:orientation="horizontal" >
    
    
    
    <Button android:text="@string/btn7" />
    
    <Button android:text="@string/btn8" />
    
    <Button android:text="@string/btn9" />
    
    <Button android:text="@string/btndiv" />
    
    <Button android:text="@string/btn4" />
    
    <Button android:text="@string/btn5" />
    
    <Button android:text="@string/btn6" />
    
    <Button android:text="@string/btnmul" />
    
    <Button android:text="@string/btn1" />
    
    <Button android:text="@string/btn2" />
    
    <Button android:text="@string/btn3" />
    
    <Button android:text="@string/btnmin" />
    
    <Button android:text="@string/btn00" />
    
    <Button android:text="@string/btn0" />
    
    <Button android:text="@string/btndec" />
    
    <Button android:text="@string/btnadd" />
    
    <Button android:text="@string/btnsqrt" />
    
    <Button android:text="@string/btncbrt" />
    
    <Button android:text="@string/btnrec" />
    
    <Button
    android:layout_gravity="fill"
    android:layout_rowSpan="2"
    android:text="@string/btneql" />
    
    <Button android:text="@string/btnpow" />
    
    <Button android:text="@string/btnper" />
    
    <Button android:text="@string/btnmod" />
    
    
    
    </GridLayout>
    

    And Eclipse is Giving me Error at the first line of this above Code... The ERROR is - "View requires API level 14 (current min is 8): "

    Please help me out..!! I've already downloaded the API ver 14 (Android 4.0), then also I am getting this Error!

  • Saumya Rastogi
    Saumya Rastogi almost 12 years
    Gr8 Suggestion..!! But what should I do to run it on maximum API Versions... I mean - on below API 14 Versions..
  • Raghav Sood
    Raghav Sood almost 12 years
    Either you write your own GridLayout, based on the one given in the Android source code, or you use the existing layout options together to try and create an arrangement that looks like a GridLayout.
  • Manasi
    Manasi almost 10 years
    writing own gridLayout means?