java.lang.NoSuchMethodError

01-15 12:13:22.836  9986  9986 D AndroidRuntime: Shutting down VM
01-15 12:13:22.836  9986  9986 E AndroidRuntime: FATAL EXCEPTION: main
01-15 12:13:22.836  9986  9986 E AndroidRuntime: Process: com.tencent.qt.sns, PID: 9986
01-15 12:13:22.836  9986  9986 E AndroidRuntime: java.lang.NoSuchMethodError: No virtual method b()I in class Landroid/net/http/SslError; or its super classes (declaration of 'android.net.http.SslError' appears in /system/framework/framework.jar)
01-15 12:13:22.836  9986  9986 E AndroidRuntime: at oicq.wlogin_sdk.quicklogin.d.onReceivedSslError(QuickLoginWebViewActivity.java:175)
01-15 12:13:22.836  9986  9986 E AndroidRuntime: at com.android.webview.chromium.Ap.onReceivedSslError(WebViewContentsClientAdapter.java:447)
01-15 12:13:22.836  9986  9986 E AndroidRuntime: at org.chromium.android_webview.AwContentsClientBridge$$Lambda$1.run(Unknown Source:2)
01-15 12:13:22.836  9986  9986 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:790)
01-15 12:13:22.836  9986  9986 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99)
01-15 12:13:22.836  9986  9986 E AndroidRuntime: at android.os.Looper.loop(Looper.java:164)
01-15 12:13:22.836  9986  9986 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6518)
01-15 12:13:22.836  9986  9986 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
01-15 12:13:22.836  9986  9986 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
01-15 12:13:22.836  9986  9986 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
01-15 12:13:22.837  9986  9986 W MtaSDK  : [main(2): SourceFile:380] - crash happened, but MTA AutoExceptionCaught is desable.
01-15 12:13:22.837  9986  9986 W System.err: java.lang.NoSuchMethodError: No virtual method b()I in class Landroid/net/http/SslError; or its super classes (declaration of 'android.net.http.SslError' appears in /system/framework/framework.jar)
01-15 12:13:22.838  9986  9986 W System.err: at oicq.wlogin_sdk.quicklogin.d.onReceivedSslError(QuickLoginWebViewActivity.java:175)
01-15 12:13:22.838  9986  9986 W System.err: at com.android.webview.chromium.Ap.onReceivedSslError(WebViewContentsClientAdapter.java:447)
01-15 12:13:22.838  9986  9986 W System.err: at org.chromium.android_webview.AwContentsClientBridge$$Lambda$1.run(Unknown Source:2)
01-15 12:13:22.838  9986  9986 W System.err: at android.os.Handler.handleCallback(Handler.java:790)
01-15 12:13:22.838  9986  9986 W System.err: at android.os.Handler.dispatchMessage(Handler.java:99)
01-15 12:13:22.838  9986  9986 W System.err: at android.os.Looper.loop(Looper.java:164)
01-15 12:13:22.838  9986  9986 W System.err: at android.app.ActivityThread.main(ActivityThread.java:6518)
01-15 12:13:22.838  9986  9986 W System.err: at java.lang.reflect.Method.invoke(Native Method)

01-15 12:13:22.838  9986  9986 W System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)


1. we can find NoSuchMethodError exception in the log


01-01 01:31:05.279 15621 15621 E AndroidRuntime: java.lang.NoSuchMethodError: No virtual method b()I in class Landroid/net/http/SslError; or its super classes (declaration of 'android.net.http.SslError' appears in /system/framework/framework.jar)




2. apk has it's own android.net.http.SslError in the class.dex, not that one in the /system/framework/framework.jar


sslError.class


package android.net.http;


import java.security.cert.X509Certificate;


public class SslError
{
  @Deprecated
  public SslError(int paramInt, SslCertificate paramSslCertificate)
  {
    throw new RuntimeException("Stub!");
  }
...




3. the exception is thrown when call paramSslError.b() by it's onReceivedSslError() of class3.dex, 


d.class


public void onReceivedSslError(WebView paramWebView, SslErrorHandler paramSslErrorHandler, SslError paramSslError)
  {
    util.LOGI("ssl error " + paramSslError.b());
    if (true == QuickLoginWebViewActivity.a)
    {
      paramSslErrorHandler.proceed();
      return;
    }
    AlertDialog.Builder localBuilder = new AlertDialog.Builder(this.b);
    localBuilder.setMessage("页面证书错误(" + paramSslError.b() + "),是否继续?");
    localBuilder.setPositiveButton("继续", new e(this, paramSslErrorHandler));
    localBuilder.setNegativeButton("取消", new f(this, paramSslErrorHandler));
    AlertDialog localAlertDialog = localBuilder.create();



4. after parsered the class.dex, we can find the class sslError lied in it, but it's method b() is not in it.


method b() defined in sslError.java ,


 public int b()
  {
    throw new RuntimeException("Stub!");
  }




5. after parsered the class3.dex, we can find method b() lied in it's method section, it's index is 570, but it's class does not lie in class3.dex, rather than lie in class.dex, so the ResolveMethod() in the class_linker.cc can't find the method b(), then an exception of NoSuchMethodError is thrown. it's an issue of multidex caused by apk owner.


6.why the issue only found on SDM450?


  then we go back to the callback function onReceivedSslError(),
public void onReceivedSslError(WebView paramWebView, SslErrorHandler paramSslErrorHandler, SslError paramSslError)
  {
    util.LOGI("ssl error " + paramSslError.b());
    if (true == QuickLoginWebViewActivity.a)
    {
      paramSslErrorHandler.proceed();
      return;
    }
    AlertDialog.Builder localBuilder = new AlertDialog.Builder(this.b);
    localBuilder.setMessage("页面证书错误(" + paramSslError.b() + "),是否继续?");
    localBuilder.setPositiveButton("继续", new e(this, paramSslErrorHandler));
    localBuilder.setNegativeButton("取消", new f(this, paramSslErrorHandler));
    AlertDialog localAlertDialog = localBuilder.create();
    try
    {
      localAlertDialog.show();
      return;
    }
    catch (Exception localException)
    {
    }
  }


 
  we can know issue happened when "页面证书错误", what caused the 页面证书错误?  so many causes, in this case, I found it's caused by system time.


   if we set a wrong system time, pixel8.0/sdm670 will crash also, if the time is right, all devices work well. 


  
  so it's moved to p2-p3 3rd-party classify.





阅读更多
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/xiashaohua/article/details/79726455
文章标签: NoSuchMethodError
个人分类: android exception
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭