在我们的项目中,gdata只有在设备语言设置为土耳其语时才无法加载YouTube播放列表。以下是一些日志:
Caused by: com.google.gdata.util.ParseException: Invalid value for attribute : 'name'
at com.google.gdata.data.AttributeHelper.consumeEnum(AttributeHelper.java:592)
at com.google.gdata.data.youtube.YtPublicationState.consumeAttributes(YtPublicationState.java:184)
at com.google.gdata.data.AbstractExtension$AttributesHandler.processEndElement(AbstractExtension.java:263)
at com.google.gdata.util.XmlParser.endElement(XmlParser.java:1013)
at org.xml.sax.helpers.ParserAdapter.endElement(ParserAdapter.java:621)
at org.xml.sax.helpers.XMLReaderAdapter.endElement(XMLReaderAdapter.java:353)
at org.apache.harmony.xml.ExpatParser.endElement(ExpatParser.java:156)
at org.apache.harmony.xml.ExpatParser.appendChars(Native Method)
at org.apache.harmony.xml.ExpatParser.parseFragment(ExpatParser.java:497)
at org.apache.harmony.xml.ExpatParser.parseDocument(ExpatParser.java:484)
at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:309)
at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:267)
at org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter.java:223)
at org.xml.sax.helpers.ParserAdapter.parse(ParserAdapter.java:401)
at com.google.gdata.util.XmlParser.parse(XmlParser.java:694)
... 24 more
d[GAThread,5,main]: Service unavailable (code=1), will retry.
d[Service Reconnect,5,main]: Service unavailable (code=1), using local store.
Request failed. Response code: 503, body: org.apache.http.message.BasicHttpResponse@
看起来 youtube 解析器失败了。这个问题是相关的:https://code.google.com/p/gdata-java-client/issues/detail?id=126,我已经下载了最新的gdata
库,但没有任何帮助。此外,我还按照INSTALL-src
文件中的描述重新构建了gdata
,但是新生成的jar
文件的大小(~每个>2kB)相对于原始jar
不同,尽管我没有更改代码。我在构建过程中有这样的警告:
[javac] m:devgdata-libsgdatajavabuild-srccore.xml:155: warning: 'inclu
deantruntime' was not set, defaulting to build.sysclasspath=last; set to false f
or repeatable builds
[jar] Building jar: m:devgdata-libsgdatajavalibgdata-youtube-2.0.jar
当我尝试在我的项目中替换这些jar
时,我收到验证错误:
Could not find class 'com.google.gdata.data.youtube.VideoFeed', referenced from method com.my.package
10-13 21:14:15.620: W/dalvikvm(32724): VFY: unable to resolve const-class 3981 (Lcom/google/gdata/data/youtube/VideoFeed;) in Lcom/my/package;
感谢任何帮助。谢谢,迈克。
我建议您尽快迁移到Data API v3。下面是一个包含 Data API v3 的 Android 项目示例。