You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2020/06/16 05:04:07 UTC

[GitHub] [cordova-android] zhqcqupt opened a new issue #1000: exception throwed when cordovaActivity destroy

zhqcqupt opened a new issue #1000:
URL: https://github.com/apache/cordova-android/issues/1000


   # Bug Report
   
   ## Problem
   In Android,we use cordova to load url ,but when activity.finish() is called ,a exception throws ,that is 
   Application attempted to call on a destroyed WebView  java.lang.Throwable.
   
   
    According to my analysis, this exception affected some behavior of my next activity, such as calling activity.getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);
   
   I found the cordova code where the exception was thrown (CordovaWebviewImpl#handleDestroy) and commented out the code that caused the exception (this.loadUrl("about:blank");). There will be no above problems, and my setFlags function normally
   ### What is expected to happen?
   with no exception throws when CordovaActivity destroy
   
   
   ### What does actually happen?
   see above
   
   
   ## Information
   <!-- Include all relevant information that might help understand and reproduce the problem -->
    stacktrace post below:
   at org.chromium.android_webview.AwContents.a(PG:124)
           at com.android.webview.chromium.WebViewChromium.loadUrl(PG:11)
           at java.lang.reflect.Method.invoke(Native Method)
           at com.msmsdk.hook.javaHook.serverhook.WebViewHook$WebViewProviderHandler.invoke(WebViewHook.java:114)
           at java.lang.reflect.Proxy.invoke(Proxy.java:1006)
           at $Proxy3.loadUrl(Unknown Source)
           at android.webkit.WebView.loadUrl(WebView.java:741)
           at org.apache.cordova.engine.SystemWebViewEngine.loadUrl(SystemWebViewEngine.java:272)
           at org.apache.cordova.CordovaWebViewImpl.loadUrlIntoView(CordovaWebViewImpl.java:129)
           at org.apache.cordova.CordovaWebViewImpl.loadUrl(CordovaWebViewImpl.java:198)
           at org.apache.cordova.CordovaWebViewImpl.handleDestroy(CordovaWebViewImpl.java:490)
           at org.apache.cordova.CordovaActivity.onDestroy(CordovaActivity.java:344)
           at com.dlxx.mam.activity.CordovaMainActivity.onDestroy(CordovaMainActivity.java:1210)
           at android.app.Activity.performDestroy(Activity.java:8350)
   
   
   ### Command or Code
   <!-- What command or code is needed to reproduce the problem? -->
   
   
   
   ### Environment, Platform, Device
   <!-- In what environment, on what platform or on which device are you experiencing the issue? -->
   Android HuaWei p10Pro
   
   
   ### Version information
   <!--
   What are relevant versions you are using?
   For example:
   Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins
   Other Frameworks: Ionic Framework and CLI version
   Operating System, Android Studio, Xcode etc.
   -->
   
   
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [ ] I searched for existing GitHub issues
   - [ ] I updated all Cordova tooling to most recent version
   - [ ] 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.

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



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


[GitHub] [cordova-android] breautek commented on issue #1000: exception throwed when cordovaActivity destroy

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


   https://github.com/apache/cordova-android/blob/97e2d15634f3c7a37e468cdafcb697257340570c/framework/src/org/apache/cordova/CordovaWebViewImpl.java#L506 is the line @zhqcqupt was talking about... And directory below it:
   
   https://github.com/apache/cordova-android/blob/97e2d15634f3c7a37e468cdafcb697257340570c/framework/src/org/apache/cordova/CordovaWebViewImpl.java#L508-L509
   
   Wonder if that TODO applies here... :thinking: Perhaps it's a race condition.


----------------------------------------------------------------
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.

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



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


[GitHub] [cordova-android] brodybits commented on issue #1000: exception throwed when cordovaActivity destroy

Posted by GitBox <gi...@apache.org>.
brodybits commented on issue #1000:
URL: https://github.com/apache/cordova-android/issues/1000#issuecomment-645093764


   In a case like that I would strongly recommend the following ideas:
   
   - Try upgrading as much as you can, one thing at a time, and see what happens.
   - Get rid of all generated artifacts such as node_modules, plugins, and platforms, migrate configuration of plugins and platforms from config.xml to package.json, and try building.
   - Try creating a new project then try implementing one thing at a time to see what does and does not work.
   
   In short, try one thing at a time to make a [minimal, reproducible example](https://stackoverflow.com/help/minimal-reproducible-example).


----------------------------------------------------------------
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.

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



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


[GitHub] [cordova-android] zhqcqupt edited a comment on issue #1000: exception throwed when cordovaActivity destroy

Posted by GitBox <gi...@apache.org>.
zhqcqupt edited a comment on issue #1000:
URL: https://github.com/apache/cordova-android/issues/1000#issuecomment-645231876


   It's a bit embarrassing. Under the latest Cordova project(a demo), I destroy the Cordova page and still report that exception. However, I found that my previous inference was not true, that is, Cordova's closing affected the setflag setting of the next page.
   cordova -v  9.0.0 (cordova-lib@9.0.1),Installed platforms: android 8.1.0
   the excption stacktrace is different than before
   
   2020-06-17 16:04:22.328 15867-15867/i W/cr_AwContents: Application attempted to call on a destroyed WebView
       java.lang.Throwable
           at org.chromium.android_webview.AwContents.a(PG:124)
           at vo.loadingStateChanged(PG:2)
           at android.os.MessageQueue.nativePollOnce(Native Method)
           at android.os.MessageQueue.next(MessageQueue.java:363)
           at android.os.Looper.loop(Looper.java:173)
           at android.app.ActivityThread.main(ActivityThread.java:8178)
           at java.lang.reflect.Method.invoke(Native Method)
           at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
   
   what a strange thing is the phenomenon below is still exist in my app,but not in the demo
   "I found the cordova code where the exception was thrown (CordovaWebviewImpl#handleDestroy) and commented out the code that caused the exception (this.loadUrl("about:blank");). There will be no above problems, and my setFlags function normally"


----------------------------------------------------------------
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.

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



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


[GitHub] [cordova-android] zhqcqupt commented on issue #1000: exception throwed when cordovaActivity destroy

Posted by GitBox <gi...@apache.org>.
zhqcqupt commented on issue #1000:
URL: https://github.com/apache/cordova-android/issues/1000#issuecomment-645087221


   > Please provide version info. You can find this information via the following commands:
   > 
   > ```
   > cordova -v
   > cordova platform ls
   > cordova plugin ls
   > ```
   > 
   > Thank you.
   
   Sorry, our project is relatively old, and it has been handed over many times by many people. At present, we only have the source code of the cordova framework and various plugins, and there is no complete Cordova environment and configuration. What is certain is that the PLATFORM_VERSION_BUILD_LABEL in cordova.js we use is 5.1.1, which corresponds to Installed platforms. Other information is unclear. (The version information of the camera plug-in is "cordova-plugin-camera 4.1.0 "Camera"". Although this information should be useless, it is still provided to you). I also read the relevant information before asking the question, I am not sure that the new version fixes the problem. 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.

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



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


[GitHub] [cordova-android] zhqcqupt commented on issue #1000: exception throwed when cordovaActivity destroy

Posted by GitBox <gi...@apache.org>.
zhqcqupt commented on issue #1000:
URL: https://github.com/apache/cordova-android/issues/1000#issuecomment-645231876


   It's a bit embarrassing. Under the latest Cordova project, I destroy the Cordova page and still report that exception. However, I found that my previous inference was not true, that is, Cordova's closing affected the setflag setting of the next page.
   cordova -v  9.0.0 (cordova-lib@9.0.1),Installed platforms: android 8.1.0
   the excption stacktrace is different than before
   
   2020-06-17 16:04:22.328 15867-15867/i W/cr_AwContents: Application attempted to call on a destroyed WebView
       java.lang.Throwable
           at org.chromium.android_webview.AwContents.a(PG:124)
           at vo.loadingStateChanged(PG:2)
           at android.os.MessageQueue.nativePollOnce(Native Method)
           at android.os.MessageQueue.next(MessageQueue.java:363)
           at android.os.Looper.loop(Looper.java:173)
           at android.app.ActivityThread.main(ActivityThread.java:8178)
           at java.lang.reflect.Method.invoke(Native Method)
           at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
   
   
   


----------------------------------------------------------------
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.

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



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


[GitHub] [cordova-android] Reqwy commented on issue #1000: exception throwed when cordovaActivity destroy

Posted by GitBox <gi...@apache.org>.
Reqwy commented on issue #1000:
URL: https://github.com/apache/cordova-android/issues/1000#issuecomment-733597407


   > It's a bit embarrassing. Under the latest Cordova project(a demo), I destroy the Cordova page and still report that exception. However, I found that my previous inference was not true, that is, Cordova's closing affected the setflag setting of the next page.
   > cordova -v 9.0.0 (cordova-lib@9.0.1),Installed platforms: android 8.1.0
   > the excption stacktrace is different than before
   > 
   > 2020-06-17 16:04:22.328 15867-15867/i W/cr_AwContents: Application attempted to call on a destroyed WebView
   > java.lang.Throwable
   > at org.chromium.android_webview.AwContents.a(PG:124)
   > at vo.loadingStateChanged(PG:2)
   > at android.os.MessageQueue.nativePollOnce(Native Method)
   > at android.os.MessageQueue.next(MessageQueue.java:363)
   > at android.os.Looper.loop(Looper.java:173)
   > at android.app.ActivityThread.main(ActivityThread.java:8178)
   > at java.lang.reflect.Method.invoke(Native Method)
   > at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
   > at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
   > 
   > what a strange thing is the phenomenon below is still exist in my app,but not in the demo
   > "I found the cordova code where the exception was thrown (CordovaWebviewImpl#handleDestroy) and commented out the code that caused the exception (this.loadUrl("about:blank");). There will be no above problems, and my setFlags function normally"
   
   Can confirm that. cordova-android 9.0.0 with android 9.0.0,  targetSdk set to 29 or 30 (reproduced on both), but bug is there on all devices starting with API 24+ (didn't test for lower)
   
   Commenting out the line that @zhqcqupt mentioned makes that exception disappear. 
   
   I there a less hacky way though to bypass it?


----------------------------------------------------------------
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.

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



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


[GitHub] [cordova-android] breautek commented on issue #1000: exception throwed when cordovaActivity destroy

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


   Please provide version info. You can find this information via the following commands:
   
   ```
   cordova -v
   cordova platform ls
   cordova plugin ls
   ```
   
   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.

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



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


[GitHub] [cordova-android] Reqwy edited a comment on issue #1000: exception throwed when cordovaActivity destroy

Posted by GitBox <gi...@apache.org>.
Reqwy edited a comment on issue #1000:
URL: https://github.com/apache/cordova-android/issues/1000#issuecomment-733597407


   > It's a bit embarrassing. Under the latest Cordova project(a demo), I destroy the Cordova page and still report that exception. However, I found that my previous inference was not true, that is, Cordova's closing affected the setflag setting of the next page.
   > cordova -v 9.0.0 (cordova-lib@9.0.1),Installed platforms: android 8.1.0
   > the excption stacktrace is different than before
   > 
   > 2020-06-17 16:04:22.328 15867-15867/i W/cr_AwContents: Application attempted to call on a destroyed WebView
   > java.lang.Throwable
   > at org.chromium.android_webview.AwContents.a(PG:124)
   > at vo.loadingStateChanged(PG:2)
   > at android.os.MessageQueue.nativePollOnce(Native Method)
   > at android.os.MessageQueue.next(MessageQueue.java:363)
   > at android.os.Looper.loop(Looper.java:173)
   > at android.app.ActivityThread.main(ActivityThread.java:8178)
   > at java.lang.reflect.Method.invoke(Native Method)
   > at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
   > at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
   > 
   > what a strange thing is the phenomenon below is still exist in my app,but not in the demo
   > "I found the cordova code where the exception was thrown (CordovaWebviewImpl#handleDestroy) and commented out the code that caused the exception (this.loadUrl("about:blank");). There will be no above problems, and my setFlags function normally"
   
   Can confirm that. cordova-android 9.0.0 with android 9.0.0,  targetSdk set to 29 or 30 (reproduced on both), but bug is there on all devices starting with API 24+ (didn't test for lower)
   
   Commenting out the line that @zhqcqupt mentioned makes that exception disappear. 
   
   Is there a less hacky way though to bypass it?


----------------------------------------------------------------
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.

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



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


[GitHub] [cordova-android] breautek commented on issue #1000: exception throwed when cordovaActivity destroy

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


   I'd also like to add that cordova-android 5.1.1 is extremely dated and will likely not work with modern sdk versions. It certainly wouldn't pass Google's Play expectations.


----------------------------------------------------------------
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.

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



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