watchOS ExtensionDelegate does not get run - watchkit

I started a new iOS App with WatchKit App from the Xcode template. I have done this a few times before and have not had issues. For some reason the ExtensionDelegate does not seem to run. I have a breakpoint set in applicationDidFinishLaunching() but it does not get hit.
Instead a breakpoint in InterfaceController awakeWithContext gets hit first. Is there a place that this gets configured in order to fix why the ExtensionDelegate launch code does not get run?

Verify that Info.plist for the WatchKit Extension still has the key WKExtensionDelegateClassName set with the correct value for your ExtensionDelegate.
By default it is set to $(PRODUCT_MODULE_NAME).ExtensionDelegate, maybe you deleted or modified it by error.

Related

Connection to daemon was invalidated

My app is using Firebase Analytics and I believe starting in iOS 13.2 started getting the errors described here: Why I get the console warning: [Process] kill() returned unexpected error 1 when I load a WKWebView in iOS13.2?
I guess it wasn't a big deal
Since I planned for my app to go live in January, I began bigger tests in physical devices. I noticed after a while the app started to behave erratically, specially after receiving a [general] Connection to daemon was invalidated error. This doesn't occur in the simulator
Searching the internet I found a post that describes the same problem: https://forums.developer.apple.com/thread/124306
In my case, only Firebase seems to be calling WKWebView, but every time I open the UIMenuController I get the error described in the console and the app appears to be missing inputs. This is specially troublesome with UIScrollViews, which my app uses a lot. The pinch gesture seems to work at will. On an iPhone 6s, the issue isn't as noticeable, on an iPad, it's like a 50% chance the pinch gesture will work properly
Outside of removing Firebase, is there a way to mitigate this issue?
1 June 2020: The console message still persists, however, I have seemed to resolve the UIScrollView issue by deactivating delaysContentTouches, now the pinch gesture seems to work most of the time
23 October 2020 If anyone notices their app starting to behave erratically with no apparent reason I HIGHLY suggest to test it on an iOS 13 physical device if possible. Seems that Apple removed the warning from iOS 14, but testing it on iOS 13 you can pin point the exact reason after the warning appears in the console
Upon further testing, I've reduced the view down to a dead-simple UI view with a single SwiftUI TextField and the 'Connection to daemon was invalidated' still appears after I type the first character into the field. Soon thereafter the app crashes with a sigAbort. (So I don't think the reason is the UITextView wrapper I was using in the previous post). Once the invalidated message appears the app is doomed to crash, not right away but soon thereafter.
I have no idea what causes the 'invalidate' message and a Google search seems to imply that no-one else does either. Some folks appear to have made (experimental?) changes to their UI that stops the message but it appears to be impossible to determine a definite cause. (and like before it only occurs on a real phone)
Same issue without using Firebase at all. What I did: Delete build folder and compile again. Issue does not appears again.
On Xcode:
Clean the Build Folder
This will delete all of the products and intermediate files in the build folder. To clean the build folder you can use the shortcut Command+Option+Shift+K or Menu Bar → Product → Hold Option Key → Clean build Folder.
On Flutter:
Just delete build folder.

watchkit extension 2 iOS app crash at start in simulator

I have configured the WatchKit App to run in my project (WatchOS2).
When I try to run it into the simulator the WatchKit App start perfectly, but each times I'm trying to start the iOS app, this one crash.
The simulator's log show me that :
com.apple.CoreSimulator.SimDevice.5F243C10-E98D-4A20-8950-2742FE6CABD5.launchd_sim[13288] (UIKitApplication:com.MyCompany.MyProject[0x847][13496]): Service exited due to signal: Trace/BPT trap: 5
All of my code in the application delegate is in comment. just enough to start
If I build and use my main app target with the same simulator setting, that works nicely. it just when I build and run the watchkit extension target.
I tried to clean everything (derived data, simulator setting and contents).
I know, it is not the simulator, because with a new project, the issue is not here. it might be something set somewhere ??
but nothing works, any idea ?.
Your application aborted, likely due to a failed assertion. You should look at the crash log (in ~/Library/Logs/DiagnosticReports) for more details.

Meteor android build version

I have a strange issue. I build my Meteor app and run it on android device using -
meteor run android-device --mobile-server=<my_aws_ip>:3000
When the app deploys immediately it connects to the server (and my javascripts etc works). After a few seconds, the page refreshs and none of the javascript callbacks work. Please help me debug this issue.
More information: If I change the client (and not the server), and deploy it, for the first few seconds, the changed client gets shown on the phone. After the first few seconds, the version which is present on the server is shown. So I think Cordova or Meteor is trying to fetch the client code from the server, which is breaking the app. Is there a way to prevent this behavior?
Even more data points -
My aws code does NOT have android and ios platforms installed. Because of this, I think the cordova plugins are not installed, causing a JS break somewhere.
Easiest fix I can think of is remove cordova autoupdate. This is being added by meteor-platform package. If I clone meteor-platform and comment out the cordova autoupdate, the app doesn't load.
Is there another way of removing autoupdate?
This sounds like you have a different version of your app deployed at the mobile-server address.
The local code is run in development mode. Your AWS one is likely in production mode (and may contain a syntax error).
When you run your app it sees the code is different and fetches the new/old (different) version with a hot code reload - hence the page refresh/flash.
To fix this, you need to find the syntax error in your code. It's best to view the ADB logger or run with meteor run --verbose android-device ....
This will provide a bit more information such as an Uncaught exception: cannot read .. of null error type error.
It's hard to say what the error is. The error prevents the rest of your code from executing. In production mode the entire project is one JS file. If there is an error of any kind half way along the file, the rest of the file will not execute.
Also, try loading <my_aws_ip>:3000 in your browser and watch for JS errors in the JS console.
You can also run it locally with --production to simulate a production build environment locally.
Enabling autoupdate but without a page refresh:
Reload._reload = function (options) {
console.log("Next load will load new version");
};

How to respond to desktop startup notification with Qt

I have a Qt application, running under Xfce and other Linux desktops, which works well, except that the circulating "startup notification" icon is not dismissed when the app starts up, so that it persists for some time after the app main window is showing and complete.
I would assume that either the QApplication would by default dismiss the notification when the main window event loop starts, or I would call some method to do so. I can't find anything relevant in the Qt API documentation, or with google searches on Qt startup notification.
How can one dismiss the startup notification, in a Qt application.
Doesn't adding of
StartupNotify=false
to the .desktop file of your app solve the problem?.In KDE,
X-KDE-StartupNotify=false
works; perhaps XFCE has a similar variable.
The startup notification is sent automatically inside Qt when the first window is first shown (see src/plugins/platforms/xcb/qxcbscreen.cpp), but obviously, due to a bug, it does not work if there are quotes or the escape character (\) in the .desktop file in the path to the program.
In addition, if Terminal=true is presented, the environment variable DESKTOP_STARTUP_ID is deleted by xterm and does not reach your application, so it is better not to enable both Terminal and StartupNotify flags at the same time.
Was tested on MATE.

How do I debug XPC Services in XCode 4?

I added an XPC Service to my project and I would like to set breakpoints and inspect variable contents in the debug area in XCode. Breakpoints that I set in the service's code are not recognized (obviously, the debugger is attached to the main apps process. How and I attach the debugger (manually or automatically) to the XPC Service process after my main app launches it? Is there some way to run the service alone and send it messages without it being launched from the main app?
Debug -> Attach To Process -> By Process Identifier (PID) or Name...
Type in your XPC service process name. The next time launchd starts up your XPC service, Xcode will attach.
I am actually not sure how to attach the debugger. But you can still use "NSLog" for debug output on the console. Then start the "Console.app" in "/Applications/Utilities/Concole.app". Depending on your system language this app may have a different name (it's localized). It shows ALL NSLog outputs from all Applications which are running including your xpc-services.
It's not the debugger, but you will get informations out of your service.

Resources