watchkit extension 2 iOS app crash at start in simulator - ios-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.

Related

xamarin.forms Android release build only works with fast deployment enabled

For the past days I had major issues with deploying the android version of my app. I found out that I am only ever able to get the app to work when "Fast Deployment" is checked. However, this means I can never archieve my app. If fast deploy is enabled, the app, even though it is in release mode, is treated like a DEBUG build and therefore not accepted in the playstore.
If i uncheck fast deploy for release builds the app starts and then idles, not doing the first rest call it is supposed to do. If I leave the rest calls out, the app again works.
How can this be correlated?
The symptom that it works when set "Fast Deployment" suggests this situation:
If you are testing a release build on a device that previously had a debug build, its possible that the debug version did not get fully uninstalled. Specifically, "Fast Deployment" stores the xamarin library as a separate DLL. Because your release build has the same "bundle id" as the debug build, Android can get confused.
To fix.
Best Fix for emulator:
Tools / Android Device Manager / Select virtual device / Edit / Clear to Factory Defaults.
Quickest fix for phone (but not sure if it helps):
Drag app to trash can.
Power down the phone. Power it back on.
Deploy release build to device. Either by installing apk, or by "Start Without Debugging" menu item.
Quick Fix:
Run debug version again on the device. This makes sure Android "knows" that the debug version of app is there.
Stop the app.
On the device, "uninstall" the app. (Drag it to trash can).
Deploy release build to device. Either by installing apk, or by "Start Without Debugging" menu item.
If that doesn't work, then use "adb uninstall":
Run debug version again on the device. This makes sure Android "knows" that the debug version of app is there.
Stop the app.
menu Tools / Android / Android Adb Command Prompt.
adb uninstall com.companyname.appname <-- substitute your app's bundle id
deploy release build to device.
It turnes out that turning ON my linker to link assemblies only actually decreased the app size AND made everything work again. Before, the linker was set to LINK NONE (which should've been the safer bet, but turned out to be an error...).

Xamarin Forms - iOS debug on actual device hangs on launchscreen. Workin on simulator

I have a XF app already published on the play store and now I am targetting iOS. During developpent I made sure the app was still working on iOS, using the simulator only.
On the simulator everything works as expected, the launch screen is shown then the MainPage starts. But when I debug on an actual IPhone device, the app get stuck on the Launchscreen.storyboard for about 20 sec then the app exits. I've no debug output and it seems that the AppDelegate is never hit. Breakpoints in AppDelegate.FinishedLaunching method are not hit for instance. I tried to F11 for start in debugging mode but I don't hit anything, still hanging on the launch screen. I was expecting the transition from simulator to device to be less painful.
My plist file contains the following permission requirements
...
<key>NSLocationAlwaysUsageDescription</key>
<string>We need to use your location</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>We are using your location</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>This app needs access to photos.</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>This app needs access to the photo gallery.</string>
The only difference I saw is that location permissions are not asked on the device while in the simulator it asks for it at start. But this might be related to the fact that I can't reach AppDelegate, I am not sure yet.
The iOS project was generated via Prism templates. I am using VS 16.8.0 on Windows, XF 4.8.0.1687, Prism 8.0.0.1909, Xamarin iOS SDK 14.4.1.3 and I am set to "don't link" for linkers option. The device is an Iphone 10.
Any idea how can I find out the root cause - or get some useful logs?
Thanks in advance for your help.
EDIT:
Here are the device log output during a new installation https://taits.s3-eu-west-1.amazonaws.com/devicelogs.txt. I am trying to go through them but kinda lost.

Simple Javafx application not launching from eclipse <exit value: -1073740791>

This is a frustrating one that i am sure has a simple solution but i can't figure out which setting changed which is causing my javafx application not to launch.
The first javafx application that i ran on my workstation through eclipse oxygen worked fine. I imported a project that was prebuilt to display fractals and added "javafx/**" as accessible to my build path and i was able to launch it successfully.
Since then, I've tried loading other javafx projects to my workspace and running them with the same build path but nothing appears after i try to run the application.
I made sure to be in the class that extends application with the launch in it and that the build path is set but all i get when i try to run it in debug any javafx application terminates right away with the following exit code:
<disconnected>org.hameister.javafx.fractal.JavaFXFractal at localhost:49944
<terminated, exit value: -1073740791>C:\Program Files\Java\jdk1.8.0_161\bin\javaw.exe
At first i thought it was the code in the new projects but when i try to run the original fractal project again it gives me the same thing.
Does anyone have a clue how i can fix this?
Thank you!
Update:
I reinstalled the jdk (jdk-8u161-windows-x64) and eclipse (Oxygen.2 Release (4.7.2)) and am working out of a new workspace.
When I debug the applications, I get a quick stack that displays:
-Daemon Thread [QuantumRenderer-0] (Running)
-Daemon Thread [thread-1] (Running
-Thread [WindowsnativeRunLoopThread] (Running)
Then the stack is empty with only the terminated exit value from above.
It's as though I hit some hotkey or button that is no longer allowing applications to visually appear. Console based Java applications run fine.

xcodebuild times out when starting simulator

I am attempting to set up automated testing for my iOS app using TeamCity. Currently, my agent builds, but once building the last target and running codesign, it hangs and displays the following:
[19:29:34][CodeSign] CodeSign /var/root/Library/Developer/Xcode/DerivedData/MyProductiOS-fgkoogiimhlbckdlbckzmqfyaoff/Build/Products/Debug-iphonesimulator/MyProductiOSUITests-Runner.app/PlugIns/MyProductiOSUITests.xctest
[19:29:34][CodeSign] cd /Users/ericmiller/.tcagent/work/f9abef315a0137d4
[19:29:34][CodeSign] export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
[19:29:34][CodeSign] export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/ericmiller/.pyenv/shims:/Users/ericmiller/.rbenv/shims:/Users/ericmiller/.pyenv/shims:/Users/ericmiller/Scripts:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/opt/local/bin"
[19:29:34][CodeSign] Signing Identity: "-"
[19:29:34][CodeSign] /usr/bin/codesign --force --sign - --timestamp=none /var/root/Library/Developer/Xcode/DerivedData/MyProductiOS-fgkoogiimhlbckdlbckzmqfyaoff/Build/Products/Debug-iphonesimulator/MyProductiOSUITests-Runner.app/PlugIns/MyProductiOSUITests.xctest
[19:29:34][CodeSign] /var/root/Library/Developer/Xcode/DerivedData/MyProductiOS-fgkoogiimhlbckdlbckzmqfyaoff/Build/Products/Debug-iphonesimulator/MyProductiOSUITests-Runner.app/PlugIns/MyProductiOSUITests.xctest: replacing existing signature
[19:31:32][CodeSign] 2017-01-22 19:31:32.279 xcodebuild[28262:86807] iOSSimulator: Timed out waiting 120 seconds for simulator to boot, current state is 1.
[19:31:32][CodeSign] 2017-01-22 19:31:32.290 xcodebuild[28262:86805] iOSSimulator: Timed out waiting 120 seconds for simulator to boot, current state is 1.
[19:31:32][CodeSign] 2017-01-22 19:31:32.291 xcodebuild[28262:86797] Error Domain=IDETestOperationsObserverErrorDomain Code=3 "Timed out waiting 120 seconds for simulator to boot, current state is 1. If you believe this error represents a bug, please attach the log file at /var/root/Library/Developer/Xcode/DerivedData/MyProductiOS-fgkoogiimhlbckdlbckzmqfyaoff/Logs/Test/89F7C786-9E91-419F-98CA-F36385618DC2/Session-MyProductiOSTests-2017-01-22_192932-E95vcV.log" UserInfo={NSLocalizedDescription=Timed out waiting 120 seconds for simulator to boot, current state is 1. If you believe this error represents a bug, please attach the log file at /var/root/Library/Developer/Xcode/DerivedData/MyProductiOS-fgkoogiimhlbckdlbckzmqfyaoff/Logs/Test/89F7C786-9E91-419F-98CA-F36385618DC2/Session-MyProductiOSTests-2017-01-22_192932-E95vcV.log}
[19:31:32][CodeSign] 2017-01-22 19:31:32.291 xcodebuild[28262:86797] Error Domain=IDETestOperationsObserverErrorDomain Code=3 "Timed out waiting 120 seconds for simulator to boot, current state is 1. If you believe this error represents a bug, please attach the log file at /var/root/Library/Developer/Xcode/DerivedData/MyProductiOS-fgkoogiimhlbckdlbckzmqfyaoff/Logs/Test/89F7C786-9E91-419F-98CA-F36385618DC2/Session-MyProductiOSUITests-2017-01-22_192932-mrX7wQ.log" UserInfo={NSLocalizedDescription=Timed out waiting 120 seconds for simulator to boot, current state is 1. If you believe this error represents a bug, please attach the log file at /var/root/Library/Developer/Xcode/DerivedData/MyProductiOS-fgkoogiimhlbckdlbckzmqfyaoff/Logs/Test/89F7C786-9E91-419F-98CA-F36385618DC2/Session-MyProductiOSUITests-2017-01-22_192932-mrX7wQ.log}
The simulator app is open in the dock. Clicking on the simulator does nothing, but if I right-click and select the window, I can see that the simulator is indeed running but is not displaying anything. Example
I'm looking for a workaround to test my code, without switching to a physical device instead of a simulator if possible. How can I achieve this goal, and what could be wrong with my configuration?
EDIT:
Sven Driemecker found the solution. Here's my configuration.
Before running the xcodebuild, I run the following shell script to ensure a sanitary testing environment.
xcrun simctl shutdown %env.simulator_guid%
killall Simulator
killall com.apple.CoreSimulator.CoreSimulatorService
xcrun simctl erase %env.simulator_guid%
Then, when running the xcodebuild, add the following option:
-destination "id=%env.simulator_guid%"
And finally, to clean everything up:
xcrun simctl shutdown %env.simulator_guid%
killall Simulator
killall com.apple.CoreSimulator.CoreSimulatorService
Update: Here's a blog post I wrote about how to set up basic TeamCity CI for XCode/iOS.
I have been experiencing a similar error when attempting to run an iOS app in the simulator from Xcode 11.3.1. I have found that re-choosing the virtual hardware can resolve this issue a little quicker than other solutions mentioned on this page.
When I receive the "Timed out waiting for Simulator.app to become ready" error in Xcode, the Simulator.app has typically launched but shows no actual simulator. Choosing Hardware > Device > [OS version] -> [Simulator Name] causes the simulator to appear and successfully launch my app on the next run attempt.
It seems pretty odd, but simply resetting the simulator usually fixes this. We often encounter the same error on our own CI-system.
Try Simulator-Menu -> Reset Content and Settings, then restart the simulator.
You can enforce this on the command line, but I won't recommend it, cause it will slow down your build remarkably.
There is a bug in Xcode 11.3 and earlier which could manifest this way if you have Simulator.app running from another Xcode. There is a small race window in which this could happen. That was fixed in Xcode 11.3.1.
but...
There is a bug in Xcode 11.3.1 and later (through Xcode 11.4.1 as of this comment) which manifests this way as well. To workaround the issue, you can click on Simulator.app in Dock after it launches (even if it is foreground). Alternatively, you can enable pasteboard synchronization in Simulator.app via 'Edit -> Automatically Sync Pasteboard'.
I have not found a good solution to fix the root cause of this issue, but I have found a work around. If you simply open simulator before building your app in Xcode this issue is bypassed.
Just killing and reopening the simulator worked for me.
You can also check the Window menu of the Simulator app.
There could be one or more Simulator windows that are marked as using an [External Display]. When you select a window from the menu nothing will appear, however you will be able to press Cmd-W to close it.
After you've closed all windows using an External Display, the Simulator will start working properly again.
I am uncertain how one can select an External Display for a simulator, however it has happened to me a few times and just quitting the Simulator app did not help. I had to either do what I describe above, or restart the machine.

BB 10 App Crashing in device,but working good in simulator

I have developed an BB 10 app, It is working well in the simulator.The same app is not working in the device.I want to know , why it is crashing in device.
Is there any way to know the reason for crashing after installing in the device, so that i can fix it.
I have created a log file in the Device Documents
Is there any signal / listener OR try and catch mechanism, to write that exception into the log file?
my bar-descriptor.xml is like this, Please find.
<!-- Request permission to execute native code. Required for native applications. -->
<permission system="true">run_native</permission>
<permission>read_device_identifying_information</permission>
<permission>access_pimdomain_messages</permission>
<permission>access_internet</permission>
<permission system="true">_sys_use_consumer_push</permission>
<permission>access_sms_mms</permission>
<permission>post_notification</permission>
<permission>access_shared</permission>
<permission>bbm_connect</permission>
<env var="LD_LIBRARY_PATH" value="app/native/lib:/usr/lib/qt4/lib"/>
Please help,
Thanks!!!
You haven't given much to go on but here are some things to check right off the bat:
If the application isn't signed, and you don't have a debug token, or the token has expired or development mode has expired on the device the application will exit from the splash screen.
If you aren't requesting all necessary permissions in you app-descriptor.xml file your application may be getting unexpected results that cause the crash.
If you have a higher OS version on the simulator than the device, you may be using QML that isn't recognized by the device QML compiler which will cause a crash when the returned QML document is null. This is usually logged to the console.
If it isn't one of those, use the IDE run the application on the device and see if there is anything useful logged to the console. If not, set the IDE into debug mode to run the program under the debugger on the device. It will halt execution where the application is aborting. This may be deep in a system library but you may be able to step up the call stack to your code to find out the location of the problem.

Resources