your app loads indefinitely upon launch - ios

I have an app which works fine on below devices.
iPhone 4s (iOS 7.1)
iPhone 5 (iOS 9.1)
iPhone 6 (iOS 9.1)
However app is rejecting saying below rejection.
We discovered one or more bugs in your app when reviewed on iPad and iPhone running iOS 9.1 on both Wi-Fi and cellular networks.
App did not load its contents, did not load beyond the flash screen.
However when I run this from my side, its working fine but it has problem at Apple end only. I don't know how can app run at my end and its giving problem at Apple end only? I tried to upload with iOS 8.4, but still Apple reply still we can't go beyond splash screen.
Did anyone face such issue OR does anyone point me where I can be wrong?
I have uploaded 6 builds and all are rejected saying same reason.
Note: Same app was working fine earlier (before iOS 9.1 release), but when I try to upload now, it is giving this error.
The biggest challenge for me is, I don't know what is the problem, but I need to FIX this problem
Edit 1
I have first screen as language screen where I have animation of images.
animationImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 1080, 1920)];
animationImageView.hidden = NO;
animationImageView.animationImages = mArray;
animationImageView.animationDuration = 1.5;
animationImageView.animationRepeatCount = 1;
[self.view addSubview:animationImageView];
[animationImageView startAnimating];

After testing on testflight, I found a problem.
If I open the app after clicking app icon, it was working fine.
The problem comes when I click Open button from testflight
When I click Open button, launchOptions in AppDelegate was not nil, so the code in push was going wrong and internally it was crashing but still app was hanged at splash screen (not sure why though)
Below is what I have when I print launchOptions in AppDelegate didFinishLaunchingWithOptions
launchOptions==={
UIApplicationLaunchOptionsSourceApplicationKey = "com.apple.TestFlight";
}
So I changed my code to below and all is working perfectly.
NSLog(#"launchOptions===%#", launchOptions);
if (launchOptions!=nil) {
NSMutableDictionary *userInfo = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
NSLog(#"userInfo===%#", userInfo);
NSLog(#"userInfo===%d", userInfo.count);
if (userInfo.count>=1) {
// here is my code on what to do if i click on push
}
}
Do let me know if someone is not clear
It was crashing saying below
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSPlaceholderString initWithString:]: nil argument'
So I feel problem was at line below.
NSString *badge =[[NSString alloc] initWithFormat:#"%#", [apsInfo objectForKey:#"badge"]];
But after putting above condition, all was working fine.

Did you test using "Run" from Xcode, or using Test Flight? Test Flight gets you the app in the same environment as Apple gets it, while running directly from Xcode may yield different results (different push notification environment, possibly different compilation options...).
Also, do you have access to the logs of the server that the app queries? If so, have you checked them to see what happens when Apple try to use the app? Is the query correctly formed? Was there an error (status code different from 200, or in the error log)?
What kind of request does your app perform? Is it a regular http(s) request? Or are you using an unusual protocol which may be blocked somehow?
I suppose the server queried is fully reachable from the Internet (i.e. you did not put a server that is only accessible on your local network)?
You should add error handling in your code, to test the result of requests and display information about it, so that if there's an error when they test it, at least they can report what the error is.

Related

App is crashing when opening through TestFlight (Swift, iOS)

I have a problem, when I test my iOS App on a real device or when I testing it in the simulator all is working as expected, but when I submit the app to TestFlight and I want to open it on my device the app is instantly crashing on launch. My last changes on the app was that I added the option that the user can pick another App Icon, nothing else. But now the app is crashing in TestFlight. Anybody has an idea what I can do?
Sometimes I get this error:
<NSError: 0x28227d6e0; domain: BSServiceConnectionErrorDomain; code: 3 (OperationFailed); reason: "XPC error received on message reply handler">;and thisMultiple RBSRunningReasonAttribute provided: 13 vs 20254. First one wins, but client should be fixed for assertion 31-112-6223`
I already tried to changes Scheme to Release but nothing changes still works on the simulator and the real device.

EXC_BAD_ACCESS at lauch for EAGLContext renderbufferStorage: fromDrawable: in Cocos2d app whie debugging

Using default cocos2d-swift app I'm receiving the error EXC_BAD_ACCESS on my iPad Mini 2 at the line:
BOOL rb_status = [_context renderbufferStorage:GL_RENDERBUFFER fromDrawable:layer];
But if I try to launch the app without debug all works fine. If I use debug on any virtual device I receive no error too.
Why it doesn't work? How to remove this error?
Looks like this is an issue on certain devices on iOS 8.3+. It works for me on almost all devices but the iPad mini 2 fails for me as well. The short of it is that there's nothing wrong with the call itself. Seems to be an Xcode bug with those devices for some reason. You can get around it (until Apple fixes it) by:
In Xcode, go to Product -> Scheme -> Edit Scheme ...
And for the Run Debug configuration (on left side) choose "Options" (on right side) and configure "GPU Frame Capture" as Disabled.
For more information, check out this thread:
https://github.com/BradLarson/GPUImage/issues/2022#issuecomment-118943746
I found the device hadn't got the last iOS version. When I updated the iOS version of the devices the error has removed.

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.

App crashes before debugger can connect

I've got an app that crashes even before the debugger can connect.
I placed a break point on the first line of main(). (I added an NSLog statement as very first statement in main() and set the break point there.
The app seems to start. The main screen with some ui elements becomes visible on the screen. Then it disappears.
There is no crash log found on the devices.
Xcode message:
Could not launch "appname"
process launch failed: failed to get the task for process xyz
Debugging is enabled of course.
The same for the profiler Instruments.
Code signing works fine so that the app can be deployed to the devices.
(Same for enterprise distribution. And the app validates for store submission.)
It does work on the simulator though.
The app used to work fine. I was just about to build it for the store. For final tests on iOS 8.1 I upgraded to Xcode 6.1 with SDK 8.1. But the problem did not occur directly after the upgrade. It worked just fine.
Then it crashed when building for release for enterprise distribution.
The AppStore build crashed in the same manner (according to Apple, the app was rejected of course.)
But it ran nicely in debug modes.
Now I was trying whether compiler options for optimization may make all the difference and I was trying to build in release mode with debugging enabled etc and end up with a debug build crashing as well. (No optimization in debug).
So it may well be that the migration to Xcode 6.1 did cause it but the problem may have come effective only after Xcode cleaned and rebuild the project in response to changes to compiler settings for code optimization.
Sorry for the long text. I tried to put everything in that may be of importance.
Reason is most likely some incompatibility of Crackify and iOS 8.1.
Therefore it may be of interest for others, altough my problem along with these symptoms may be very special.
Very early within AppDelegate didFinishLaunchingWithOptions we have had the following statement.
if ([Crackify isCracked] || [self isCertificateUnvalid])
exit(173);
That, as such, is not really well designed. The app is just terminated rather than any error message displayed to the user. Thus, it appears as if the app has crashed. But it has not crashed and therefore no crashlog is provided.
For reasons which I don't yet understand and which may not be related to this error, my debugger did not manage to hook up into the executed app. Once that was overcome (suddenly the debugger worked without any changes made to any of the debugging related settings) the error was found rather quickly.
This is Crackify: https://github.com/itruf/crackify
Within Crackify it was this code sniplet that caused the problem:
static NSString *str2 = #"ResourceRules.plist";
BOOL fileExists3 = [manager fileExistsAtPath:([NSString stringWithFormat:#"%#/%#", bundlePath, str2])];
if (!fileExists3) {
return YES;
}
For reasons that I did not further investigate, the file, that is tested here, apparently does not exist in iOS 8.1 any more.

Xcode 6 fails to detect device in simulator

I recently upgraded to Xcode 6 and I'm starting to get strange crashes when loading viewcontrollers in AppDelegate.
I found for example that this line of code:
BOOL isIphone = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone;
...didn't always return YES when I was running the app on simulator for iPhone5! Therefore the app tried to load an iPad nib with a crash as result.
Now I only do my testing on the actual device. But can someone please tell me how xcode/simulator can make such a misstake? And how you can protect yourself from it.
Up to the last beta of Xcode6, I was having very odd issues with the simulator. In my case, anything network related would refuse to work after a while, perhaps after computer has gone to sleep and was subsequently woken up. One thing that worked was to restart the simulator (surprise surprise!). Give it a go.

Resources