tidev / vscode-titanium

Titanium SDK development tools and UI package for Visual Studio Code.
Apache License 2.0
38 stars 19 forks source link

Unable to debug after updating VS code #132

Open longton95 opened 5 years ago

longton95 commented 5 years ago

Describe the Bug

A customer updated to the latest VS code version (1.38.1) and is now unable to debug on iOS and Android after the update writing here to track issue;

Tried uninstalling the VSCode extension, then reloading, and it still doesn't work. The behavior is that:

  • Android: Compile for debugger and when the app starts, it starts the app and paused the execution immediately, you would have to click the green play arrow in the debug toolbar to start the app. Now it starts the app right away and doesn't stop on any set breakpoints.
  • IOS: Compile for debugger (on device), start the app, immediately you receive an error (attached) image
  • iOS : Compile for debugger (simulator), sim launches, immediately, you get this error (attached) image (1)

Your Environment

Software Version
Titanium SDK 8.0.1.GA
Appcelerator CLI 7.1.1
VS Code 1.38.1
vscode-titanium 0.5.0
Sean-Brown-Digi commented 5 years ago

I'm also getting the "Unable to discover app" error

Sean-Brown-Digi commented 5 years ago

@longton95 I was able to get this to work if I just re-run the debugger (without closing the simulator)

Sean-Brown-Digi commented 5 years ago

It worked perfectly for my Android tablet, no need to relaunch

rlustemberg commented 5 years ago

Having the same issue in iOS

bt-hellotess commented 5 years ago

Same problem here.

Appcelerator Command-Line Interface, version 7.1.1-5

Operating System Name = Mac OS X Version = 10.15.1 Architecture = 64bit

CPUs = 4

Memory = 8589934592

Node.js Node.js Version = 8.12.0 npm Version = 6.4.1

Titanium CLI CLI Version = 5.2.1

Titanium SDK SDK Version = 7.4.1.GA

ewanharris commented 4 years ago

@Sean-Brown-Digi, we've been trying to tune the time we wait before we error out with Unable to discover app. If it works for you with the simulator launched already then I believe you may just be hitting the limit of the time we wait. Maybe we need to make that time configurable.

@rlustemberg, could you elaborate on what you're seeing? Titanium SDK version, target (simulator or device).

@Bogdan-Hash, same for you. I'm guessing SDK 7.4.1.GA (I don't believe we've tested this version). But what platform, and target are you debugging on?

@longton95, do you remember who you reported this issue for? Any ideas if they're still seeing the issue?

bt-hellotess commented 4 years ago

@ewanharris
"platform": "ios", "target": "simulator" From time to time it works if i keep the simulator open (but probably once out of ten attempts). But it is not usable that way. I tried a lot of times to see what i'm doing different when it works, but did't do anything special. I think me and @Sean-Brown-Digi have a similar issue. And yes, i'm using SDK 7.4.1.GA, I have mentioned in the first comment.

When it fails, debugger just stop loading my resources after loaded half of them (then the error occur). When it works, all files are loaded correctly.

In both cases simulator works fine.

Sean-Brown-Digi commented 4 years ago

@ewanharris making that timeout option configurable sounds like a decent idea. Is this something you're able to test with a real iOS device? I'm noticing that it never works on a real device but the simulator works pretty reliably after re-launching.

ewanharris commented 4 years ago

The _stack error looks to be coming from some issue with remotedebug-ios-webkit-adapter/ios-webkit-debug-proxy erroring during startup. I've split that out to #161.

@Sean-Brown-Digi from my testing I'm able to debug KitchenSink-v2 on an iOS 13 device, and an iOS 12.1 device. It might be that you need to reinstall ios-webkit-debug-proxy and the related components to get debugging working on iOS 13 devices. You can do that via running the below commands.

brew uninstall ios-webkit-debug-proxy libimobiledevice usbmuxd
brew install --HEAD usbmuxd
brew install --HEAD libimobiledevice
brew install --HEAD ios-webkit-debug-proxy

Do you want to give that a try and see if it works for you?

I'm totally not a fan of this though, basically when Apple changes things in JSCore people will have to more than likely reinstall ios-webkit-debug-proxy again to pick up those fixes. I'm looking to try improve the downstream package we use to avoid this, but I'll also think about whether we can add some better messaging in the extension around this.

Sean-Brown-Digi commented 4 years ago

That didn't work for me though it did take a little longer to fail. I wonder if it has to do with my default shell, which is set to "fish", for instance when I re-installed the packages I saw a lot of output like this:

==> libxml2
libxml2 is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.

If you need to have libxml2 first in your PATH run:
  echo 'set -g fish_user_paths "/usr/local/opt/libxml2/bin" $fish_user_paths' >> ~/.config/fish/config.fish

For compilers to find libxml2 you may need to set:
  set -gx LDFLAGS "-L/usr/local/opt/libxml2/lib"
  set -gx CPPFLAGS "-I/usr/local/opt/libxml2/include"

For pkg-config to find libxml2 you may need to set:
  set -gx PKG_CONFIG_PATH "/usr/local/opt/libxml2/lib/pkgconfig"

I'm not sure if that means anything though. I checked out issue #161 and I'm not sure how you got that debug output but that looks like a useful place to start trying to debug the issue.