您的位置:首页 > 移动开发 > Android开发

PullToRefreshWebView:can't find referenced method 'float floor(float)' in library class android.util

2017-06-08 09:48 513 查看
转载或引用请注明出处,谢谢!http://blog.csdn.net/wj9966
使用张鸿洋大神的 PullToRefresh,很好用,但是打包的时候报错PullToRefreshWebView:can't
find referenced method 'float floor(float)' in library class android.util

使用PullToRefresh库方法:

在build.gradle中添加

compile 'com.github.userswlwork:pull-to-refresh:1.0.0'


具体错误

Warning:com.handmark.pulltorefresh.library.PullToRefreshWebView: can't find referenced method 'float floor(float)' in library class android.util.FloatMath

Warning:com.handmark.pulltorefresh.library.PullToRefreshWebView$InternalWebViewSDK9: can't find referenced method 'float floor(float)' in library class android.util.FloatMath

Warning:there were 2 unresolved references to library class members.

Warning:Exception while processing task java.io.IOException: Please correct the above warnings first.

Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.

> java.io.IOException: Please correct the above warnings first.

出现原因

PullToRefreshWebView中使用FloatMath.floor()来转换数据

protected boolean isReadyForPullEnd() {
float exactContentHeight = FloatMath.floor((float)((WebView)this.mRefreshableView).getContentHeight() * ((WebView)this.mRefreshableView).getScale());
return (float)((WebView)this.mRefreshableView).getScrollY() >= exactContentHeight - (float)((WebView)this.mRefreshableView).getHeight();
}



解决办法

在项目中混淆时添加:

-dontwarn com.handmark.**
-keep class org.openudid.** { *; }


                                                                                        转载或引用请注明出处,谢谢!http://blog.csdn.net/wj9966
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐