[android-developers] Re: java.lang.RuntimeException: Binary XML file line #26: You must supply a layout_height attribute.
ying lcs wrote: I get the following error in logcat: java.lang.RuntimeException: Binary XML file line #26: You must supply a layout_height attribute. Can you please tell me which xml file that I am missing? You are not missing a file. However, one of your layout XML files has an element that is missing the android:layout_height attribute. Unfortunately, the error processing does not really tell you which layout it is. And it said 'binary xml', does it mean it is actually line 26 in my file? Yes. Binary XML technically refers to the aapt-compacted version of the layout, but it is still line 26 of whichever layout it is. -- Mark Murphy (a Commons Guy) http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 2.0 Published! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: java.lang.RuntimeException: Binary XML file line #26: You must supply a layout_height attribute.
Check the file you are passing to setContentView (or whatever file you are using for your view) inside your activity. Line 26 is missing the required attribute. On Feb 15, 5:28 pm, ying lcs ying...@gmail.com wrote: I get the following error in logcat: java.lang.RuntimeException: Binary XML file line #26: You must supply a layout_height attribute. Can you please tell me which xml file that I am missing? And it said 'binary xml', does it mean it is actually line 26 in my file? or it is line 26 in the file after it compiles to be a binary xml file? Thank you. 02-15 17:19:58.873: WARN/WindowManager(50): Exception when adding starting window 02-15 17:19:58.873: WARN/WindowManager(50): java.lang.RuntimeException: Binary XML file line #26: You must supply a layout_height attribute. 02-15 17:19:58.873: WARN/WindowManager(50): at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:438) 02-15 17:19:58.873: WARN/WindowManager(50): at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:3236) 02-15 17:19:58.873: WARN/WindowManager(50): at android.view.ViewGroup$MarginLayoutParams.init(ViewGroup.java:3315) 02-15 17:19:58.873: WARN/WindowManager(50): at android.widget.LinearLayout$LayoutParams.init(LinearLayout.java:1262) 02-15 17:19:58.873: WARN/WindowManager(50): at android.widget.LinearLayout.generateLayoutParams(LinearLayout.java:1188) 02-15 17:19:58.873: WARN/WindowManager(50): at android.widget.LinearLayout.generateLayoutParams(LinearLayout.java:45) 02-15 17:19:58.873: WARN/WindowManager(50): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619) 02-15 17:19:58.873: WARN/WindowManager(50): at android.view.LayoutInflater.inflate(LayoutInflater.java:407) 02-15 17:19:58.873: WARN/WindowManager(50): at android.view.LayoutInflater.inflate(LayoutInflater.java:320) 02-15 17:19:58.873: WARN/WindowManager(50): at android.view.LayoutInflater.inflate(LayoutInflater.java:276) 02-15 17:19:58.873: WARN/WindowManager(50): at com.android.internal.policy.impl.PhoneWindow.generateLayout(PhoneWindow.java:1989) 02-15 17:19:58.873: WARN/WindowManager(50): at com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:2043) 02-15 17:19:58.873: WARN/WindowManager(50): at com.android.internal.policy.impl.PhoneWindow.getDecorView(PhoneWindow.java:1291) 02-15 17:19:58.873: WARN/WindowManager(50): at com.android.internal.policy.impl.PhoneWindowManager.addStartingWindow(PhoneWindowManager.java:541) 02-15 17:19:58.873: WARN/WindowManager(50): at com.android.server.WindowManagerService$H.handleMessage(WindowManagerService.java:5905) 02-15 17:19:58.873: WARN/WindowManager(50): at android.os.Handler.dispatchMessage(Handler.java:88) 02-15 17:19:58.873: WARN/WindowManager(50): at android.os.Looper.loop(Looper.java:123) 02-15 17:19:58.873: WARN/WindowManager(50): at com.android.server.WindowManagerService$WMThread.run(WindowManagerService.java:372) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: java.lang.RuntimeException: Binary XML file line #26: You must supply a layout_height attribute.
This error message means that the layout file for this particular activity does not specify the layout height attribute. I would guess that the LinearLayout height should be set to fill_parent, so that it would consume the entire screen (vertically). Hope that makes sense, Sergey ying lcs wrote: I get the following error in logcat: java.lang.RuntimeException: Binary XML file line #26: You must supply a layout_height attribute. Can you please tell me which xml file that I am missing? And it said 'binary xml', does it mean it is actually line 26 in my file? or it is line 26 in the file after it compiles to be a binary xml file? Thank you. 02-15 17:19:58.873: WARN/WindowManager(50): Exception when adding starting window 02-15 17:19:58.873: WARN/WindowManager(50): java.lang.RuntimeException: Binary XML file line #26: You must supply a layout_height attribute. 02-15 17:19:58.873: WARN/WindowManager(50): at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:438) 02-15 17:19:58.873: WARN/WindowManager(50): at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:3236) 02-15 17:19:58.873: WARN/WindowManager(50): at android.view.ViewGroup$MarginLayoutParams.init(ViewGroup.java:3315) 02-15 17:19:58.873: WARN/WindowManager(50): at android.widget.LinearLayout$LayoutParams.init(LinearLayout.java:1262) 02-15 17:19:58.873: WARN/WindowManager(50): at android.widget.LinearLayout.generateLayoutParams(LinearLayout.java:1188) 02-15 17:19:58.873: WARN/WindowManager(50): at android.widget.LinearLayout.generateLayoutParams(LinearLayout.java:45) 02-15 17:19:58.873: WARN/WindowManager(50): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619) 02-15 17:19:58.873: WARN/WindowManager(50): at android.view.LayoutInflater.inflate(LayoutInflater.java:407) 02-15 17:19:58.873: WARN/WindowManager(50): at android.view.LayoutInflater.inflate(LayoutInflater.java:320) 02-15 17:19:58.873: WARN/WindowManager(50): at android.view.LayoutInflater.inflate(LayoutInflater.java:276) 02-15 17:19:58.873: WARN/WindowManager(50): at com.android.internal.policy.impl.PhoneWindow.generateLayout(PhoneWindow.java:1989) 02-15 17:19:58.873: WARN/WindowManager(50): at com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:2043) 02-15 17:19:58.873: WARN/WindowManager(50): at com.android.internal.policy.impl.PhoneWindow.getDecorView(PhoneWindow.java:1291) 02-15 17:19:58.873: WARN/WindowManager(50): at com.android.internal.policy.impl.PhoneWindowManager.addStartingWindow(PhoneWindowManager.java:541) 02-15 17:19:58.873: WARN/WindowManager(50): at com.android.server.WindowManagerService$H.handleMessage(WindowManagerService.java:5905) 02-15 17:19:58.873: WARN/WindowManager(50): at android.os.Handler.dispatchMessage(Handler.java:88) 02-15 17:19:58.873: WARN/WindowManager(50): at android.os.Looper.loop(Looper.java:123) 02-15 17:19:58.873: WARN/WindowManager(50): at com.android.server.WindowManagerService$WMThread.run(WindowManagerService.java:372) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---