4

I haven't touched my Android Studio for a loooong time, it still worked fine when I launched it, but then I updated to 3.3.0 and I get a 'gradle project sync failed'. I know this is not trivial to debug via SO, but I tried to find anything similar and I lack of knowledge about the entire studio didn't help.

So maybe you can guide me to a solution, I'm not sure what files are necessary, but here is the actual error:

ERROR: Failed to parse XML in C:\Users\roberts\AndroidProjects\LingoFlash\app\src\main\AndroidManifest.xml ParseError at [row,col]:[27,9] Message: expected start or end tag Affected Modules: app

This is the AndroidManifest.xml file:

 20     <application
 21         android:allowBackup="true"
 22         android:icon="@mipmap/ic_launcher"
 23         android:label="@string/app_name"
 24         android:supportsRtl="true"
 25         android:theme="@style/MyMaterialTheme">
 26         //------------------------------------------------------------------------------------------
 27         <activity android:name=".MainActivity">
 28             <intent-filter>
 29                 <action android:name="android.intent.action.MAIN" />
 30                 <category android:name="android.intent.category.LAUNCHER" />
 31             </intent-filter>
 32         </activity>

so what's wrong at line 27? seems to point to the MainActivity

before I paste a ton of data, what would help to debug this?

Sneh Pandya
  • 8,197
  • 7
  • 35
  • 50
Mairyu
  • 809
  • 7
  • 24

2 Answers2

4

Comments in xml files do not start with Double slash // they work with <!--Your comments-->. Your manifest is having lines that start with // remove them and try to clean and build your project.

karan
  • 8,637
  • 3
  • 41
  • 78
  • ahh, D'OH ! Not only did I have that, but I had totally wrong XML syntax later in the file. HOWEVER, this all did work (and still works on a different machine) with the older 3.2 Studio Version, so something changed in 3.3 (which is probably a good thing). Thanks ! – Mairyu Jan 25 '19 at 06:20
  • 1
    Did the same mistake. Couldn't found the solution until see this answer. Great – Dis_Pro Feb 21 '19 at 17:16
0

Check if you have some wrong character found in the [27,9] position of the AndroidManifest.xml.

Refs: https://stackoverflow.com/a/52932622/8034839

shizhen
  • 12,251
  • 9
  • 52
  • 88