Reputation: 21
my activity_main.xml file looks like this:
<?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=”fill_parent”
android:orientation=”vertical” >
<TextView
android:id=”@+id/mytext”
android:layout_width=”fill_parent”
android:layout_height=”wrap_content”
android:text=”@string/hello” />
</LinearLayout>
How am I supposed to fix this error?
Upvotes: 1
Views: 9400
Reputation: 29
You should declare the version as a char literal not String literal. Exp:
<?xml version='1.0'?>
Upvotes: 2
Reputation: 1503290
It looks to me as if you've pasted some text from Word or something similar, which means you've got "curly quotes". So your XML declaration looks like this:
<?xml version=”1.0” encoding=”utf-8” ?>
when it should be like this:
<?xml version="1.0" encoding="utf-8" ?>
Note the difference in quotes. You should fix all the quotes to be regular ASCII quotes... and ideally don't use whatever process you were following to copy and paste text from place to place... it's clearly not friendly to XML or anything else which relies on having regular quotes.
Upvotes: 5