androidandroid-wifiwifimanagerindoor-positioning-systemandroid-9.0-pie

WifiRttManager - No virtual method startRanging


I been testing the preview of Android P and I'm having some problems with the WifiRttManager used for indoorPositioning. For some reason when I try to use the method startRanging from WifiRttManager but I'm getting this error:

java.lang.NoSuchMethodError: No virtual method startRanging(Landroid/net/wifi/rtt/RangingRequest;Ljava/util/concurrent/Executor;Landroid/net/wifi/rtt/RangingResultCallback;)V in class Landroid/net/wifi/rtt/WifiRttManager; or its super classes (declaration of 'android.net.wifi.rtt.WifiRttManager' appears in /system/framework/framework.jar)

The method displayed by the android studio is the following:

startRanging(RangingRequest rangingRequest, Executor executor, RangingResultCallback callback);

but the documentation https://developer.android.com/reference/android/net/wifi/rtt/WifiRttManager.html has this other one:

startRanging(RangingRequest request, RangingResultCallback callback, Handler handler)

Could you help me to check what's happening please?


Solution

  • I got the same problems. Updating the Android P to revision 2 using SDK Manager in Android Studio will fix this problem.