You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "jcesarmobile (Jira)" <ji...@apache.org> on 2019/11/29 13:09:00 UTC
[jira] [Closed] (CB-14179) Cordova is not initialized properly when
using Android System Webview v67
[ https://issues.apache.org/jira/browse/CB-14179?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
jcesarmobile closed CB-14179.
-----------------------------
Resolution: Cannot Reproduce
can't reproduce with latest cordova and webview, so might be fixed
if still facing the issue, please, report it in github https://github.com/apache/cordova-android/issues
> Cordova is not initialized properly when using Android System Webview v67
> -------------------------------------------------------------------------
>
> Key: CB-14179
> URL: https://issues.apache.org/jira/browse/CB-14179
> Project: Apache Cordova
> Issue Type: Bug
> Components: cordova-android
> Affects Versions: cordova-android-7.0.0
> Environment: WebView: This only happens on the AndroidSystemWebView implementation (not Chrome) versions 67.0.3396.*
> Android OS: All versions on which the above WebView is compatible so I think [5, 6.0.1]
> Device: Nexus 5, Nexus 5x, HTC One M9
>
> Reporter: Cristian Totolici
> Priority: Major
> Attachments: MainActivity.java, cordova.log
>
>
> Cordova not initialized properly:
> {noformat}
> 06-28 10:52:14.774 12625-12625/com.example.hello E/CordovaBridge: gap_init called from restricted origin:
> {noformat}
> I have looked into this issue and it seems that sometimes the origin URL is empty and that is the reason why the message above is shown.
> {code:java}
> @Override
> public boolean onJsPrompt(WebView view, String origin, String message, String defaultValue, final JsPromptResult result) {
> Log.d(LOG_TAG, (tries++) +" onJsPrompt: "+origin);
> // Unlike the @JavascriptInterface bridge, this method is always called on the UI thread.
> String handledRet = parentEngine.bridge.promptOnJsPrompt(origin, message, defaultValue);
> if (handledRet != null) {
> result.confirm(handledRet);
> } else {
> dialogsHelper.showPrompt(message, defaultValue, new CordovaDialogsHelper.Result() {
> @Override
> public void gotResult(boolean success, String value) {
> if (success) {
> result.confirm(value);
> } else {
> result.cancel();
> }
> }
> });
> }
> return true;
> }
> {code}
> The strange think is that if you call view.getUrl() the url is return correctly. I was wondering, can be that used instead of the origin url ?
> This is an issue not that easy to reproduce, I managed to reproduce with a simple hello world cordova app.
> I did some tweaks to increase the occurrence of the issue:
> 1. Enable "Don't keep activities" from the developer options
> 2. Using "Recents" button open and close the app very fast
> 3. I have attached the MainActvity.java that I used. There is some commented code that can be uncommented to increase the occurrence rate of the issue.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org