IOS 11 breaks (ionic) app - ios

I recently updated my IOS to 11 beta 3, to make sure my ionic app would still work.
However it crashes almost right away with a black screen when I launch it.
I try to debug it with Xcode, however when I build to run it on my iPhone and catch the error, the "running on device" gets stuck on the following :
What can I do with this? I'm stuck with an app doomed to die once ios11 gets released, anyone could help?

The problem is normally caused due to wk web view plugin. Try removing the plugin and run again

Related

Xcode 12, iPadOS14.0.1 App won't start on device from Xcode

I have an app and when I choose to run it on the device (an iPad pro) from Xcode, it just sits and the LaunchScreen.storyboard for 30-45 seconds. Eventually and message pops up in the console that says:
Metal API Validation Enabled and it works normally. Other people are having this issue. Any thoughts from the world of smart people:
It's documented here too: https://developer.apple.com/forums/thread/661008
Thank you.
Turns out there are a lot of people with this issue. By following the suggestions in these articles I got it down from 80 seconds to about 8-10. While not good, it's way better.
Cheers.
https://developer.apple.com/forums/thread/651012
Slow app launch time after updating to iOS 14 and Xcode 12
https://developer.apple.com/forums/thread/123068?answerId=420683022#420683022
https://developer.apple.com/forums/thread/651012

Xcode 9 crashing when running split view app on iPhone

After working just fine on both iPhone and iPad for a month, my Xcode 9 app has consistently started crashing causing me the following fatal problem: When I build & run it on an iPhone (simulator or device) Xcode completes loading the app and then crashes too fast for me to copy/paste the error from the debugger. When I run on iPad it works fine leading me to believe this is a result of something related to the split master/detail view.
If I use either an exception breakpoint or an "all C++ exceptions" it will stop at the AppDelegate class and crash if I hit play. If I use only an "all Objective-C exceptions" it will crash as before.
In the debug view hierarchy I get the following errors as well:
Error: Unable to capture view hierarchy.
Details: Log Title: Data source expression execution failure.
Log Details: error evaluating expression “(id)
[[(Class)objc_getClass("DBGTargetHub") sharedHub]
performRequestWithRequestInBase64:#"...
Log Method: -[DBGDataSourceConnectionLibViewDebugger
_executeLLDBExpression:forRequest:onPotentialThread:iteration:]
_block_invoke_2
Method: -[DBGViewDebugger updateDebugHierarchy]_block_invoke_2
I have tested other apps and this issue is unique to the app I am working on. Any ideas or debugging tips for how to proceed? I might just have to redo this whole project again if I can't even find the root cause of this! Appreciate any help.
Quick solution: Reset Simulator Device
I managed to resolve the above issue thanks to some serious digging. First, to resolve the instantaneous crash problem, I set a breakpoint at every line in the app delegate. That allowed me to narrow the error to a memory handling problem. From there I started running the code on one of each device available, and realized the crash only occurred on devices I had used earlier in development. Resetting those devices solved the problem.
The core issue here is that when you clean/rebuild your xcode program, it updates the app code on the device, but not necessarily the data model information. So when I changed my data model by including new data and renaming old data it was not properly updated.

iOS app crashes immediately when debugging AppleWatch app on Simulator (not on device)

I've got an AppleWatch app that is working fine in Simulator and Device, but when I call openParentApplication, it appears that the parent app is crashing immediately because I see this in the console output:
The UIApplicationDelegate in the iPhone App never called reply()...
When I try to manually launch the parent iOS app in the Simulator it crashes there too immediately. I don't have time to attach the debugger (which is already attached to the AppleWatch app) to see what is crashing it. Note that the parent app runs fine when the AppleWatch is running and I'm using a real iPhone. I can also run the app fine on the Simulator when not debugging the AppleWatch app.
I've tried resetting the Simulator, but problem persists.
I'm just not sure how to debug this. Any help is appreciated.
Start an explicit background task in handleWatchKitRequest. Otherwise, your app gets killed before it reaches reply().
Refer to this post for a code example on how to create a background task.
In turns out that after commenting out all code in the parent app's didFinishLaunching and stripping almost all code out of the watch extension, the problem was indeed at a lower level.
The Simulator has a
Debug | Open System Log...
menu option that showed the crash logs, which contained:
Dyld Error Message: Library not loaded:
#rpath/MyCore.framework/MyCore Referenced from:
/Users/me/Library/Developer/CoreSimulator/Devices/A2061705-DDDF-477C-9AAA-E50GG43A6350/data/Containers/Bundle/Application/DEB7FB25-8233-4B9F-8DAB-9FF8AE42BF33/MyApp.app/MyApp
Reason: no suitable image found. Did find:
/Users/me/Library/Developer/CoreSimulator/Devices/A2061705-DDDF-477C-9AAA-E50FF43A6350/data/Containers/Bundle/Application/DEB7FB25-8553-4B9F-8DAB-9FF8AE95BF33/MyApp.app/Frameworks/MyCore.framework/MyCore:
mach-o, but wrong architecture
My Swift app has a few dependent Swift projects that are used by the app and extension. Getting the Swift frameworks to link has been a major pain. I've included the dependent frameworks (compiled in the same workspace) as embedded binaries. This works when running on the device, or on the Simulator, but not when running in this hybrid watch app + parent app Simulator context.
I changed the embedded binary references to point to the frameworks under ...DerivedData...Debug-iphonesimulator, as opposed to ...DerivedData...Debug-iphoneos, and the problem went away.
Still hoping the Swift framework story will improve.
Are you seeing an actual crash? That message has appeared for me plenty of times without the host app crashing.
99% of the time, that error appears because developers aren't opening a background task to complete their work in handleWatchKitRequest. Without the background task, the OS kills your app in the background before it has a chance to reply.

iOS App crashes when setting breakpoint in Xcode

I have an app I'm developing where setting a breakpoint in Xcode while the app is running causes it to crash. At least I assume it is a crash. There is nothing in the console saying what happened. The app just terminates.
Note that the break point is not being hit, just the act of setting it causes this.
I've developed many apps and this is the first to act like this. Does anyone have any ideas what could be happening or how to figure this out? It is really slowing down my debugging.
I'm assuming you're using Xcode 4.x. Try going into your scheme's settings and switch to a different debugger (GDB if you have LLDB currently set, or vice versa).
If that doesn't work, we need more info:
which version of Xcode and iOS are you using?
does the problem occur in the Simulator or on your device, or both?
have you tried placing a breakpoint in different places in your code?
As far as I can tell, it's a debugger issue. So your app does not actually crash, it's the debug session that crashes which causes the app to terminate. You can observe a similar effect when you hit Stop in Xcode or disconnect your device while an app is attached to the debugger in Xcode.
Might be an issue with mismatching Xcode and iOS versions. Please provide more info about your environment to help diagnose the problem.

App crashes without reason with xCode 4

Something weird is going on here.
My app crashes on this line of code:
int end = NSMaxRange(endRange);
but I don't get any error message, and everything is fine: endRange. The app just freezes in the iPhone and that's it.
1.
The weird thing is that the same code was working before, and I've reversed from repository to see what's wrong but it still doesn't work.
2.
Also xCode removes the breakpoint every time the app crashes. I add it again, I run the app, I step over, the app crashes and Xcode removes the breakpoint.
3.
I've cleaned the build, restarted xCode, restarted the iPhone, removed the app from the iPhone. Same issues.
4.
If I don't use breakpoints, the app doesn't crash, but the code right after that line is "skipped", but it was working before. At least the app doesn't freeze without breakpoint.
What the hell ?
I've had similar problems with the debugger in the past too. Try switching from LLDB back to GDB (From the Product / Edit Scheme menu). I've found LLDB to do exactly what you are describing with breakpoints.

Resources