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

android.view.ViewGroup$LayoutParams cannot be cast to android.widget.LinearLayout$LayoutParams #4

Closed
wiseman opened this issue Dec 11, 2013 · 4 comments

Comments

@wiseman
Copy link

wiseman commented Dec 11, 2013

Using [lein-droid "0.2.0-preview4"], I can compile the app, but when I run it on my Galaxy Nexus with Android 4.2.2 I get the following:

E/AndroidRuntime(28869): FATAL EXCEPTION: main
E/AndroidRuntime(28869): java.lang.ClassCastException: android.view.ViewGroup$LayoutParams cannot be cast to android.widget.LinearLayout$LayoutParams
E/AndroidRuntime(28869):    at android.widget.LinearLayout.measureVertical(LinearLayout.java:669)
E/AndroidRuntime(28869):    at android.widget.LinearLayout.onMeasure(LinearLayout.java:588)
E/AndroidRuntime(28869):    at android.view.View.measure(View.java:15525)
E/AndroidRuntime(28869):    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4825)
E/AndroidRuntime(28869):    at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
E/AndroidRuntime(28869):    at android.view.View.measure(View.java:15525)
E/AndroidRuntime(28869):    at android.widget.LinearLayout.measureVertical(LinearLayout.java:847)
E/AndroidRuntime(28869):    at android.widget.LinearLayout.onMeasure(LinearLayout.java:588)
E/AndroidRuntime(28869):    at android.view.View.measure(View.java:15525)
E/AndroidRuntime(28869):    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4825)
E/AndroidRuntime(28869):    at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
E/AndroidRuntime(28869):    at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2434)
E/AndroidRuntime(28869):    at android.view.View.measure(View.java:15525)
E/AndroidRuntime(28869):    at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1874)
E/AndroidRuntime(28869):    at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1089)
E/AndroidRuntime(28869):    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1265)
E/AndroidRuntime(28869):    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:989)
E/AndroidRuntime(28869):    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4351)
E/AndroidRuntime(28869):    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
E/AndroidRuntime(28869):    at android.view.Choreographer.doCallbacks(Choreographer.java:562)
E/AndroidRuntime(28869):    at android.view.Choreographer.doFrame(Choreographer.java:532)
E/AndroidRuntime(28869):    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
E/AndroidRuntime(28869):    at android.os.Handler.handleCallback(Handler.java:725)
E/AndroidRuntime(28869):    at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime(28869):    at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(28869):    at android.app.ActivityThread.main(ActivityThread.java:5226)
E/AndroidRuntime(28869):    at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(28869):    at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime(28869):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
E/AndroidRuntime(28869):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562)
E/AndroidRuntime(28869):    at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager(  406):   Force finishing activity org.stuff.events/.MyActivity
@wiseman
Copy link
Author

wiseman commented Dec 11, 2013

A solution that worked for me was to change the dependency from [neko/neko "3.0.0-preview3"] to [neko/neko "3.0.0"].

@krisc
Copy link
Owner

krisc commented Dec 11, 2013

I'm hesitant to merge your pull request at the moment because the latest stable of neko (and lein-droid) causes problems for some people (myself included). In my tutorial, I encourage people to use preview4 for both. From what I gather from alex (the maintainer of lein-droid) these previews are pretty close to the stable versions. Does preview4 work for you?

If anything, the dependency should at least be 3.0.0-preview4 until we figure out why 3.0.0 is causing trouble. If preview4 in fact does work for you, I'll change the dep from preview3 to preview4 because that seems to work for most people.

@wiseman
Copy link
Author

wiseman commented Dec 12, 2013

Yes, 3.0.0-preview4 works for me. What sorts of problems did you see with 3.0.0? (I want to know what to look out for.)

@krisc
Copy link
Owner

krisc commented Dec 13, 2013

I don't have time to recreate the problem I was having right now, but it wouldn't compile. If I remember correctly, it was an error similar to yours.

Great that preview4 works for you. I'll close this for now and change the dep to preview4 when I get around to it.

@krisc krisc closed this as completed Dec 13, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants