How to android java socket connect? - java

E/dalvikvm: Could not find class 'android.view.WindowInsets', referenced from method androidx.core.view.WindowInsetsCompat.toWindowInsetsCompat
E/dalvikvm: Could not find class 'android.os.LocaleList', referenced from method androidx.core.os.LocaleListCompat.wrap
i want to socket connect and sendmsg in android java
this is error name what can i do?

Related

Failed to connect to HTTPS using Retrofit 2 in Android < 21

So, I've tried to connect my API https://api.*****.id that use TLS v1.2 (Let's Encrypt) through my Android.
Everything works as normal when using Android > 20, but when using Android < 21 the android monitor says:
W/dalvikvm: VFY: unable to find class referenced in signature (Ljava/nio/file/Path;)
W/dalvikvm: VFY: unable to find class referenced in signature ([Ljava/nio/file/OpenOption;)
I/dalvikvm: Could not find method java.nio.file.Files.newOutputStream, referenced from method okio.Okio.sink
W/dalvikvm: VFY: unable to resolve static method 23633: Ljava/nio/file/Files;.newOutputStream (Ljava/nio/file/Path;[Ljava/nio/file/OpenOption;)Ljava/io/OutputStream;
D/dalvikvm: VFY: replacing opcode 0x71 at 0x000a
W/dalvikvm: VFY: unable to find class referenced in signature (Ljava/nio/file/Path;)
W/dalvikvm: VFY: unable to find class referenced in signature ([Ljava/nio/file/OpenOption;)
I/dalvikvm: Could not find method java.nio.file.Files.newInputStream, referenced from method okio.Okio.source
W/dalvikvm: VFY: unable to resolve static method 23632: Ljava/nio/file/Files;.newInputStream (Ljava/nio/file/Path;[Ljava/nio/file/OpenOption;)Ljava/io/InputStream;
D/dalvikvm: VFY: replacing opcode 0x71 at 0x000a
D/Error: java.net.ConnectException: Failed to connect to api.*****.id/64:ff9b::8b3b:eb77:443
I've implemented the TLSSocketFactory from here https://gist.github.com/fkrauthan/ac8624466a4dee4fd02f
Then have used it something like this:
httpClient = new OkHttpClient.Builder();
ConnectionSpec spec = new ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS)
.tlsVersions(TlsVersion.TLS_1_2, TlsVersion.TLS_1_1)
.build();
if (Build.VERSION.SDK_INT < 21) {
X509TrustManager trustManager = TLSPatch.systemDefaultTrustManager();
httpClient.sslSocketFactory(new TLSPatch.TLSSocketFactory(), trustManager);
}
httpClient.connectionSpecs(Collections.singletonList(spec))
.readTimeout(60, TimeUnit.SECONDS);
Is anyone have issue something like this?
Whoops, I think, I found the problem.
Because my API uses cipher AES_256_GCM, I think SSL handshake always failed (behind the scene). So, instead uses cipher AES_256_GCM, I changed it to AES_128_GCM.
And this is my config
https://gist.github.com/nmfzone/d175d66752a0c1e1f460fd559b62546f.
Then, my code works properly. Actually, without custom SSLSocketFactory in Android < 21 should also work.

Could not find class 'com.amazon.device.messaging.ADM', referenced from method com.whatsapp.App.s

I'm Creating a simple custom gallery app. In which I'm showing image in GridView. that's fine but what happened is while I'm checking my logs in Logcat its showing me this also. I don't know why and from where it is coming.
12-05 16:45:16.883: E/dalvikvm(22961): Could not find class 'com.amazon.device.messaging.ADM', referenced from method com.whatsapp.App.s
12-05 16:45:16.883: W/dalvikvm(22961): VFY: unable to resolve new-instance 1522 (Lcom/amazon/device/messaging/ADM;) in Lcom/whatsapp/App;
12-05 16:45:16.893: E/dalvikvm(22961): Could not find class 'com.amazon.device.messaging.ADM', referenced from method com.whatsapp.App.w
I'm not doing any thing related to whatsapp or anything, in My Code
is this is a Security issue.
or its juts a background process of my phone, if it is then please help me to stop this because it is so annoying.

Facebook integration - Android - Parse

I am using ParseFacebookUtilsV4-1.9.2.jar and everytime I am facing an error in this line:
ParseFacebookUtils.initialize(this);
The error I am facing is below
... I/dalvikvm﹕ Could not find method com.facebook.FacebookSdk.sdkInitialize, referenced from method com.parse.FacebookAuthenticationProvider.<init>
... I/dalvikvm﹕ Could not find method com.facebook.login.LoginManager.getInstance, referenced from method com.parse.FacebookAuthenticationProvider.authenticateAsync
... W/dalvikvm﹕ VFY: unable to resolve static method 14412: Lcom/facebook/login/LoginManager;.getInstance ()Lcom/facebook/login/LoginManager;
... W/dalvikvm﹕ VFY: unable to resolve static method 14411: Lcom/facebook/FacebookSdk;.sdkInitialize (Landroid/content/Context;I)V
... W/dalvikvm﹕ VFY: unable to find class referenced in signature (Lcom/facebook/AccessToken;)
... I/dalvikvm﹕ Could not find method com.facebook.AccessToken.getUserId, referenced from method com.parse.FacebookAuthenticationProvider.getAuthData
... W/dalvikvm﹕ VFY: unable to resolve virtual method 14406: Lcom/facebook/AccessToken;.getUserId ()Ljava/lang/String;
... I/dalvikvm﹕ Could not find method com.facebook.CallbackManager.onActivityResult, referenced from method com.parse.FacebookAuthenticationProvider.onActivityResult
... W/dalvikvm﹕ VFY: unable to resolve interface method 14409: Lcom/facebook/CallbackManager;.onActivityResult (IILandroid/content/Intent;)Z
... I/dalvikvm﹕ Could not find method com.facebook.login.LoginManager.getInstance, referenced from method com.parse.FacebookAuthenticationProvider.restoreAuthentication
... W/dalvikvm﹕ VFY: unable to resolve static method 14412: Lcom/facebook/login/LoginManager;.getInstance ()Lcom/facebook/login/LoginManager;
... E/dalvikvm﹕ Could not find class 'com.facebook.AccessToken', referenced from method com.parse.FacebookAuthenticationProvider.restoreAuthentication
... W/dalvikvm﹕ VFY: unable to resolve new-instance 1749 (Lcom/facebook/AccessToken;) in Lcom/parse/FacebookAuthenticationProvider;
... I/dalvikvm﹕ Failed resolving Lcom/parse/FacebookAuthenticationProvider$1; interface 1753 'Lcom/facebook/FacebookCallback;'
... W/dalvikvm﹕ Link of class 'Lcom/parse/FacebookAuthenticationProvider$1;' failed
... W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x41823700)
... E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: com.facebook.FacebookSdk
at com.parse.FacebookAuthenticationProvider.<init>(FacebookAuthenticationProvider.java:68)
at com.parse.ParseFacebookUtils.initialize(ParseFacebookUtils.java:96)
at com.parse.ParseFacebookUtils.initialize(ParseFacebookUtils.java:81)
...
Can anyone help me?
Note: ParseFacebookUtils requires Facebook Android SDK v4.x.x
from Parse docs
Could not find method com.facebook.FacebookSdk.sdkInitialize
This means you need Facebook SDK also. Parse call function from Facebook SDK which is not exist in your project.

Could not find method AdvertisingIdClient.getAdvertisingIdInfo

When trying to run Android project on my Meizu MX3, I get the problem mentioned in topic.
My logcat out is:
04-23 01:05:01.855: I/dalvikvm(18549): Could not find method com.google.android.gms.ads.identifier.AdvertisingIdClient.getAdvertisingIdInfo, referenced from method com.myapp.deviceinfo.AndroidDeviceInfo$1.run
04-23 01:05:01.855: W/dalvikvm(18549): VFY: unable to resolve static method 14581: Lcom/google/android/gms/ads/identifier/AdvertisingIdClient;.getAdvertisingIdInfo (Landroid/content/Context;)Lcom/google/android/gms/ads/identifier/AdvertisingIdClient$Info;
04-23 01:05:01.855: D/dalvikvm(18549): VFY: replacing opcode 0x71 at 0x0005
04-23 01:05:01.885: W/dalvikvm(18549): VFY: unable to resolve exception class 2144 (Lcom/google/android/gms/common/GooglePlayServicesNotAvailableException;)
04-23 01:05:01.885: W/dalvikvm(18549): VFY: unable to find exception handler at addr 0xa4
04-23 01:05:01.885: W/dalvikvm(18549): VFY: rejected Lcom/myapp/deviceinfo/AndroidDeviceInfo$1;.run ()V
04-23 01:05:01.885: W/dalvikvm(18549): VFY: rejecting opcode 0x0d at 0x00a4
04-23 01:05:01.885: W/dalvikvm(18549): VFY: rejected Lcom/myapp/deviceinfo/AndroidDeviceInfo$1;.run ()V
04-23 01:05:01.885: W/dalvikvm(18549): Verifier rejected class Lcom/myapp/deviceinfo/AndroidDeviceInfo$1;
Any help is going to be appreciated.
It was a big problem that made me stunned for a days.
I had tried all methods, like Proguard editing, changing libraries, context changing, but this solved the problem: simple update to new SDK build version 22.0.1; this fixed the issue.

JXTA Application on android

I am trying to build an app that establishes P2P connection between two wifi enabled android device. I have added JXTA 2.5 library into android 2.2, but don't know where i am going wrong. Ending up with run-time exception: No Class found error and Instance not found error.
Is there anything else to be done apart from just including .jar file into android project ?
Any configuration to be written ? If yes, please let know how i can write configuration file and employ it in my project ? I am working on final year project, so please let me know if you have any pointers regarding this ?
Thanks in advance !
Here is the Log :
04-24 22:41:47.429: I/dalvikvm(556): Could not find method org.apache.log4j.Logger.getLogger, referenced from method net.jxta.peergroup.PeerGroupFactory.<clinit>
04-24 22:41:47.429: W/dalvikvm(556): VFY: unable to resolve static method 8971: Lorg/apache/log4j/Logger;.getLogger (Ljava/lang/String;)Lorg/apache/log4j/Logger;
04-24 22:41:47.441: D/dalvikvm(556): VFY: replacing opcode 0x77 at 0x0010
04-24 22:41:47.461: W/dalvikvm(556): VFY: unable to resolve static field 4047 (ERROR) in Lorg/apache/log4j/Level;
04-24 22:41:47.461: D/dalvikvm(556): VFY: replacing opcode 0x62 at 0x0012
04-24 22:41:47.461: W/dalvikvm(556): VFY: unable to resolve static field 4050 (WARN) in Lorg/apache/log4j/Level;
04-24 22:41:47.461: D/dalvikvm(556): VFY: replacing opcode 0x62 at 0x000c
04-24 22:41:47.469: W/dalvikvm(556): VFY: unable to resolve static field 4048 (FATAL) in Lorg/apache/log4j/Level;
04-24 22:41:47.469: D/dalvikvm(556): VFY: replacing opcode 0x62 at 0x001a
04-24 22:41:47.469: W/dalvikvm(556): VFY: unable to resolve static field 4048 (FATAL) in Lorg/apache/log4j/Level;
04-24 22:41:47.480: D/dalvikvm(556): VFY: replacing opcode 0x62 at 0x0045
JXTA 2.5 is buggy. Just forget it. I lead release 2.6 and 2.7. We have corrected many issues. I have published a book about it called Practical JXTA II and you can read it online at scribd. It contains examples.
You will probably need a central super peer, unless you only use adhoc connections (broadcasting).

Categories