[英]java.lang.NoClassDefFoundError: Failed resolution of: Landroid/webkit/SafeBrowsingResponse
I am facing this exception 我正面临这个例外
"java.lang.NoClassDefFoundError: Failed resolution of: Landroid/webkit/SafeBrowsingResponse" while implementing webview in android.
“java.lang.NoClassDefFoundError:解析:Landroid / webkit / SafeBrowsingResponse失败”,同时在android中实现webview。
I have searched for an appropriate solution over the web but didn't find anything useful. 我已经在网上搜索了一个合适的解决方案,但没有找到任何有用的解决方案。
My XML file is this 我的XML文件是这样的
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include layout="@layout/toolbar_title" />
<im.delight.android.webview.AdvancedWebView
android:id="@+id/mWebview"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</RelativeLayout>
And my java code against this XML is 我对这个XML的java代码是
public class PaymentActivity extends ParentActivity implements AdvancedWebView.Listener {
// private WebView webView;
private AdvancedWebView mWebView;
ProgressDialog dialog;
UserModel userModel;
SessionManager sessionManager;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_payment);
ButterKnife.bind(this);
setActionBar("Payment");
sessionManager = new SessionManager(this);
userModel = sessionManager.getUserInformation();
mWebView = findViewById(R.id.mWebview);
mWebView.setListener(this, this);
mWebView.getSettings().setJavaScriptEnabled(true);
String planType = getIntent().getStringExtra("planType");
String url = "www.google.com";
dialog = new ProgressDialog(this);
dialog.setMessage("Loading");
dialog.setCancelable(false);
mWebView.loadUrl(url);
}
@Override
public void onPageStarted(String url, Bitmap favicon) {
dialog.show();
}
@Override
public void onPageFinished(String url) {
dialog.dismiss();
}
@Override
public void onDownloadRequested(String url, String suggestedFilename, String mimeType, long contentLength, String contentDisposition, String userAgent) {
}
@Override
public void onExternalPageRequest(String url) {
}
@Override
public void onPageError(int errorCode, String description, String failingUrl) {
}
My compileSdkVersion is 26
, minSdkVersion is 17
and targetSdkVersion is 22
. 我的compileSdkVersion是
26
,minSdkVersion是17
,targetSdkVersion是22
。 I am testing this code on Android 8.0 API 26
. 我正在
Android 8.0 API 26
上测试此代码。
Any help in this regard will be highly appreciated. 在这方面的任何帮助将受到高度赞赏。
According to the documentation , this class was added in Android level 27. You are trying to use it on level 26 test platform. 根据文档 ,这个类是在Android级别27中添加的。您正尝试在26级测试平台上使用它。 Naturally, the platform cannot load the class ... that it doesn't know about.
当然,平台无法加载它不知道的类。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.