I am new to the forum and just started learning about Android app development. I was going through the tutorials at developer.android.com and already ran into an compiling error. I see these three errors on my activity_main.xml:
error: Error: String types not allowed (at 'layout_height' with value 'wrap content'). activity_main.xml
error: Error: String types not allowed (at 'layout_width' with value 'wrap content'). activity_main.xml
error: Error: String types not allowed (at 'layout_height' with value 'wrap content'). activity_main.xml
and here is my activity_main.xml code as of now:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
tools:context=".MainActivity" >
<EditText android:id="@+id/edit_message"
android:layout_width="0dp"
android:layout_height="wrap content"
android:layout_weight="1"
android:hint="@string/edit_message" />
<Button
android:layout_width="wrap content"
android:layout_height="wrap content"
android:text="@string/button_send" />
</LinearLayout>
Is it throwing an error because wrap_content is an incorrect syntax or does it need to be declared elsewhere? Any help will be appreciated on how to troubleshoot or fix this.
Thanks!
I've just started learning myself. I believe the problem is missing underscores. It should read "wrap_content" not "wrap content".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With