Fixed
Status Update
Comments
rm...@google.com <rm...@google.com> #2
Thank you for your feedback. Team may reach out for more feedback in reproducing or triaging this issue.
cp...@google.com <cp...@google.com> #3
To my knowledge, only the IDE itself should be accessing that XML file for lint purposes. To Tor to comment.
[Deleted User] <[Deleted User]> #4
I have reported it to Gradle, presumably they will be able to fix it then: https://github.com/gradle/gradle/issues/8872
fa...@gmail.com <fa...@gmail.com> #5
13:26:56.767 [DEBUG] [sun.net.www.protocol.http.HttpURLConnection] sun.net.www.MessageHeader@634f217412 pairs: {null: HTTP/1.1 301 Moved Permanently}{Location: https://dl.google.com/dl/android/maven2/master-index.xml}{Content-Type : text/html; charset=UTF-8}{X-Content-Type-Options: nosniff}{Date: Fri, 08 Mar 2019 22:50:15 GMT}{Expires: Sun, 07 Apr 2019 22:50:15 GMT}{Server: sffe}{Content-Length: 253}{X-XSS-Protection: 1; mode=block}{Cache-Control: public, max-age=2592000}{Age: 1604219}{Alt-Svc: quic=":443"; ma=2592000; v="46,44,43,39"}
po...@gmail.com <po...@gmail.com> #6
tgryjyh
tn...@google.com <tn...@google.com> #7
Sorry, I overlooked this bug.
Comment #3 is misleading; the stacktrace shown here *is* the IDE attempting to load the XML file.
The code assumes that the file it gets back is an XML file. And I'm really puzzled why it wouldn't be; that's a URL which hasn't changed. Could there have been some sort of temporary network/service outage here onmaven.google.com which caused this? Certainly we don't see that error now. Or is there any kind of special set up in your network configuration (such as a redirect via proxies etc) which could explain this? (
Ideally the code should gracefully degrade if what it gets back isn't a valid XML document, and I'll make it do that -- but in the meantime I thought I'd ask more about the circumstances where you encountered this.
(I do know that if I connect my laptop for example at an airport or coffee shop and try to access certain files, everything gets redirected to a "portal" HTML page; maybe that's what happened here, and which is why we need to look at the returned document and make sure the root tag is what we expect before we proceed.)
The code assumes that the file it gets back is an XML file. And I'm really puzzled why it wouldn't be; that's a URL which hasn't changed. Could there have been some sort of temporary network/service outage here on
Ideally the code should gracefully degrade if what it gets back isn't a valid XML document, and I'll make it do that -- but in the meantime I thought I'd ask more about the circumstances where you encountered this.
(I do know that if I connect my laptop for example at an airport or coffee shop and try to access certain files, everything gets redirected to a "portal" HTML page; maybe that's what happened here, and which is why we need to look at the returned document and make sure the root tag is what we expect before we proceed.)
tn...@google.com <tn...@google.com> #8
(In any case, this is an Android Studio bug, not a bug in Gradle itself.)
tn...@google.com <tn...@google.com> #9
Fix pending in Change-Id: I6682ff4ce102d002e2f675fd6fdef1662dddd8db
[Deleted User] <[Deleted User]> #10
The project I experienced this on, is a Unity project that has our own Android building tool, that utilizes building through gradle commandline. Since it has been over a year I have forgotten if it is possible I may have built it through Android Studio for debugging reasons, but I am fairly certain the issue existed when built through commandline. I do not see the error anymore when building, despite not having updated the build tools since.
The project uses:
classpath 'com.android.tools.build:gradle:3.2.0'
classpath 'com.novoda:gradle-android-command-plugin:1.4.0'
...
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
And it has several native Android plugins implemented, some which has other dependencies such as Google Play Services. Each modules build.gradle contains these as repositories:
google()
mavenCentral()
jcenter()
The project uses:
classpath 'com.android.tools.build:gradle:3.2.0'
classpath 'com.novoda:gradle-android-command-plugin:1.4.0'
...
distributionUrl=https\://
And it has several native Android plugins implemented, some which has other dependencies such as Google Play Services. Each modules build.gradle contains these as repositories:
google()
mavenCentral()
jcenter()
tn...@google.com <tn...@google.com> #11
Thanks! This should be handled gracefully now (in Studio 4.1), as well as from the Gradle plugin when running the lint task. Fixed by Change-Id: I6682ff4ce102d002e2f675fd6fdef1662dddd8db.
Again thanks for the report and sorry about the slow response.
Again thanks for the report and sorry about the slow response.
Description
That is, Gradle attempts to access master-index.xml through google(), which instead of sending the xml file back, sends an error 301 "Moved Permanently". That is an html, but because the request will access that, it then attempts to parse it as an xml.
Request to get the master-index.xml through google():
3:26:56.728 [DEBUG] [sun.net.www.protocol.http.HttpURLConnection] sun.net.www.MessageHeader@5b25e4c85 pairs: {GET /master-index.xml HTTP/1.1: null}{User-Agent: Java/1.8.0_121}{Host:
Callback from the request, saying 301 Moved Permanently, instead of 200 OK:
13:26:56.767 [DEBUG] [sun.net.www.protocol.http.HttpURLConnection] sun.net.www.MessageHeader@634f217412 pairs: {null: HTTP/1.1 301 Moved Permanently}{Location:
Gradle then tries to parse the redirect notice, instead of downloading the xml from the redirect:
13:26:56.800 [ERROR] [system.err] org.xmlpull.v1.XmlPullParserException: expected: /meta read: HEAD (position:END_TAG </HEAD>@2:32 in java.io.InputStreamReader@3477393d)
13:26:56.814 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
13:26:56.830 [ERROR] [system.err] at org.kxml2.io.KXmlParser.exception(Unknown Source)
13:26:56.861 [ERROR] [system.err] at org.kxml2.io.KXmlParser.error(Unknown Source)
13:26:56.874 [ERROR] [system.err] at org.kxml2.io.KXmlParser.parseEndTag(Unknown Source)
13:26:56.886 [ERROR] [system.err] at org.kxml2.io.KXmlParser.nextImpl(Unknown Source)
13:26:56.899 [ERROR] [system.err] at org.kxml2.io.KXmlParser.next(Unknown Source)
13:26:56.913 [ERROR] [system.err] at com.android.ide.common.repository.GoogleMavenRepository.readMasterIndex(GoogleMavenRepository.kt:141)
13:26:56.926 [ERROR] [system.err] at com.android.ide.common.repository.GoogleMavenRepository.getPackageMap(GoogleMavenRepository.kt:114)
13:26:56.937 [ERROR] [system.err] at com.android.ide.common.repository.GoogleMavenRepository.findArtifact(GoogleMavenRepository.kt:107)
13:26:56.948 [ERROR] [system.err] at com.android.ide.common.repository.GoogleMavenRepository.findVersion(GoogleMavenRepository.kt:102)
13:26:56.962 [ERROR] [system.err] at com.android.ide.common.repository.GoogleMavenRepository.findVersion(GoogleMavenRepository.kt:85)
13:26:56.975 [ERROR] [system.err] at ....