giphy的docs中用于获取趋势gif的示例代码如下
/// Trending Gifs
client.trending(MediaType.gif, null, null, null, new
CompletionHandler<ListMediaResponse>() {
@Override
public void onComplete(ListMediaResponse result, Throwable e) {
if (result == null) {
// Do what you want to do with the error
} else {
if (result.getData() != null) { //Problem on release build
for (Media gif : result.getData()) {
Log.v("giphy", gif.getId());
}
} else {
Log.e("giphy error", "No results found");
}
}
}
});这段代码在开发环境中运行良好。但是在发布版本中,result.getData()总是返回null。无法弄清楚问题出在哪里。我也尝试过使用giphy的生产密钥,但没有成功。
发布于 2019-02-21 16:16:02
需要为giphy添加前卫规则
-keepclassmembernames class com.giphy.sdk.core.models.** { *; }
-keepclassmembernames class com.giphy.sdk.core.network.response.** { *; }
-keepattributes *Annotation*
-dontwarn com.giphy.sdk.core.**https://stackoverflow.com/questions/54802222
复制相似问题