Closed vfa-tamhh closed 1 year ago
Cordova doesn't supply a favicon.ico
by default. Are you providing one in your www/
folder?
Note that I don't think the favicon is actually used because you don't have any actual browser UI other than the webview rendering itself. But the browser engine still automatically attempts to load favicon.ico
regardless.
@breautek I found the solution to resolve this. At this: https://github.com/apache/cordova-android/blob/master/framework/src/org/apache/cordova/engine/SystemWebViewClient.java#L423 Change as below:
@Override
public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequest request) {
if (request.getUrl().getPath().equals("/favicon.ico")) {
return new WebResourceResponse("image/png", null, null);
} else {
return this.assetLoader.shouldInterceptRequest(request.getUrl());
}
}
After that run the app. No error show in the Logcat. Please check this case. Thank you.
If the logcat message bothers you, it would be better to simply supply a favicon.ico
file.
The suggested code would break actual favicon.ico
from working properly. Afaik the favicon.ico isn't actually used or shown, but like I said, the webview engine always requests the favicon.ico
when loading the document.
If the favicon.ico
is missing, then this is working as intended, not an actual error. The FileNotFoundException
would be the expected behaviour in this situation.
Bug Report
Problem
What is expected to happen?
No error in logcat.
What does actually happen?
Information
Command or Code
Open the project by Android studio. (Android Studio Bumblebee | 2021.1.1 Patch 2) Run app.
Environment, Platform, Device
Android platform. Device: android 12
Version information
Checklist