Nativescript Angular iOS crashing after splash screen (started randomly) - nativescript

Today, randomly, my app stopped running on iOS anymore. I have been working on it daily for weeks and nothing has changed this morning. Works fine on Android. On iOS it shows the splashscreen like normal and then just quit out. There are no errors shown in the console. I am using Sidekick cloud build for iOS. I am running on a physical device. In fact it does not run on my iPod, but it will run fine on my iPad.
Has anyone had this problem? Is there a reason no errors are visible?
SpringBoard: Forcing crash report of (reason: 1, description:
org.nativescript.myapp failed to scnene-create after 4.77s (launch
took 15.23s of total time limit 10.00s))

Found some insights for this and looks like it is crashing because you are spending too much time doing CPU work on the splash screen.
iOS will kill your app if it takes it too much time to load.
The crash report for this would have an exception code of 8badf00d(this is in Hexadecimal) and it will also say “failed to scene-create in time”.
That is exactly you are also getting.
So try not to load to my things on app initilization and get away from Splash screen as soon as possible.

Related

Xamarin - How to see the iOS Simulator app log

I recently upgraded some Firebase packages in my iOS Xamarin app, and now the thing refuses to work. The app opens (shows a splash screen) and immediately closes without producing an error.
While I want to fix the package problem, I have no clue where to start. I set a breakpoint on the App.xaml.cs constructor, but this never gets hit when I run the iOS version. So my next idea was to read the output like I do on Android.
I've been Googling around for a few hours, and everyone seems to say 'Go to Debug > Open System Log...', but this is absolutely rubbish! The system log seems to show everything except for my app running... (E.g. I run the app in the simulator, reload the system logs, and the freshest thing is from 10 minutes ago...)
I'm at my wits end here. Does anyone know a trick for viewing my app output in the simulator? Even just an exit code would be useful 😥
You could view the logs in these locations:
Mac – ~/Library/Logs/Xamarin/Simulator.Server
Windows – %LOCALAPPDATA%\Xamarin\Logs\Xamarin.Simulator

Apple Watch Program ended with exit code: 0

I'm using Xcode 8.1, Swift 3.
I'm making a custom watch face for the Apple Watch (For myself).
So i set the watch to always show last app on wake, and after sometime i noticed that it get back to the default watch and my app is closed.
For a week now I'm trying to figure out why the app keep closing.
On Xcode i tried to debug the WatchKit Extension and after some time the console just print: "Program ended with exit code: 0" and the app closed again.
I looked on google to check if WatchOs have timeout for apps and didn't find out anything about it.
Also the app is sometimes closed after 5 min and sometimes after 12 h...
The app is never pass the 1.5MB memory.
Any idea what could possibly cause that?
I faced the same issue while working on an app.
In my case I'm using SpriteKit scenes which take a lot of memory for rendering to it causes the crashing of the app on watch.
Do check the memory consumption of your app. Make it under the bar to test it on the device.
Try to remove the elements which you think of taking a lot of memory. Use Instruments to track them.
NOTE: It will run successfully on Simulator. But on the real apple watch it crashes.
App will quit after 8 minutes if it is not in the dock, this is explained in WWDC16 videos, other bug might be similar to this:
Watch App terminates upon deactivation if WKAlert is being shown

Proper way to debug watchos2 app in XCode7

I'm rewriting my watch app to work in watchos2 but have problems debugging on the actual watch (XCode7). What is the correct way how to do this?
1) Obvious (but naive) approach - connect your phone with paired watch, in XCode select Extension scheme to run on Phone + Watch. Click play and it should work, right? This seems to work only just after fresh pairing and breaks very quickly (after few debug runs). See issues and behaviour below
2) Run phone app first then add run of extension - this approach worked for me longer but eventually broke as well.
3) Unpair and pair again - more than painful experience, time consuming and not practical at all. Will help for a while though.
Main problems:
phone app not communicating - I've seen not reachable or messages just time out
watch app stops running - XCode is saying it's running but it's not - won't even attach. If I run it manually on watch most of the times it will attach but then the phone app is not reachable
watch app won't even install - I suspect when the XCode is saying it's running it in fact it doesn't because when I remove the app from watch and then run XCode goes through the whole install process and "running" but the icon doesn't even appear on the main screen
phone stops reacting when I use option 2) and try to run something else while app is attached
phone seems to be blocked, selecting other apps (even going back to my app) won't work until I kill the session
Setup: The phone and watch is paired correctly, phone can see watch, watch can see phone, other apps are working. Watch "trusts" the computer as well, app is "shown on apple watch". Phone is 5s 9.0.1.
I've tried various restart combinations (phone|watch|xcode|mac), shuffled cables, disconnect, reconnect, etc. but that didn't help either.
Did anybody find a usable way how to debug watchos2 app from XCode? Nobody else seems to be complaining about this with released XCode7 though I've seen lots of similar issues in beta builds.
Use Apple watch recharging cable, connect your watch to developing Mac that runs Xcode.
It provides much more successful and fast debugging.
I have been dealing with the same issue this last days, I just updated to iOS 9.2, watchOS 2.1 and XCode 7.2, and now everything works.
After update XCode to 7.2, iOS9.2 my phone and WatchOS2.1 my Apple Watch the debug process is better. I suggest to update all your devices.

Running the app on a real Apple Watch and infinite spinner

I wanted to make a clickable prototype of an app on (storyboard only). I have just added two interface controllers and some images and buttons. I filled xcassets with several images (overall less than 150kB) and tried to run the app. When there was a single interface controller with 3 buttons (images in background) + 1 imageView (around 100kB all) it took some time but the app lauched. I added 1 more interface controller and a few images to it (the biggest are around 9kB) and this time Xcode displayed me a message that it lost a connection with an iPhone but the watch is still running or the watch app timed out error. At the same time I have the app name on the watch screen and a spinner. And it's spinning for ages without any result... I've tried to delete the app from both devices, restarting, cleaning folders etc. and no success. Is there a limit of images one can put in the watch's xcassets? So frustrating...
I was also facing same issue where spinner on real devices was never ending.
This was because watch extension and watch app were missing arm64 architecture, make sure you select Standard Architectures(armv7 and arm64)in build setting.
Here is what you could do/check:
You should use the xcassets that is located in your WatchKit app, not the one in your WatchKit extension.
Build and run your main iPhone app as the primary target once.
Yeah, i've been struggling with this too...
the only way i found : i click on digital crownd of the AppleWath, then re-tap on my app and magically the app launching (and the debugger work.)
if this is not working the hard way : Reboot xcode, Clean, if still not working same as you clean, restart devices... this is so annoying.
first solution take less time, and work 7/10 times
if someone knows a beter solution i'll take it !! ;-)

Run 2 times for simulator to start - iOS Simulator failed to install the application

Yesterday I finally got everything set up for sending to testflightapp.com and also setup to upload to Apple.
But now when I click on RUN the app compiles and uploads to the simulator and then the window at the top of XCode says "Attaching to myAppName". It hangs at that point. The simulator has nothing on the screen other than the standard desktop.
If I hit RUN the 2nd time, then the app runs right away. So all day I have been hitting run 2 times. Obviously something is wrong, but haven't a clue where to start.
any ideas?
thanks for any help!
**EDIT: Got this from the console after waiting 2 minutes:
8/15/11 10:05:01 PM [0x0-0x18018].com.apple.iphonesimulator[262] MobileInstallationInstall: failed with -1
8/15/11 10:05:01 PM Xcode[143]
Error launching simulated application:
Error Domain=DTiPhoneSimulatorErrorDomain Code=1 UserInfo=0x2028d71c0
"iOS Simulator failed to install the application."**
Yes, i have an idea: Be patient. I have had this too, just wait until the Simulator starts up, 'attatching to ...' means that the Simulator.app is still opening and that xcode is waiting for the Simulator to be fully loaded. So once the simulator is running your app will start to run on the simulator. Just don't close the Simulator.app everytime you have finished running the app, like that you wont have to wait for Simulator to boot up everytime. Also if that still does not work, restart xcode, and simulator or just reboot your mac. Also try deleting your app from the Simulator.
I wound up making a new project copying everything over to the new project. It was easier than spending hours trying to find what change I made :(

Resources