Websocket error preventing RN device build v0.31.0 - websocket

I've upgraded to RN v.0.31.0 which has apparently automated the connection to my device from xcode, so that I don't have to set the url string for my ip. Ideally, I should hit the run button in xcode and it my app should just run on my device, given that both my device and laptop are on the same wifi network (which they are). However, I am getting a websocket error that informs me that no listeners are registered, and my react native packager never finishes loading. In my app, i have a shortened menu which only allows me to reload, debug js remotely, show inspector and show perf monitor- omitting all other options, such as live reload, etc. The websocket error verbatim reads: "Sending websocketFailed with no listeners registered." Additionally, on reload, it tells me (on the top banner that briefly appears) that its loading from a pre-bundled file, which is not what I want. Note, my setting for the build scheme is "debug".
I am not sure how to fix this since before I always just adjusted the url in my AppDelegate.m file and my app would run.

Related

Connecting an external debugger for browser extension development

I'm trying to figure out how to properly attach an external debugger from, say WebStorm or vs-code to debug a browser extension.
How my ideal workflow would look like:
I launch an extension in dev-mode with https://github.com/mozilla/web-ext and then can attach debugger to that browser instance, see break-points/etc.
What I've tried
Configure https://www.jetbrains.com/help/webstorm/configuring-javascript-debugger.html specifying a URL on which my extension operates.
Add a break-point to a content-script
After browser is started by debug process - load my extension from disk & reload the page
Expected: debugger stops at a break point
Actual: page loads without interruption (or sometimes debugger stops at a random code not from my extension 😅 )
I've also tried setting the breakpoint for a background script, which didn't seem to have any effect either.
Misc
For content-script WebStorm seems to indicate that break-points are not in a valid state
Background script breakpoint is, not that it helps
Code is bundled with Parcel with source-maps enabled
Browser is Chrome 99.0.4844.51 (FF debugging does not seem to be supported)
System: macOS 12.2

NSLog not working when debugging an app extension

I just can't see any logs in the window, even though I know I'm attached to the extension, I can place and enter into breakpoints, as well I see the values of variables.
However I can't see any logs.
Any ideas?.
Normal app logs works just fine.
Seems like you are running the actual main app, not the extension (wrong scheme).
In Xcode, next to the play and stop buttons it should say the name of your app and the device you're running on. Make sure it says the name of your extension, not the name of your actual app.
Please see the attached screenshot:
As you can see, I have selected my keyboard extension - not the main application 'TransKey'. Once you do that, you should be able to see the logs in the Debug area for your extension.

My windows phone application runs when ran though visual studio (onclick of device button) but when I disconnect and run it doesn't?

I have written file picker code in my project. When i run the project in my windows phone by clicking on device button in visual studio, the app runs fine(I mean it opens pictures library and i can select a photo and preview it).
But when I disconnect my usb and then open the app in the phone and when i open pictures library on click of a button , the pictures library opens briefly and then the app crashes immediately(My app closes).
Can anyone please help me with this??
As written in the blog post , the AndContinue method run in a different process and to do so, the current running app goes into the background or even gets closed sometimes, that is what you are experiencing in your app as far i can tell but not sure why different things happening during debug & deploy.
There must be a callback inside app.xaml.cs specifically to handle the condition when calling application(which was sent into background) comes in foreground, read this blog post carefully & you'll understand as what you need to change in your code :
using-the-andcontinue-methods-in-windows-phone
http://blogs.msdn.com/b/wsdevsol/archive/2014/05/08/using-the-andcontinue-methods-in-windows-phone-silverlight-8-1-apps.aspx
I just dealt with this issue and one of the reasons why there are differences between debug and deploy is because of the suspending event.
During debug, the application does not actually get suspended until you manually do it through Lifecycle Events. This means that when you pick a file on debug and the app is put to the background to load the file picker, it is not actually suspended, while when the app is deployed, it actually gets suspended.
Look into your app_resuming method and OnSuspending methods in your app.xaml that may be causing errors not occurring during debug.

Why does calling chrome.cast.initialize break the connection to the Chromecast device?

I am trying to build a custom Chromecast sender/receiver application, but I can't seem to connect to the device from my custom sender or even Chrome once my custom sender page is loaded.
The Chromecast device appears to be functioning properly (I can cast tabs and YouTube videos). However, when I load the custom sender, it seems to break Chromes connection to the device. The Chromecast icon in Chrome shows "No Cast devices found".
I have found if I comment out chrome.cast.initialize, I can see the Chromecast device again. There are no errors reported in the Chrome debug console and I've commented out all of my code that is called from event handlers related to that call and I still have the same problem. I've also tried resetting the Chromecast device to factory. I've tried a few of the network tweaks recommended in a few other posts as well (though I get the impression they couldn't connect to the device at all).
This was working perfectly yesterday, then it mysteriously stopped. That seems to point to something I might have done, but the only thing I changed was in the receiver app and since I can't get that to start, I don't think it is that.
I also got this error before and I solved it by closing then re-openning the Chrome browser. If you are sure 100% that your js code works as expected when calling chrome.cast.initialize (no error show in Console mode but you got no ChromeCast extension found error), then simply close your Chrome browser and re-open it. If in your console, after calling chrome.cast.initialize, you see the line ChromeCast extension found :.... then you should be able to see your ChromeCast device when clicking into ChromeCast extension icon. If re-open browser does not work, clear your browser cache and try again.
Hope it helps.

Debugging javascript running on the chromecast device

I have my app working with some very basic receiver html however I would now like to do more on the receiver end. Is there a way for me to debug what is happening on the chromecast side? At this point I'm not even sure if my web page is getting refreshed each time.
Open your Chrome browser on port 9222 of your ChromeCast device: http://192.168.0.x:9222
By default the console tab will just show the current app's output, but if you jump from one app to another or your app receiver closes for some reason, you won't know why. To fix that, click on the settings icon (lower right corner) and enable "Preserve log upon navigation"
There appears to be a bug on the ChromeCast device where it caches older versions of the reciever. Just restart the device to force it to download the latest version.

Resources