android - Youtube api 400 Bad Request

莫道桑榆晚,为霞尚满天。这篇文章主要讲述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


    推荐阅读