Since a few days I've been experiencing a very strange crash when debugging our app within Xcode 11.
Situation
We have an app built for iOS 11 and higher. But since Xcode 11 the app is crashing on setting the root view controller. But when I open the app after it crashed, the app does work so it seems it has something to do with setup a debug session.
The device where I try to build on is an iPhone Xs, with iOS 13.1.2. I also tried another device with 13.1 but having the same issue there.
However, when I attach a device that is running on 12.x.x it's working.
Strangely, yesterday I was able to run on a simulator. But since today the same crash occures on a device (iPhone Xs).
Also maybe important to mention: colleagues of me that work with the same project, do not have the same issues. (!!)
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Show app loading view controller
self.window = [[RMWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.rootViewController = [[AppLoadingViewController alloc] init]; // Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
[self.window makeKeyAndVisible];
I tried the following:
Replaced AppDelegate.h/m by AppDelegate.swift.
Update all project settings to latest settings from Xcode 11.
Tried a plain UIViewController() instead of AppLoadingViewController().
Cleaned Derived Folder (hardcore style)
Clean all Xcode cache
Reinstall Xcode
Restarted Mac + iPhone
Removed the iOS DeviceSupport folder from Xcode preferences, re-connected device via 'Devices and Simulators'.
Created a new project and run on iPhone, DOES work.
This is an app that contains both Objective-C and Swift code, we have it already for years. But it's the first time that something like this is happening.
Is there anyone who has an idea of what this could be?
let homeVC = UIStoryboard(name:"Main", bundle: nil).instantiateViewController(withIdentifier: "SigninViewController") as! SigninViewController
let navC = UINavigationController(rootViewController: homeVC)
navC.navigationBar.isHidden = true
UIApplication.shared.windows.first?.rootViewController = navC
UIApplication.shared.windows.first?.makeKeyAndVisible()
try this it is working Fine in my case..
After spending days on this I have clean installed Mac OS Catalina. This did fix it. I still don't know what the actual problem was, but to potentially save a lot of time for others I suggest doing the same.
If somebody found the solution I would still like to know.
Related
Mac System: 10.12.6
SDK: Xcode 9.0
Deployment Target: iOS 9.0
I'm a pretty new developer, but I persue No Warning in my code.
After I upgrade my Xcode to 9, my code show some warnings not exist before. The most misrable is runtime warning shows below, I know it's from Main Thread Check, and I can make it diappear by setting. But i wonder how to fixed it, I have make all my change UI code in the main thread, just like :
dispatch_async(dispatch_get_main_queue(), ^{
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];
});
Here is my screenshots about warnings and Xcode logs.
Updating your pod should solve the issue. I had the same warning prior updating my google map pod.
updating google map pod
I have an app that has been in the App Store for almost two years. Published originally for iOS 7, it was updated and runs perfectly under iOS 8, and I just downloaded XCode 7 to make sure I was ready when iOS 9 hits the streets.
I am getting a EXC_BAD_ACCESS error when I run the app in the simulator, but not when I run it on my test device running iOS 9.
I am using NSURLSessionDownloadTask to pull a file down from my server:
NSURLSessionDownloadTask *getTheNoticeFromTheServer = [session downloadTaskWithRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:completeFilePath]]];
[getTheNoticeFromTheServer resume];
The error hits after I call resume. Again, this is only when run on the simulator in XCode 7. Works like a champ on the iOS9 device and on the XCode 6 simulator as well. Anyone else seen anything like this while using NSURLSession with XCode 7?
Thanks!
Scott
Well I thought XCode 7 Beta 3 fixed this, but it just changed the behavior. Now the app will run fine on the device by itself, or in the simulator. But the crash now happens when I run it on the device from within xcode...you know, like you would normally do during development and debugging. Awesome.
I have just installed Xcode 5, and I have an application that should be targeted only to iOS 6.0 and iOS 6.1 devices.
How can I stop supporting iOS 7.0 ??
That is not possible, you can stop supporting previous versions of iOS, but not the other way. You need to prepare your app to work on iOS7.
YOu don't need to redesign your app or anything, just open in with XCode 5 and get rid of all the warnings/small bugs.
As others have noted, you can't "not support iOS 7". However, you can delay upgrading to the iOS 7 SDK (at least, in the short term).
To do such, simply continue using Xcode 4 to build your app. When you're ready to submit it, simply do such using Xcode 4 like you normally would.
For the time being, Apple will most likely accept apps built using the iOS 6 SKD. (Imagine, for example, that you've spent several months or a year building your app... Apple will still let you submit it for the time being even using an older SDK).
Further, the app will run and appear correctly (in many/most cases) using iOS 6 UI components for the most part (in example, UIAlertView is an exception to this, which will use the iOS 7's UIAlertView look).
In the long term, however, you really should convert your app to use the latest SDK.
It's not possible to prevent the installation of your app to devices that meet minimum version requirements.
Of course, you're free to check in your app the iOS version and do something about that. For example, if your concern is really that the user user should download another, iOS 7-designed version of your app, you can inform her about this possibility:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
if ([self.window respondsToSelector:#selector(setTintColor:)]) // iOS 7
... // redirect user to better, tint-enabled version
return YES;
}
I have to make some changes in an existing app. That app was last update in June when iOS6.0 was not launched. I am wondering how the orientation works properly on the devices running with iOS6.0?? As that build contains deprecated methods of oreintation?
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
This method doesnt get called in iOS6.0 then how that app in app store is working fine in iOS6 devices? Additionally if i run this app from xcode using its code, then it doesnt support orientation for iOS6. Now my client is saying app on app store is working fine with orientation in all the devices and the new build is not supporting orientation. I know I can fix this issue by using new methods for orientation
-(BOOL)shouldAutoRotate
but just curious to know how older app is working fine on iOS6 devices using deprecated methods when those method are not even getting called in when i run it using xcode.
The older applications were compiled using iOS 5.x SDK, that's why they can run fine on iOS 6, the problem occurs when you compile non iOS 6 compliant code with iOS 6.x SDK.
My iPhone App works fine on iOS 5, but crashes after Splashscreen on iOS4. (using PhoneGap) (using HockeyApp.net).
I am new for ios development.
I have developed an ios app with deployment target 4.0.
It is perfectly installed and working on iPad 2 (os-5.1) and iPod touch ([4g] os-5.0.1).
It is installing on iPhone 4 (os-4.2.6) and iPod touch ([2g] os-4.2.1) but not working. It shows the splashscreen, but crashes after that.
I have addded my own log function in code and found that it is crashed before going inside didFinishLaunchingWithOptions function.
I am using HockeyApp.net to download the ipa file.
I am not getting what is the problem exactly, the following is my AppDelegate.m file.
AppDelegate.m : https://gist.github.com/4343470
The crash report:
Crash Report: https://gist.github.com/4343472
Please help me out this.
Thank you in advance.
The crash is because CDVCordovaView is a subclass of UIWebView, and UIWebView's scrollView property is only defined starting in iOS 5. Somewhere in your code you are trying to access the scrollView property, which causes the crash. Check if the CDVCordovaView object respondsToSelector:#selector(scrollView) before you access scrollView, to prevent the crash.