-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I can not see console.log messages on logcat after upgrading to android@10.1.2 #1472
Comments
I'm unable to reproduce this on cordova-android@10 or cordova-android@11. I see log messages from chromium in logcat.
I have this log running on an interval. Are you sure you're actually logging something? I'd open the chrome web inspector to see. |
For each initialized plugin, I log a message for success and for fail. I am sure I am logging some messages. I guess I've found the problem. According to Android documentation (link below), it needed to be implemented "onConsoleMessage" on a WebChromeClient. https://developer.android.com/guide/webapps/debugging#WebView I included manually this method locally in my environment, and it worked fine.
But it was removed from Cordova in his commit below. Please, could you give me the context for this commit? I will try to fix my environment to work without this method. |
Regarding 6d451bc I was the one who committed but it's been awhile but if I recall correctly, Cordova logged to logcat, then proceeded to the super, which would also call to logcat, resulting in duplicate logging. The relevant PR can be found at #950 which has comments describing your issue, I think. It seems like the base class only logs to logcat while the app is in debug mode, but does nothing in release mode. Can you confirm that your issue only occurs while your app is in release mode? Do you get log messages in logcat while the app is in debug mode? If so, #950 (comment) would likely be a path forward. |
Bingo, that is the point. In debug mode, it worked. Another log format. but it works. In release mode, it does not show any log. Ok. Now, it is clear.
I will close this issue. Thank you very much. |
Bug Report
Problem
What is expected to happen?
In the previous Android Platform (8.1.0), I can reach the logs from console.log, using the command below:
And it worked fine.
I updated Android Platform to an intermediate version and I had to change the command to: (sorry for do not remember the version)
And it worked fine too.
What does actually happen?
I upgraded to Android Platform 10.1.2 and I cannot see my logs from console.log using the commands above.
I tried to catch all logs and looking for them after. But it didn't work.
I tried to ask for all logs from PID. I can see some log messages from plugins and others components, but I cannot see my console.log messages.
Has anyone had the same issue? What am I doing wrong? Or is it a bug?
Version information
Android Platform 10.1.2 (from
cordova platform list
)Cordova CLI 11.0.0 (from
cordova -v
)Android SDK 30
Android 10 (my mobile version)
Windows 10 (where is the SDK and logcat)
The text was updated successfully, but these errors were encountered: