I'm not sure if that's just a copy & paste error, but you close the 
LinearLayout tag prematurely. So all its attributes including layout_width 
just count as "unexpected text":

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"; > 


*                                                                         
^                                                                         
|                                                                         
Here*

You can easily spot these mistakes by running Android's excellent lint 
tool. If you are using Eclipse for development you should see a yellow 
warning triangle show up at that spot.

On Tuesday, October 14, 2014 6:42:59 PM UTC-5, Spooky wrote:
>
> I give up...I've gone through examples (including using my own past code 
> that worked), and no matter what I try, using ScrollView causes a force 
> close, claiming that I haven't provided a layout_width parameter (I 
> have).  In fact, I checked EVERYTHING in the layout file, and nothing 
> is missing layout_width or layout_height.  And yet, logcat still claims 
> it isn't there.  It even give me the line number where it isn't (and is) 
> there.  I have been going in circles on this for hours....can someone 
> please point out what I'm not seeing? 
>
> Here is the layout file (main.xml): 
>
> ---------------------------  CUT HERE  --------------------------- 
> <?xml version="1.0" encoding="utf-8"?> 
> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"; 
> > 
>     android:layout_width="fill_parent" 
>     android:layout_height="wrap_content" 
>     android:background="#000000" 
>     android:orientation="vertical" 
>     tools:context="com.jdgapps.andgtbrew2.AndGTbrew2" > 
>
>    <ScrollView 
>       android:layout_width="fill_parent" 
>       android:layout_height="80dp" 
>       android:layout_alignParentLeft="true" 
>       android:layout_alignParentTop="true" > 
>
>       <LinearLayout 
>          android:id="@+id/linearLayout1" 
>          android:layout_width="match_parent" 
>          android:layout_height="fill_parent" 
>          android:gravity="center_vertical|center_horizontal" 
>          android:orientation="vertical" > 
>
>    <Button android:text="@string/newBrewStr" 
>       android:id="@+id/newBrewView" 
>       android:layout_width="wrap_content" 
>       android:layout_height="wrap_content" 
>       android:padding="10sp" 
>       android:textSize="24sp" 
>       android:textColor="#FFFFFF" 
>       android:layout_alignParentTop="true" 
>       android:background="#00000000" /> 
>
>    <Button android:text="@string/openExistingStr" 
>       android:id="@+id/openExistingView" 
>       android:layout_width="wrap_content" 
>       android:layout_height="wrap_content" 
>       android:padding="10sp" 
>       android:textSize="24sp" 
>       android:textColor="#FFFFFF" 
>       android:background="#00000000" /> 
>
>    <Button android:text="@string/cloneStr" 
>       android:id="@+id/cloneBrewView" 
>       android:layout_width="wrap_content" 
>       android:layout_height="wrap_content" 
>       android:padding="10sp" 
>       android:textSize="24sp" 
>       android:textColor="#FFFFFF" 
>       android:background="#00000000" /> 
>
>    <Button android:text="@string/reformulateStr" 
>       android:id="@+id/reformulateView" 
>       android:layout_width="wrap_content" 
>       android:layout_height="wrap_content" 
>       android:padding="10sp" 
>       android:textSize="24sp" 
>       android:textColor="#FFFFFF" 
>       android:background="#00000000" /> 
>
>    <Button android:text="@string/brewToFileStr" 
>       android:id="@+id/brewToFileView" 
>       android:layout_width="wrap_content" 
>       android:layout_height="wrap_content" 
>       android:padding="10sp" 
>       android:textSize="24sp" 
>       android:textColor="#FFFFFF" 
>       android:background="#00000000" /> 
>
>    <Button android:text="@string/reportToFileStr" 
>       android:id="@+id/reportToFileView" 
>       android:layout_width="wrap_content" 
>       android:layout_height="wrap_content" 
>       android:padding="10sp" 
>       android:textSize="24sp" 
>       android:textColor="#FFFFFF" 
>       android:background="#00000000" /> 
>
>    <Button android:text="@string/reportToTeXStr" 
>       android:id="@+id/reportToTeXView" 
>       android:layout_width="wrap_content" 
>       android:layout_height="wrap_content" 
>       android:padding="10sp" 
>       android:textSize="24sp" 
>       android:textColor="#FFFFFF" 
>       android:background="#00000000" /> 
>
>    </LinearLayout> 
>    </ScrollView> 
> </LinearLayout> 
>
> ---------------------------  CUT HERE  --------------------------- 
>
> And here is the error I'm getting in logcat: 
>
> ---------------------------  CUT HERE  --------------------------- 
> 10-14 18:20:42.276 E/AndroidRuntime(19964): java.lang.RuntimeException: 
> Unable to start activity 
> ComponentInfo{com.jdgapps.andgtbrew2/com.jdgapps.andgtbrew2.AndGTbrew2}: 
> java.lang.RuntimeException: Binary XML file line #2: You must supply a 
> layout_width attribute. 
>
> 10-14 18:20:42.276 E/AndroidRuntime(19964):         at 
> com.jdgapps.andgtbrew2.AndGTbrew2.onCreate(AndGTbrew2.java:54) 
> ---------------------------  CUT HERE  --------------------------- 
>
> Take the ScrollView out, and it works...but only in Portrait.  In 
> Landscape, it NEEDS that ScrollView. 
>
> Does anyone see anything I'm not? 
>
> Thanks, 
>    --jim 
>
> -- 
> THE SCORE:  ME:  2  CANCER:  0 
> 73 DE N5IAL (/4)          | 
> [email protected] <javascript:>      | BOFH Excuse for the day: 
> < Running Mac OS X Lion > | 
> ICBM / Hurricane:         | Paradigm shift without 
>    30.44406N 86.59909W    | a clutch. 
>                             
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to