Android Studio 中报错:Error:(398, 30) 错误: 找不到符号 符号: 方法 ceil(float) 位置: 类 FloatMath 注: 某些输入文件使用或覆盖了已过时
报错提示:
Android Studio 中报错:
F:\Android\Workspace\NewsApplication\Indicatorlibrary\src\main\java\com\viewpagerindicator\LinePageIndicator.java
Error:(372, 30) 错误: 找不到符号
符号: 方法 ceil(float)
位置: 类 FloatMath
Error:(398, 30) 错误: 找不到符号
符号: 方法 ceil(float)
位置: 类 FloatMath
注: 某些输入文件使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
2 个错误
Error:Execution failed for task ':Indicatorlibrary:compileDebugJavaWithJavac'.
分析:
类 FloatMath,此 API 过时了,Android 6.0 不再使用了
解决思路及方案:
把 FloatMath 换成 Math,得到解决