Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8544371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:32:28+00:00 2026-06-11T12:32:28+00:00

I am running into trouble either setting up the support v7 GridLayout library in

  • 0

I am running into trouble either setting up the support v7 GridLayout library in my IntelliJ project, or properly referencing it in my code.

I currently use the ActionBarSherlock and Facebook libraries in my project, and have set up the support GridLayout library the same way (not having source in the src folder, I told IntelliJ to use the project dir as a jar folder). Everything looked fine, built and deployed to my test device, but when I tried to inflate the layout, my app crashed.

09-17 17:07:43.916: ERROR/AndroidRuntime(4143): FATAL EXCEPTION: main
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example/com.example.MainHostActivity}: android.view.InflateException: Binary XML file line #8: Error inflating class android.support.v7.widget.GridLayout
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2753)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2769)
    at android.app.ActivityThread.access$2500(ActivityThread.java:129)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2117)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:143)
    at android.app.ActivityThread.main(ActivityThread.java:4717)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:521)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
    at dalvik.system.NativeStart.main(Native Method)
    Caused by: android.view.InflateException: Binary XML file line #8: Error inflating class android.support.v7.widget.GridLayout
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
    at com.decoderhq.indieshuffle.PlayerFragment.onCreateView(PlayerFragment.java:63)
    at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:846)
    at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1061)
    at android.support.v4.app.FragmentManagerImpl.addFragment(FragmentManager.java:1160)
    at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:272)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:558)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
    at com.actionbarsherlock.internal.ActionBarSherlockCompat.setContentView(ActionBarSherlockCompat.java:857)
    at com.actionbarsherlock.app.SherlockFragmentActivity.setContentView(SherlockFragmentActivity.java:251)
    at com.example.MainHostActivity.onCreate(MainHostActivity.java:58)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2717)
    ... 11 more
    Caused by: java.lang.ClassNotFoundException: android.support.v7.widget.GridLayout in loader dalvik.system.PathClassLoader[/data/app/com.example.MyApp.apk]
    at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
    at android.view.LayoutInflater.createView(LayoutInflater.java:466)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)
    ... 30 more

IntelliJ is also telling me that my GridLayout is “not allowed here” in the XML designer, which I unable to find any help on in various search engines. My layout (truncated for length) is as follows:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:grid="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.v7.widget.GridLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        grid:columnCount="3"
        grid:rowCount="2"
        android:id="@+id/player_grid">

    <!-- previous artist label button/view -->
    <LinearLayout
            android:id="@+id/prev_artist_label_layout"
            android:background="@drawable/player_prev_artist_bg_full"
            android:padding="10dp"
            grid:layout_column="0"
            grid:layout_row="0">

        <TextView
                android:id="@+id/prev_artist_label"
                android:layout_height="wrap_content"
                android:layout_width="0dp"
                android:layout_weight="1"
                android:layout_gravity="center"
                android:singleLine="true"
                style="@style/PlayerArtistText"
                android:ellipsize="end"/>
        <ImageView
                android:id="@+id/prev_artist_label_arrow"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:padding="5dp"/>

    </LinearLayout>

    <!-- more cells in the grid [truncated for length] -->

    </android.support.v7.widget.GridLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignBottom="@id/player_grid">

    <TextView
            android:id="@+id/curr_time_label"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            style="@style/PlayerTimeLabels"
            android:text="00:00"
            android:layout_marginLeft="20dp"
            android:layout_marginRight="10dp"/>
    <SeekBar
            android:layout_height="wrap_content"
            android:layout_width="0dp"
            android:layout_weight="1"
            android:id="@+id/seek_bar"/>
    <TextView
            android:id="@+id/duration_time_label"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            style="@style/PlayerTimeLabels"
            android:text="00:00"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="20dp"/>

</LinearLayout>

</RelativeLayout>

Coles Notes: I have a support GridLayout in a RelativeLayout and a LinearLayout that sits on top, anchored at the bottom of the RelativeLayout.

The log indicates I am missing a class. I am hoping I just didn’t set the library up properly, as I can’t think of what else it could be. Hopefully someone with some IntelliJ/Android knowledge can point me in the right direction.

Please go easy on me if this question is missing some info – this is my first try at using stackoverflow to ask for help.

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T12:32:30+00:00Added an answer on June 11, 2026 at 12:32 pm

    Ok, I figured this out. Turns out it was a configuration issue. Here is what I did to set up the support GridLayout library, as well as reference the classes in code.

    • Copy [android-sdk-folder]/extras/android/support/v7/gridlayout folder to your project libs folder

    Set up support GridLayout library in IntelliJ:

    • Project Structure -> Modules in Project Settings pane -> New Module
    • Create module from scratch -> Next
    • Name the project, browse to your libs/gridlayout folder and choose as Content Root, leave the Module Root set by the Content Root assignment, and select Android Module type -> Next
    • Do not create source directory -> Next
    • Do not create Android application structure -> Finish
    • Select Facets in Project Settings pane -> Select your new module -> Check ‘Is Library Project’

    Add dependancy to project in IntelliJ:

    • Select Modules in Project Settings pane -> Select the project in which you wish to use the support GridLayout
    • Select Dependancies tab -> click [+] to add new Module Dependancy
    • Select your support library from previous section

    You also need to add a reference to the support v7 GridLayout jar file in the support project libs dir.

    • Still on Dependancies tab -> click [+] to add new Library -> Java
    • Browse to the libs/gridlayout/libs folder and select the support v7 GridLayout .jar
    • Select level (I only needed Project level) -> OK

    Hopefully this helps someone else – I wasted most my day on it. =|

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently running into trouble configuring MAMP 2 to use SSL with multiple virtual
I currently running into trouble with spring security, I have been following the two
I have a maven-based GWT project that includes Guava. I am running into trouble
I am slowly learning how to use callbacks and I am running into trouble.
after setting up a new Spring-based application, I'm running into trouble with a referenced
I'm currently trying to create a custom tree and I'm running into trouble when
I'm running into trouble accessing global variables when I make an AJAX call to
I am running into trouble given the following setup: Operating System is Windows 7
Following this tutorial and running into trouble. [TestMethod] [ExpectedException(typeof(Exception))] public void VerifyPropertyNameMethod_NonExistentPropertyString_ThrowsException() { var
I'm writing a ASP.NET Web Application and I'm running into trouble getting the CSS

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.