The following "version" in the XML declaration must be a quoted string

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?

Jon Skeet
people
quotationmark

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.

people

See more on this question at Stackoverflow