Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MeasureSpec.EXACTLY crash #32

Closed
theblixguy opened this issue Feb 1, 2015 · 13 comments
Closed

MeasureSpec.EXACTLY crash #32

theblixguy opened this issue Feb 1, 2015 · 13 comments
Assignees
Labels

Comments

@theblixguy
Copy link

I'm using the latest library and getting the following in log cat:

java.lang.IllegalArgumentException: DrawerLayout must be measured with MeasureSpec.EXACTLY. at android.support.v4.widget.DrawerLayout.onMeasure(DrawerLayout.java:814) at android.view.View.measure(View.java:16628) at android.support.v4.widget.DrawerLayout.onMeasure(DrawerLayout.java:866) at android.view.View.measure(View.java:16628) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125) at android.widget.FrameLayout.onMeasure(FrameLayout.java:310) at android.view.View.measure(View.java:16628) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125) at android.widget.FrameLayout.onMeasure(FrameLayout.java:310) at android.view.View.measure(View.java:16628) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1404) at android.widget.LinearLayout.measureVertical(LinearLayout.java:695) at android.widget.LinearLayout.onMeasure(LinearLayout.java:588) at android.view.View.measure(View.java:16628) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125) at android.widget.FrameLayout.onMeasure(FrameLayout.java:310) at android.view.View.measure(View.java:16628) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1404) at android.widget.LinearLayout.measureVertical(LinearLayout.java:695) at android.widget.LinearLayout.onMeasure(LinearLayout.java:588) at android.view.View.measure(View.java:16628) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125) at android.widget.FrameLayout.onMeasure(FrameLayout.java:310) at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2298) at android.view.View.measure(View.java:16628) at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1916) at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1113) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1295) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5610) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761) at android.view.Choreographer.doCallbacks(Choreographer.java:574) at android.view.Choreographer.doFrame(Choreographer.java:544) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:212) at android.app.ActivityThread.main(ActivityThread.java:5137) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:902) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:718) at dalvik.system.NativeStart.main(Native Method)

@heinrichreimer
Copy link
Owner

When do you get this error?

@theblixguy
Copy link
Author

@heinrichreimer I just migrated from an old version of your library to the latest version, I was using DrawerView so I replaced it with DrawerFrameLayout everywhere in my code and since then I am getting this error

@heinrichreimer
Copy link
Owner

DrawerFrameLayout is not a replacement for DrawerView. It extends DrawerLayout. For usage See the README vor the example code.

@theblixguy
Copy link
Author

@heinrichreimer I tried that as well, same error

@heinrichreimer
Copy link
Owner

Please send some more information how I can reproduce the error. Which Android version or device are you using. Or send me some parts of your code like the layout XML and your Activity.

@mishushakov
Copy link

Hi Guys,i use this library in my Project,in the "onCreate" methode application crash...
Tests:
Android 5.0-Crash
KitKat 4.4.2-Ok
Jelly Bean 4.3-Ok
ICS-Crash
Android 4.0-4.3+5.0=Craaash
I have find the error in Code after creating the drawer the app crash out
Ps. Sorry for my bad english :(

@heinrichreimer
Copy link
Owner

@theblixguy Any update on your issue?

@theblixguy
Copy link
Author

Yeah, I still have the same error. I'll try the newest version of your lib and let you know if it still exists

@heinrichreimer
Copy link
Owner

Does this error occur when you use material-drawer on a real device or only in the layout editor?

@theblixguy
Copy link
Author

When I run the app on device

@heinrichreimer
Copy link
Owner

Just to help me reproducing the problem: can you tell me which device you're using and on what Android version?
Do you use any special type of Activity or LayoutInflater?

@theblixguy
Copy link
Author

Xperia Z3 w/ Lollipop 5.0.2

Nope, just a normal action bar activity

@heinrichreimer
Copy link
Owner

To fix this issue:

  1. Send me some extracts of your code (e.g. layout_main.xml or MainActivity.java...)
  2. Describe the steps to reproduce the error.
    I hope I can reproduce and then fix it soon 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants