莫道桑榆晚,为霞尚满天。这篇文章主要讲述android - Youtube api 400 Bad Request相关的知识,希望能为你提供帮助。
YouTube Api发出以下错误,但我在查询中提供了“代码段”,它在调试版中运行良好,而且在我签名的Apk版本中无效
{
"errors" : [ {
"domain" : "global",
"reason" : "required",
"message" : "Required parameter: part",
"locationType" : "parameter",
"location" : "part"
} ],
"code" : 400,
"message" : "Required parameter: part"
}
这是我的查询代码:query = youTube.playlists()。list(“snippet”);
query.setKey(getYTkey());
query.setChannelId(con[0].getString(R.string.CHANNEL_ID));
query.setMaxResults((long) 25);
答案【android - Youtube api 400 Bad Request】更改proguard规则如下:
-keep class com.google.**
-keep interface com.google.** { *;
}
-dontwarn com.google.**-keep class com.google.api.** {
*;
}# Needed by google-api-client to keep generic types and @Key annotations accessed via reflection
-keepclassmembers class * {
@com.google.api.client.util.Key <
fields>
;
}# Needed by google-http-client-android when linking against an older platform version
-dontwarn com.google.api.client.extensions.android.**# Needed by google-api-client-android when linking against an older platform version
-dontwarn com.google.api.client.googleapis.extensions.android.**# Needed by google-play-services when linking against an older platform version
-keep class com.google.android.gms.** { *;
}
-dontwarn com.google.android.gms.**
-dontnote com.google.android.gms.**
# com.google.client.util.IOUtils references java.nio.file.Files when on Java 7+
-dontnote java.nio.file.Files, java.nio.file.Path# Suppress notes on LicensingServices
-dontnote **.ILicensingService# Suppress warnings on sun.misc.Unsafe
-dontnote sun.misc.Unsafe
-dontwarn sun.misc.Unsafe
推荐阅读
- 在Android的特殊时间结束视频Youtube
- 限制为Android时,YouTube API密钥会出现500错误
- AppleScript无法获得api响应的引用形式
- YouTube Android Player API无法在xiaomi Redmi Note 3中使用
- 我们可以在React Kendo Grid Wrapper上添加虚拟滚动
- 带Gmail的Log4Net SMTP Appender
- 通过C#通过Google Apps帐户发送电子邮件
- 通过Google Apps向Django发送电子邮件时,为电子邮件帐户指定名称
- 如何接收电子邮件(节点app / ubuntu服务器[重复])