Skip to content
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

cannot resolve method 'startDebugServer' #5

Open
yihchu opened this issue Apr 1, 2019 · 4 comments
Open

cannot resolve method 'startDebugServer' #5

yihchu opened this issue Apr 1, 2019 · 4 comments

Comments

@yihchu
Copy link

yihchu commented Apr 1, 2019

No description provided.

@yihchu
Copy link
Author

yihchu commented Apr 1, 2019

I copied the codes,

Class webEngineClazz = WebEngine.class;

Field debuggerField = webEngineClazz.getDeclaredField("debugger");
debuggerField.setAccessible(true);

Debugger debugger = (Debugger) debuggerField.get(webView.getEngine());
DevToolsDebuggerServer devToolsDebuggerServer.startDebugServer(debugger, WEBVIEW_DEBUG_PORT, 0, null, null);

and the last line is wrong, so i modified it to

DevToolsDebuggerServer devToolsDebuggerServer = new DevToolsDebuggerServer(debugger, 54321, 0, null, null);
devToolsDebuggerServer.startDebugServer();

but there still an error: cannot resolve method 'startDebugServer'

@yihchu
Copy link
Author

yihchu commented Apr 1, 2019

I modified 'startDebugServer' to 'onOpen', and it works. But I can check request in 'Network', but I cannot check logs in 'Console', why ?

@vsch
Copy link
Owner

vsch commented Apr 1, 2019

@yihchu, console output is accomplished in a convoluted way because it needs the stack trace.

It is done through the JSBridge. So if JSBridge is not setup or there is some change in the sequence in how the debugger interface is implemented on Chrome end then it will not work.

I also noticed that it is not consistent. Some times it is setup correctly and on some runs it is not.

The functionality is very fragile and because it is async on multiple counts it is very hard to debug.

@yihchu
Copy link
Author

yihchu commented Apr 2, 2019

@vsch the bridge never setup correctly here, and I new a bridge myself, and i can see logs from java console now, but i still want to see logs from chrome devtools. What should i do ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants