繁体   English   中英

未验证 vs 代码断点中的 Ionic 4 cordova android 调试

[英]Ionic 4 cordova android debugging in vs code breakpoints not verified

我不可能再在 Vs Code 中进行调试了。 我可以附加到模拟器,但断点都未验证。 我在 Windows 10 和 Ubuntu 18.04 中的行为相同。 使用 Ionic 3 我没有这些问题。

我发现,ionic 4 不再使用应用程序脚本了。 所以源映射文件现在不在根目录的 .sourcemaps 文件夹中,而是在 www 文件夹中。

我试过

“cwd”: “${workspaceFolder}/src”

或者

“cwd”: “{workspaceFolder}/www"

{
    "name": "Attach to running android on emulator",
    "type": "cordova", "request": "attach", "platform": "android",
    "target": "emulator", "port": 9222, "sourceMaps": true, "cwd": "{workspaceFolder}”
    },

但这也不起作用。

关于系统的一些信息:

Ionic version:
Ionic:

Ionic CLI : 5.2.6 (C:\Users*****\AppData\Roaming\nvm\v10.16.3\node_modules\ionic)
Ionic Framework : @ionic/angular 4.8.0
@angular-devkit/build-angular : 0.801.3
@angular-devkit/schematics : 8.1.3
@angular/cli : 8.1.3
@ionic/angular-toolkit : 2.0.0

Cordova:

Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : android 8.0.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.1, (and 4 other plugins)

Utility:

cordova-res : 0.6.0
native-run : 0.2.8

System:

Android SDK Tools : 26.1.1 (C:\Users*****\AppData\Local\Android\Sdk)
NodeJS : v10.16.3 (C:\Program Files\nodejs\node.exe)
npm : 6.9.0
OS : Windows 10

Steps to reproduce:
ionic start myApp tabs
Start emulator
ionic cordova run android
Start debugging

My launch.json

{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
“version”: “0.2.0”,
“configurations”: [
{
“name”: “Run Android on device”,
“type”: “cordova”,
“request”: “launch”,
“platform”: “android”,
“target”: “device”,
“port”: 9222,
“sourceMaps”: true,
“cwd”: “{workspaceFolder}", "ionicLiveReload": false }, { "name": "Run iOS on device", "type": "cordova", "request": "launch", "platform": "ios", "target": "device", "port": 9220, "sourceMaps": true, "cwd": "{workspaceFolder}”,
“ionicLiveReload”: false
},
{
“name”: “Attach to running android on device”,
“type”: “cordova”,
“request”: “attach”,
“platform”: “android”,
“target”: “device”,
“port”: 9222,
“sourceMaps”: true,
“cwd”: “{workspaceFolder}" }, { "name": "Attach to running iOS on device", "type": "cordova", "request": "attach", "platform": "ios", "target": "device", "port": 9220, "sourceMaps": true, "cwd": "{workspaceFolder}”
},
{
“name”: “Run Android on emulator”,
“type”: “cordova”,
“request”: “launch”,
“platform”: “android”,
“target”: “emulator”,
“port”: 9222,
“sourceMaps”: true,
“cwd”: “{workspaceFolder}", "ionicLiveReload": false }, { "name": "Attach to running android on emulator", "type": "cordova", "request": "attach", "platform": "android", "target": "emulator", "port": 9222, "sourceMaps": true, "cwd": "{workspaceFolder}/src”
},
{
“name”: “Serve to the browser (ionic serve)”,
“type”: “cordova”,
“request”: “launch”,
“platform”: “serve”,
“cwd”: “{workspaceFolder}", "devServerAddress": "localhost", "sourceMaps": true, "ionicLiveReload": true }, { "name": "Simulate Android in browser", "type": "cordova", "request": "launch", "platform": "android", "target": "chrome", "simulatePort": 8000, "livereload": true, "sourceMaps": true, "cwd": "{workspaceFolder}”
},
{
“name”: “Simulate iOS in browser”,
“type”: “cordova”,
“request”: “launch”,
“platform”: “ios”,
“target”: “chrome”,
“simulatePort”: 8000,
“livereload”: true,
“sourceMaps”: true,
“cwd”: “{workspaceFolder}" }, { "name": "Run Browser", "type": "cordova", "request": "launch", "platform": "browser", "target": "chrome", "simulatePort": 8000, "livereload": true, "sourceMaps": true, "cwd": "{workspaceFolder}”
}
]
}

Vs Code Version:
1.37.1

Cordova Tools Version:
1.8.5

有人可以帮我吗? 我可以对已验证的断点做些什么? 谢谢你的帮助。

在我的情况下,我通过“在模拟器上运行 Android”调试项目,并且出现错误“错误处理“breakpointLocations”:错误:在 Client.processMessage 中找不到“Debugger.getPossibleBreakpoints”。 我将 VS 代码版本从 1.46 降级到 1.37 并修复了

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM