• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Android update is failing

RhinoCan

Well-Known Member
I'm trying to update my copy of Android Studio from 3.3 to the latest and greatest version but the update fails.

Here's the full text of the message(s). (I'm not too worried about the second message; I see it's just a warning of some functionality being deprecated at the end of the year.):

ERROR: Failed to parse XML in C:\Users\Kathe\Downloads\android-RuntimePermissions-master\CWFRecyclerview\app\src\main\AndroidManifest.xml
ParseError at [row,col]:[30,13]
Message: expected start or end tag
Affected Modules: app


WARNING: API 'variant.getExternalNativeBuildTasks()' is obsolete and has been replaced with 'variant.getExternalNativeBuildProviders()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getExternalNativeBuildTasks(), use -Pandroid.debug.obsoleteApi=true on the command line to display a stack trace.
Affected Modules: app
I'd be grateful if someone could suggest what I can do to fix the error. Or do I have to delete Android Studio and then install the new version fresh?

I'm running the latest update of Windows 10 Home.
 
Last edited:
Thanks very much for your speedy reply. Unfortunately, your suggestion isn't working for me.

When I got into the project-level Gradle file, I found there was already a line in the Dependencies section that said
Code:
classpath 'io.fabric.tools:gradle:1.25.4'

At that point, I wasn't sure whether you meant I should REPLACE that line with the 1.28.1 line or add it so I added it, exactly as you said. That failed on the same error as I originally mentioned. At that point, I deleted the 1.25.4 line and kept the 1.28.1 line but that failed too, on the same error.

What else can I try?
 
You have another error not yet solved

Perhaps you miss some closing tag in Android Manifest?

Anyone can make a typo but I was very careful. I just checked all my braces to make sure I didn't erase one by mistake but I don't see anything like that: every brace has a mate and the mates are where I think they should be. I have matching apostrophes on the line I added and the typing matches what you gave me. (You are missing the end apostrophe in your message but I added one in mine.)

The line it is complaining about is just a single close-brace in the allprojects section. Here's what's in that section:
Code:
allprojects {
    repositories {
       google()
       jcenter()
       maven {
           url "https://maven.google.com"
      }
  }
}

The third last brace, the one that closes off the maven item, is the one it's complaining about (assuming 30,13 refers to the Google project level build.gradle as you told me.
 
Please post the complete manifest file (AndroidManifest.xml)

Okay, here it is:

Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.android.twlistsales">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.SEND_SMS" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".ListSales">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".AddSale" />
        <activity android:name=".EditSale" />
        <activity android:name=".RemoveSale" />
        <activity android:name=".About" android:parentActivityName=".ListSales"/>
        <activity
            android:name=".SettingsActivity"
            android:label="@string/title_activity_settings">
            android:parentActivityName=".MainActivity">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".ListSales" />
        </activity>
        <activity
            android:name=".SettingsActivity2"
            android:label="@string/title_activity_settings">
            android:parentActivityName=".MainActivity">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".ListSales" />
        </activity>
    </application>

</manifest>
 
same at line 36.

You're absolutely right! I haven't done any Android work in several months but I thought everything was working the last time I ran it so I'm surprised I didn't have trouble with the manifest before. Maybe the update from 3.2 to 3.3 caused the issue because it necessitated an update to the manifest file??

Anyway, my build works just fine now so you nailed the problem. But how did that error message point you toward the manifest? I'd like to learn how you diagnosed that problem if you can fill me in a bit.
 
Your original error mentioned line 30. Sometimes parser errors can be misleading because it scans ahead and tries to make sense of things. When it finally gives up, the error is at the place where it stopped. This could be several lines past the actual syntax error.
So I looked at the few lines before line 30, and noticed the extra closing '>'. Also, knowing XML syntax helps, and I could quickly see the problem.
XML elements have the following syntax:

Code:
<element 
   attribute1 
   attribute2
   ...
 >
</element>

So you can see the closing '>' terminates the element name. There should be only one closing '>' per element tag.
 
Maybe the update from 3.2 to 3.3 caused the issue because it necessitated an update to the manifest file??

I suspect the XML parser has changed, and it now gets upset by extra '>' being present, where previously it was smart enough to discard them.

Interestingly I pasted your XML into a couple of online XML validator sites, and they told me the XML was valid! Go figure..
 
Thanks for explaining that. I suppose it should have been obvious to me that an error in the Project build file had to involve the manifest and to look there but it's been several months since I last wrote Android code so that didn't occur to me; I thought I was looking for line 30 in the build file or maybe some file generated by the build.

I will try to remember to check the manifest first if a build doesn't work in future!

Thanks again!
 
Back
Top Bottom