WifiRttManager - No virtual method startRanging - android

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?

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

Related

`java.lang.NoSuchMethodError: No static method create` after update tensorflow lite to 0.4.0

After updating org.tensorflow:tensorflow-lite-metadata, org.tensorflow:tensorflow-lite-task-vision and org.tensorflow:tensorflow-lite-support app falls with error:
java.lang.NoSuchMethodError: No static method create(Ljava/nio/ByteBuffer;Lorg/tensorflow/lite/InterpreterApi$Options;)Lorg/tensorflow/lite/InterpreterApi; in class Lorg/tensorflow/lite/InterpreterApi; or its super classes (declaration of 'org.tensorflow.lite.InterpreterApi' appears in /data/app/~~iBlhCFEsffVRgKI8jlh50w==/com.po4yka.dancer.debug-dw8TLYwUobxDEHmwOF5CSg==/base.apk!classes2.dex)
What could be wrong? I couldn't find any breaking changes in changelog.
If you're using Android Studio ML Binding, it has not been upgraded to tflite-support 0.4 yet. You should continue using tflite-support 0.3.1.
See: https://github.com/tensorflow/tflite-support/issues/824

Android Studio java.lang.NoSuchMethodError with dependency

Azure is calling:
URLEncoder.encode(encodeBase64String(...
which works fine on Android 9 and above. But on old phones I get:
Caused by: java.lang.NoSuchMethodError: No static method encodeBase64String([B)Ljava/lang/String; in class Lorg/apache/commons/codec/binary/Base64; or its super classes (declaration of 'org.apache.commons.codec.binary.Base64' appears in /system/framework/org.apache.http.legacy.boot.jar)
I have tried adding in :
implementation "commons-codec:commons-codec:1.14"
to build.gradle, but it does not seem to have an effect. What is the usual way to handle it when a class you didn't write that is part of an external SDK, is calling a method old phones don't support?
You should try with below code:
String encodedString = new String(Base64.encodeBase64(bytes));

com.android.support:customtabs: No virtual method launchUrl

java.lang.NoSuchMethodError: No virtual method launchUrl(Landroid/app/Activity;Landroid/net/Uri;)V in class Landroid/support/customtabs/CustomTabsIntent
Before everything worked, but today I can see the above error.
Why it happens? if something was changed, why not backwards-compatible?
Don't know if it helps you but in my case (I have Facebook SDK in my app with custom tabs enabled) this error happened when user (without installed Facebook app) tried to log in.
Exception java.lang.NoSuchMethodError: No virtual method launchUrl(Landroid/app/Activity;Landroid/net/Uri;)V in class Landroid/support/customtabs/CustomTabsIntent; or its super classes
com.facebook.internal.CustomTab.openCustomTab (CustomTab.java:48)
Updating dependency to use latest SDK version (they switched to customtabs:25.0.0 in version 4.17.0)
compile 'com.facebook.android:facebook-android-sdk:4.17.0'
fixed the problem.
I also use Custom Tabs (v25.0.0) in my app and have no issues with them. If it's not your case you can check what they've changed.

Firebase Analytics keeps causing errors in Android, why?

After I installed Firebase Analytics in my Android app, I keep getting the following error and crash of the app.
10-03 19:08:03.917 17740-17759/******* E/FA: Task exception on worker thread: java.lang.IncompatibleClassChangeError:
The method 'java.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDir(android.content.Context)' was expected to be of type virtual but instead was found to be of type direct
(declaration of 'com.google.firebase.iid.zzg' appears in /data/data/********/files/instant-run/dex/slice-com.google.firebase-firebase-iid-9.0.0_4ac10bd34145eacbd51560cb14cd41a784d8c1aa-classes.dex): com.google.android.gms.measurement.internal.zzt.zzEd(Unknown Source)
Any idea why and what causes this error?
I think something was wrong in the documentation. The instructions didn't tell me this extra step.
I was missing a dependency:
compile 'com.google.firebase:firebase-core:9.6.1'
In the support docs, however it is clearly mentioned. I added it and it works fine now.
What Firebase version are you using? Try to update it to latest version, 9.6
Reference: https://developers.google.com/android/guides/releases

no virtual method newJsonReader in eclipse

Im trying to introduce retrofit 2 to my existing app in eclipse.
These are the imported libs:
screenshot
Okhttp shows fetched body correctly.
And this is the error im getting in onFailure callback:
06-22 10:30:18.534: D/Test(5291): No virtual method
newJsonReader(Ljava/io/Reader;)Lcom/google/gson/stream/JsonReader;
in class Lcom/google/gson/Gson; or its super classes (declaration of
'com.google.gson.Gson' appears in /data/app/com.nsrdoc.json-1/base.apk)
Help appreciated

Categories

Resources