jacobmoncur / QuiltViewLibrary

Android Quilt View Library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error while running your sample

abhishek-akhani opened this issue · comments

04-08 12:35:23.902: E/AndroidRuntime(3552): FATAL EXCEPTION: main
04-08 12:35:23.902: E/AndroidRuntime(3552): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.jake.quiltviewsample/com.jake.quiltviewsample.MainActivity2}: android.view.InflateException: Binary XML file line #8: Error inflating class com.jake.quiltview.QuiltView
04-08 12:35:23.902: E/AndroidRuntime(3552): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
04-08 12:35:23.902: E/AndroidRuntime(3552): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
04-08 12:35:23.902: E/AndroidRuntime(3552): at android.app.ActivityThread.access$600(ActivityThread.java:141)
04-08 12:35:23.902: E/AndroidRuntime(3552): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
04-08 12:35:23.902: E/AndroidRuntime(3552): at android.os.Handler.dispatchMessage(Handler.java:99)
04-08 12:35:23.902: E/AndroidRuntime(3552): at android.os.Looper.loop(Looper.java:137)
04-08 12:35:23.902: E/AndroidRuntime(3552): at android.app.ActivityThread.main(ActivityThread.java:5039)
04-08 12:35:23.902: E/AndroidRuntime(3552): at java.lang.reflect.Method.invokeNative(Native Method)
04-08 12:35:23.902: E/AndroidRuntime(3552): at java.lang.reflect.Method.invoke(Method.java:511)
04-08 12:35:23.902: E/AndroidRuntime(3552): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
04-08 12:35:23.902: E/AndroidRuntime(3552): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
04-08 12:35:23.902: E/AndroidRuntime(3552): at dalvik.system.NativeStart.main(Native Method)
04-08 12:35:23.902: E/AndroidRuntime(3552): Caused by: android.view.InflateException: Binary XML file line #8: Error inflating class com.jake.quiltview.QuiltView
04-08 12:35:23.902: E/AndroidRuntime(3552): at android.view.LayoutInflater.createView(LayoutInflater.java:613)
04-08 12:35:23.902: E/AndroidRuntime(3552): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
04-08 12:35:23.902: E/AndroidRuntime(3552): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
04-08 12:35:23.902: E/AndroidRuntime(3552): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
04-08 12:35:23.902: E/AndroidRuntime(3552): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
04-08 12:35:23.902: E/AndroidRuntime(3552): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
04-08 12:35:23.902: E/AndroidRuntime(3552): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:270)
04-08 12:35:23.902: E/AndroidRuntime(3552): at android.app.Activity.setContentView(Activity.java:1881)
04-08 12:35:23.902: E/AndroidRuntime(3552): at com.jake.quiltviewsample.MainActivity2.onCreate(MainActivity2.java:18)
04-08 12:35:23.902: E/AndroidRuntime(3552): at android.app.Activity.performCreate(Activity.java:5104)
04-08 12:35:23.902: E/AndroidRuntime(3552): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
04-08 12:35:23.902: E/AndroidRuntime(3552): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
04-08 12:35:23.902: E/AndroidRuntime(3552): ... 11 more
04-08 12:35:23.902: E/AndroidRuntime(3552): Caused by: java.lang.reflect.InvocationTargetException
04-08 12:35:23.902: E/AndroidRuntime(3552): at java.lang.reflect.Constructor.constructNative(Native Method)
04-08 12:35:23.902: E/AndroidRuntime(3552): at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
04-08 12:35:23.902: E/AndroidRuntime(3552): at android.view.LayoutInflater.createView(LayoutInflater.java:587)
04-08 12:35:23.902: E/AndroidRuntime(3552): ... 22 more
04-08 12:35:23.902: E/AndroidRuntime(3552): Caused by: java.lang.IllegalArgumentException: rowCount must be greater than or equal to the maximum of all grid indices (and spans) defined in the LayoutParams of each child.
04-08 12:35:23.902: E/AndroidRuntime(3552): at android.widget.GridLayout.handleInvalidParams(GridLayout.java:773)
04-08 12:35:23.902: E/AndroidRuntime(3552): at android.widget.GridLayout.access$100(GridLayout.java:151)
04-08 12:35:23.902: E/AndroidRuntime(3552): at android.widget.GridLayout$Axis.setCount(GridLayout.java:1230)
04-08 12:35:23.902: E/AndroidRuntime(3552): at android.widget.GridLayout.setRowCount(GridLayout.java:368)
04-08 12:35:23.902: E/AndroidRuntime(3552): at com.jake.quiltview.QuiltViewBase.setupVertical(QuiltViewBase.java:48)
04-08 12:35:23.902: E/AndroidRuntime(3552): at com.jake.quiltview.QuiltViewBase.setup(QuiltViewBase.java:39)
04-08 12:35:23.902: E/AndroidRuntime(3552): at com.jake.quiltview.QuiltViewBase.(QuiltViewBase.java:34)
04-08 12:35:23.902: E/AndroidRuntime(3552): at com.jake.quiltview.QuiltView.setup(QuiltView.java:58)
04-08 12:35:23.902: E/AndroidRuntime(3552): at com.jake.quiltview.QuiltView.(QuiltView.java:47)
04-08 12:35:23.902: E/AndroidRuntime(3552): ... 25 more

I seem to be running into the same error, I'm using Android studio, and added com.android.support:gridlayout-v7:+ as a gradle dependency, and made sure the attrs.xml and dimens.xml files matched in my project, but no luck.

I haven't been super active with this so I haven't had a chance to
run/migrate it to Android Studio. I'll give it a look and let you guys know.

On Tue, May 27, 2014 at 1:51 PM, justinbriggs1 notifications@github.comwrote:

I seem to be running into the same error, I'm using Android studio, and
added com.android.support:gridlayout-v7:+ as a gradle dependency, and made
sure the attrs.xml and dimens.xml files matched in my project, but no luck.


Reply to this email directly or view it on GitHubhttps://github.com//issues/20#issuecomment-44326150
.

Its running well for me on AndroidStudio but the problem is that the Vertical scroll isn't working, there is just a Horizontal scroll.

The same here with Eclipse..
java.lang.IllegalArgumentException: rowCount must be greater than or equal to the maximum of all grid indices (and spans) defined in the LayoutParams of each child.

The same exception happened when I tried to run it in android studio. The exception points to QuiltViewBase.java, row 47, where it sets the row count to -1.

this.setRowCount(0);
commented

i solve it change dependencies
from
compile 'com.android.support:gridlayout-v7:24.0.0'
to
compile 'com.android.support:gridlayout-v7:18.0.+'

commented

solve 2 just remove this remove //this.setColumnCount(-1); and //this.setColumnCount(-1); in vertical too

@medozeus you mean setRowCount in horizontal
i think it's better to set it undefined:
this.setRowCount(UNDEFINED); // in horizontal
this.setColumnCount(UNDEFINED); // in vertical