[英]Error warning: [deprecation] signatures in PackageInfo has been deprecated for(Signature signature:info.signatures)
I getting these errors while I'm compiling.我在编译时收到这些错误。
This is the log,这是日志,
> Task :app:compileDebugJavaWithJavac
C:\Users\HP\Desktop\FoodieRiderv1.0\FoodieRider1.1.1\FoodiesRider\app\src\main\java\com\foodies\rider\ActivitiesAndFragments\Activities\SplashScreenActivity.java:198: warning: [deprecation] FusedLocationApi in LocationServices has been deprecated
mLastLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
^
C:\Users\HP\Desktop\FoodieRiderv1.0\FoodieRider1.1.1\FoodiesRider\app\src\main\java\com\foodies\rider\ActivitiesAndFragments\Activities\SplashScreenActivity.java:249: warning: [deprecation] isGooglePlayServicesAvailable(Context) in GooglePlayServicesUtil has been deprecated
.isGooglePlayServicesAvailable(this);
^
C:\Users\HP\Desktop\FoodieRiderv1.0\FoodieRider1.1.1\FoodiesRider\app\src\main\java\com\foodies\rider\ActivitiesAndFragments\Activities\SplashScreenActivity.java:251: warning: [deprecation] isUserRecoverableError(int) in GooglePlayServicesUtil has been deprecated
if (GooglePlayServicesUtil.isUserRecoverableError(resultCode)) {
^
C:\Users\HP\Desktop\FoodieRiderv1.0\FoodieRider1.1.1\FoodiesRider\app\src\main\java\com\foodies\rider\ActivitiesAndFragments\Activities\SplashScreenActivity.java:252: warning: [deprecation] getErrorDialog(int,Activity,int) in GooglePlayServicesUtil has been deprecated
GooglePlayServicesUtil.getErrorDialog(resultCode, this,
^
C:\Users\HP\Desktop\FoodieRiderv1.0\FoodieRider1.1.1\FoodiesRider\app\src\main\java\com\foodies\rider\ActivitiesAndFragments\Activities\SplashScreenActivity.java:426: warning: [deprecation] GET_SIGNATURES in PackageManager has been deprecated
PackageInfo info = getPackageManager().getPackageInfo(getPackageName() , PackageManager.GET_SIGNATURES);
^
C:\Users\HP\Desktop\FoodieRiderv1.0\FoodieRider1.1.1\FoodiesRider\app\src\main\java\com\foodies\rider\ActivitiesAndFragments\Activities\SplashScreenActivity.java:427: warning: [deprecation] signatures in PackageInfo has been deprecated
for(Signature signature:info.signatures)
^
6 warnings
Can someone please explain what it means?有人可以解释一下这是什么意思吗?
It means that those methods and classes have been Deprecated .这意味着这些方法和类已被弃用。
The people who have provided the method or class are flagging that they intend to remove them in a future release of ... whatever library it is that is currently providing them.提供方法或类的人表示他们打算在未来版本中删除它们......无论当前提供它们的是什么库。 The warning is to tell you that you would be advised to modify this code to use alternatives to those methods.警告是要告诉您,建议您修改此代码以使用这些方法的替代方法。
Typically, the deprecation notice (in the javadocs) will suggest some alternatives.通常,弃用通知(在 javadoc 中)会建议一些替代方案。 For example the javadocs for GooglePlayServicesUtil.getErrorDialog
says:例如, GooglePlayServicesUtil.getErrorDialog
的javadocs说:
This method is deprecated.此方法已弃用。
Use
getErrorDialog(Activity, int, int, OnCancelListener)
instead.请改用getErrorDialog(Activity, int, int, OnCancelListener)
。
Note that these are only warnings.请注意,这些只是警告。 You can ignore them for the time being, though they may present problems in the future.您可以暂时忽略它们,尽管它们将来可能会出现问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.