MPMediaLibrary.requestAuthorization not responding on Xcode 10.2 simulator - ios

I just noticed that after having updated Xcode to version 10.2.1, I'm unable to see the permission request for Library and Apple Music when launching a couple of projects of mine on the simulator.
Debugging, I realised that the authorization request call goes unanswered
MPMediaLibrary.requestAuthorization { status in
// switch on status and handle it - never gets there
}
I didn't change anything in the code or configuration of my projects, and I'm very sure that this wasn't happening with previous versions of Xcode.
Just for the record, everything works fine on a real device.
Does anybody have any idea?
Am I the only one who's experiencing this?

Looks like it doesn't work on the simulator. It now just hangs, and the closure is never executed.
It did, at one time, but I guess that it no longer does.
Sort of unsurprising, as the basic media capabilities aren't really supported on the simulator anyway.
I have tested my code on device, and verified that it works, but it is annoying (not a showstopper) that it doesn't work on the simulator.

Related

Inconsistent CallDirectoryExtension behavior on iOS 14.5

After upgrading to iOS 14.5 I've noticed a strange behavior in my implementation of CXCallDirectoryProvider. I call a CXCallDirectoryManager.sharedInstance.getEnabledStatusForExtension(withIdentifier: identifier) when the app starts in sceneWillEnterForeground. On a new iOS version first call to CXCallDirectoryManager.sharedInstance.getEnabledStatusForExtension(withIdentifier: identifier) after the app has started consistently results in a long wait and a subsequent error com.apple.CallKit.error.calldirectorymanager Code=1 "(null)". All subsequent requests to the same method, however, execute normally, as they should.
This errorneous behavior is consistent on a new iOS 14.5 version. I've tried multiple iPhones. I'm sure that the extension identifier is valid because subsequent requests do execute normally and issues do not reproduce on any previous versions. Did someone stumble upon a similar issue?

UITesting Failure - failed to get attributes within 5s: { 3003 }

Recently I have permanent error while perform UI testing. Why it happens? What may be the reason?
IMPORTANT INFORMATIONS:
I reset the app, XCode, and even macbook. It doesn't help.
Running tests on a real device, problem doesn't exist on simulator.
it was very fine so far, it stopped working immediately...
What are attributes to get? How can I workaround this?
Simply restart your device. It will work then.

CKQueryOperation iOS 9 only work plugged in

I am using CloudKit in my iOS 9 app and I have a CKQueryOperation that work fine and performs as expected when plugged into the Mac. As soon as the query is run when it is not plugged in to the Mac, it does not finish. There is no error message, the activity indicator I added never stops and the results are never displayed.
If I start the operation when unplugged, then plug it in it completes too.
The code was copied and adapted from an app built in Xcode 6.4 and works as expected in that app.
Any ideas why this could be happening? Could it be anything to do with app thinning in iOS 9?
Thank you
ANSWER
Adding this fixed the issue:
queryOperation.qualityOfService = NSQualityOfService.UserInitiated
The default QoS changed in iOS 9. If the query operation is user initiated, then it needs to be marked as such.
See CKOperation.h and the QualityOfService property.

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.

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.

Resources