You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2022/05/17 07:29:35 UTC

[GitHub] [cordova] vfa-tamhh opened a new issue, #331: java.io.FileNotFoundException: www/favicon.ico

vfa-tamhh opened a new issue, #331:
URL: https://github.com/apache/cordova/issues/331

   # Bug Report
   
   ## Problem
   
   ### What is expected to happen?
   
   No error in logcat.
   
   
   ### What does actually happen?
   
   ```
   17 14:14:38.288 7757-7757/io.cordova.hellocordova D/PluginManager: postMessage: onPageFinished
   2022-05-17 14:14:38.291 7757-7757/io.cordova.hellocordova I/chromium: [INFO:CONSOLE(27)] "Running cordova-android@10.1.2", source: https://localhost/js/index.js (27)
   2022-05-17 14:14:38.293 7757-7900/io.cordova.hellocordova W/System.err: java.io.FileNotFoundException: www/favicon.ico
   2022-05-17 14:14:38.293 7757-7900/io.cordova.hellocordova W/System.err:     at android.content.res.AssetManager.nativeOpenAsset(Native Method)
   2022-05-17 14:14:38.293 7757-7900/io.cordova.hellocordova W/System.err:     at android.content.res.AssetManager.open(AssetManager.java:897)
   2022-05-17 14:14:38.293 7757-7900/io.cordova.hellocordova W/System.err:     at org.apache.cordova.engine.SystemWebViewClient.lambda$new$0$SystemWebViewClient(SystemWebViewClient.java:95)
   2022-05-17 14:14:38.293 7757-7900/io.cordova.hellocordova W/System.err:     at org.apache.cordova.engine.-$$Lambda$SystemWebViewClient$sl_w10kTka227lJmCz64A09UKvs.handle(Unknown Source:4)
   2022-05-17 14:14:38.293 7757-7900/io.cordova.hellocordova W/System.err:     at androidx.webkit.WebViewAssetLoader.shouldInterceptRequest(WebViewAssetLoader.java:566)
   2022-05-17 14:14:38.293 7757-7900/io.cordova.hellocordova W/System.err:     at org.apache.cordova.engine.SystemWebViewClient.shouldInterceptRequest(SystemWebViewClient.java:423)
   2022-05-17 14:14:38.293 7757-7900/io.cordova.hellocordova W/System.err:     at h9.a(chromium-TrichromeWebViewGoogle6432.apk-stable-495150734:223)
   2022-05-17 14:14:38.293 7757-7900/io.cordova.hellocordova W/System.err:     at org.chromium.android_webview.AwContentsBackgroundThreadClient.shouldInterceptRequestFromNative(chromium-TrichromeWebViewGoogle6432.apk-stable-495150734:31)
   2022-05-17 14:14:38.293 7757-7900/io.cordova.hellocordova E/SystemWebViewClient: www/favicon.ico
   ```
   
   
   ## Information
   <!-- Include all relevant information that might help understand and reproduce the problem -->
   
   
   
   ### Command or Code
   <!-- What command or code is needed to reproduce the problem? -->
   ```
   sudo npm install -g cordova
   cordova create hello com.example.hello HelloWorld
   cd hello
   cordova platform add android
   ```
   Open the project by Android studio. (Android Studio Bumblebee | 2021.1.1 Patch 2)
   Run app.
   
   ### Environment, Platform, Device
   <!-- In what environment, on what platform or on which device are you experiencing the issue? -->
   Android platform.
   Device: android 12
   
   
   ### Version information
   
   ```
   cordova -v
   11.0.0
   cordova platform add android
   Using cordova-fetch for cordova-android@^10.1.1
   Adding android project...
   Creating Cordova project for the Android platform:
   	Path: platforms/android
   	Package: io.cordova.hellocordova
   	Name: HelloCordova
   	Activity: MainActivity
   	Android target: android-30
   Subproject Path: CordovaLib
   Subproject Path: app
   Android project created with cordova-android@10.1.2
   ```
   
   
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [x] I searched for existing GitHub issues
   - [x] I updated all Cordova tooling to most recent version
   - [x] I included all the necessary information above
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[GitHub] [cordova] breautek commented on issue #331: java.io.FileNotFoundException: www/favicon.ico

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #331:
URL: https://github.com/apache/cordova/issues/331#issuecomment-1128900679

   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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[GitHub] [cordova] breautek closed issue #331: java.io.FileNotFoundException: www/favicon.ico

Posted by GitBox <gi...@apache.org>.
breautek closed issue #331: java.io.FileNotFoundException: www/favicon.ico
URL: https://github.com/apache/cordova/issues/331


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[GitHub] [cordova] breautek commented on issue #331: java.io.FileNotFoundException: www/favicon.ico

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #331:
URL: https://github.com/apache/cordova/issues/331#issuecomment-1129530893

   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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[GitHub] [cordova] vfa-tamhh commented on issue #331: java.io.FileNotFoundException: www/favicon.ico

Posted by GitBox <gi...@apache.org>.
vfa-tamhh commented on issue #331:
URL: https://github.com/apache/cordova/issues/331#issuecomment-1129528082

   @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:
   
   ```java
   @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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org