CoreMidi _MIDINetworkNotificationContactsDidChange symbol not found - ipad

I'm getting the following error after a crash in an iPad app that uses CoreMIDI (The * are to blank out the app name):
Dyld Error Message:
Symbol not found: _MIDINetworkNotificationContactsDidChange
Referenced from:
/var/mobile/Applications/8F08B78E-929D-4C5A-9F02-08FD5743C17F/***.app/***
Expected in: /System/Library/Frameworks/CoreMIDI.framework/CoreMIDI
in /var/mobile/Applications/8F08B78E-929D-4C5A-9F02-08FD5743C17F/***.app/***
Dyld Version: 179.4
When the app launches, I listen for MIDI Network Sessions using
[[NSNotificationCenter defaultCenter] addObserver:self selector:#selector(sessionDidChange:) name:MIDINetworkNotificationSessionDidChange object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:#selector(sessionDidChange:) name:MIDINetworkNotificationContactsDidChange object:nil];
Which seems to be what is causing the crash. This is after I call
session = [MIDINetworkSession defaultSession];
session.enabled = YES;
session.connectionPolicy = MIDINetworkConnectionPolicy_Anyone;
MIDIClientCreate(CFSTR("MidiManager"), midiNotifyProc, (void*)self, &midiClientRef);
This kind of looks like CoreMIDI library has not been included in the build. Problem is, it IS included in the build as a required framework. (And the deployment target is set to 4.2). I can run the build fine on my iPad and have been testing extensively with other users' iPads also with no problems whatsoever. Also, this is an update to an existing app that has had several updates already with no problems.
I just double checked my deployment build and the framework is definitely included, and I just installed that build onto my iPad (with a different provisioning profile from the store) and it works fine also.
What could be happening? Could it be that Xcode just did a bad build for the one I sent to Apple, or am I missing something obvious? Could I change the MIDINetworkNotificationSessionDidChange notification symbol to a literal string (#"MIDINetworkNotificationSessionDidChange") to fix things for the mean time?
Thanks for any help!

Seems like this was an Apple thing. The .mm of PGMidi's workhorse class includes this at the top:
// For some reason, this is not pulled in by the umbrella header
#import <CoreMIDI/MIDINetworkSession.h>
https://github.com/petegoodliffe/PGMidi

Did you remember to set the minimum OS requirements to 4.2 in your Info.plist? It could be that the crash reports are coming from users on an earlier version of iOS who are upgrading when they shouldn't be.

Related

"[Crashlytics:Crash] Reporting is disabled"

I am getting the following error messages when our production iOS app initializes:
[Crashlytics] Version 3.8.4 (121)
[Crashlytics] Running on iOS Simulator (iPhone), 10.3.0 (16E195)
[Crashlytics:Crash] Reporting is disabled
[Crashlytics] Crash reporting could not be initialized
[Answers] Initialized
[Fabric] Initialized with kit versions: {
"com.twitter.answers.ios" = "1.3.4";
"com.twitter.crashlytics.ios" = "3.8.4";
"io.fabric.sdk.ios" = "1.6.11";
}
Every subsequent call to log an event gets the following error:
[Crashlytics:Crash] WARNING: CLSLog has been used before (or concurrently with)
Crashlytics initialization and cannot be recorded. The message was: ...
The non-production versions of the app work fine running the exact same code but with different bundleIDs. Normally when the app initializes for the first time, then I see the app populate in the Fabric dashboard, but in this case the app is not showing up.
We have an Android and an iOS version of the app, and they both use the same bundleID, so I am wondering if there is a conflict because of that? I see the Android version of the app in the dashboard, and it seems to be working properly. This is an app that originally was a Xamarin app that compiled to both platforms, neither of which incorporated Fabric/Crashlytics. We have now written native apps on each platform, and both are using Fabric/Crashlytics.
Since this is a pre-existing app in both stores, we do not have the option of changing either app’s bundleID.
Make sure you initialize Crashlytics with Fabric before calling any Crashlytics methods:
Fabric.with([Crashlytics.self])
One step I routinely miss is to make sure you've added the build phase on your target:
"${PODS_ROOT}/Fabric/run" ${FABRIC_API_KEY} ${FABRIC_BUILD_SECRET}
and either replace ${FABRIC_API_KEY} and ${FABRIC_BUILD_SECRET} with your key and secret or add custom build settings for each.
There are apparently cases where Crashlytics does not auto-activate new apps so that they show up under your list of apps, even though everything is coded correctly and data is going to their servers. In this case, send an email to Crashlytics support (support#fabric.io) that contains a copy of the info.plist entries for the app in question and they will activate it for you. I have had to do this several times, especially with app extensions.
When I finally traced it down in my situation, the error was entirely correct, but not obvious.
I saw these errors in various testing targets where the code we tested was using a custom logging wrapper which called CLSNSLogv(), but the test didn't actually go through the AppDelegate and therefore did NOT initialize Crashlytics. After trying a few things I was convinced that it worked when executed as an app, but in our configuration it was not working under the unit test configuration.
I'll likely alter our custom wrapper to bypass CLSNSLogv() during testing anyway. The biggest benefit of using that is when crashes occur on devices, so we won't be missing anything.

SDWebImage on iOS 8.1 weird compile error

When I try to run project on real device (iPhone 5 and 5S with iOS 8.1) I get following compiler errors:
// ARC Semantic Issue - myPath/SDWebImage/UIImage+GIF.m:26:42: No visible #interface for 'UIImage' declares the selector 'initWithData:'
animatedImage = [[UIImage alloc] initWithData:data];
// ARC Semantic Issue - myPath/SDWebImage/UIImage+GIF.m:47:34: No known class method for selector 'animatedImageWithImages:duration:'
animatedImage = [UIImage animatedImageWithImages:images duration:duration];
// ARC Semantic Issue - myPath/SDWebImage/UIImage+GIF.m:155:21: No known class method for selector 'animatedImageWithImages:duration:'
return [UIImage animatedImageWithImages:scaledImages duration:self.duration];
My project was working normally until this morning. I changed nothing, just tried to debug on real device. The strangest part of that is I can run/debug on emulator (on any iPhone device with iOS 8) without any error.
When I downgrade deployment target from 8.1 to 8, XCode can successfully build and run the project for emulator and real device.
I tried completely removing SDWebImage and adding it back but didn't solve the problem.
I am using XCode 6.1 (Swift) and iOS 8.1 SDK on my project.
What might be causing the problem that suddenly appeared?
As has been said on other questions, the new "ModuleCache" directory within DerivedData has been responsible for many of these problems.
Here's the path:
/Users/[user]/Library/Developer/Xcode/DerivedData/ModuleCache
Simply delete the module cache, or the entire derived data directory as many have been doing on a daily basis for the last few iOS SDK iterations.
I came here looking for a different answer to a similar problem since this solution isn't fixing my current problem, but I figured I would share this as it will fix many of these.

Cordova how to remove "Push notification" on iOS

I submitted my application using Apache Cordova to Apple Store and I got a warning from apple that "Missing Push Notification Entitlement".
But it seems that I've never used "Push Notification" in my application. How can I remove it from my application? Is it default in Apache Cordova?
HOW TO DO THIS FOR CORDOVA APPS 'PROPERLY':
I also had this problem. The solution proposed by #michaelb worked but I was frustrated enough seeing that the whole thing was wrapped in conditional compilation (ie #ifndef DISABLE_PUSH_NOTIFICATIONS) that I decided to learn how to add a 'Preprocessor Macro', which basically tells XCode to compile you app with this bit of code left out.
This is how the you can define the DISABLE_PUSH_NOTIFICATIONS precompilation symbol graphically via the UI (note that this the way its done in XCode 6.1):
Hope this helps other people out there in same situation.
In AppDelegate.m remove didRegisterForRemoteNotificationsWithDeviceToken and didFailToRegisterForRemoteNotificationsWithError. Working on PhoneGap 3.5
Following the advise above and in other places, this is what I did in Cordova 5.0.0
As result the warning disappeared and I haven't noticed any problem with the App.
Open platforms/ios/InfoganGardenAdmin/Classes/AppDelegate.m
Comment out line 116 to 137
example:
/* - Removed to disable push notification and Apple warning message
#ifndef DISABLE_PUSH_NOTIFICATIONS
- (void) application:(UIApplication*)application
didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
{
// re-post ( broadcast )
NSString* token = [[[[deviceToken description]
stringByReplacingOccurrencesOfString:#"<" withString:#""]
stringByReplacingOccurrencesOfString:#">" withString:#""]
stringByReplacingOccurrencesOfString:#" " withString:#""];
[[NSNotificationCenter defaultCenter] postNotificationName:CDVRemoteNotification object:token];
}
- (void) application:(UIApplication*)application
didFailToRegisterForRemoteNotificationsWithError:(NSError*)error
{
// re-post ( broadcast )
[[NSNotificationCenter defaultCenter] postNotificationName:CDVRemoteNotificationError object:error];
}
#endif
*/
It is most likely an issue with the version you are using, PhoneGap 3.5 has that same issue (PhoneGap is built on Cordova), you can view the discussion thread here
The current solution seems to be "use an older version"
The email is pretty vague and can be taken multiple ways plus if you are a new developer you may not have known about the wait time for Apple Store app reviews. See AppReviewTimes.
To Clarify: Its just a warning and you can ignore it if you don't use push notifications.
Don't try to fix what ain't broke. Plus all the solutions I could find didn't work.

Widevine can only run on ARMv7

When i am trying to run a video with embedded ID in the OOyala player, i am getting like "Widevine can only run on ARMv7".
NSLog(#"video id= %# ",videoID);
self.ooyalaPlayerViewController = [[OOOoyalaPlayerViewController alloc] initWithPcode:PCODE domain:PLAYERDOMAIN];
// Attach it to current view
[self addChildViewController:_ooyalaPlayerViewController];
[self.ooyalaPlayerViewController.view setFrame:self.videoPlayerView.bounds];
[self addChildViewController:self.ooyalaPlayerViewController];
[self.videoPlayerView addSubview:self.ooyalaPlayerViewController.view];
// Load the video
[self.ooyalaPlayerViewController.player setEmbedCode:videoID];
// Add observers
[self addObserversForOoyalaVideoplayer];
[self addCloseButton];
[self.ooyalaPlayerViewController.player play];
I added that line a while back when I still worked at Ooyala.
Basically, the Widevine playback library for iOS is only distributed in compiled ARM binaries. The simulator runs natively on x86, so it can't load the library (I believe is purposeful, as it makes the DRM code slightly harder to reverse engineer), and we issue a warning.
Try playing it back on an actual device and everything should work fine.
In our case, we were testing on the iPhone 5S, which can't really be ignored.
As it turns out, the issue was that we left the project files configurations as they are, which added arm64 support to the build, and that broke the player. All we had to do was override the architecture configuration in all the project files and build.
Set valid and build architectures in the build settings to armv7 and try to run the application it will work.

Cocos2d-iphone - Sphero Integration

I'm trying to connect a Sphero to a Cocos2d game I'm building. Sphero has some good documentation and examples, and I can run the sample code. I started with a cocos2d project and added the Sphero frameworks. I am not able to get a basic command to the ball. I believe the issue is in this function:
-(void)setupRobotConnection
{
/*Try to connect to the robot*/
[[NSNotificationCenter defaultCenter] addObserver:self selector:#selector(handleRobotOnline) name:RKDeviceConnectionOnlineNotification object:nil];
if ([[RKRobotProvider sharedRobotProvider] isRobotUnderControl])
[[RKRobotProvider sharedRobotProvider] openRobotConnection];
}
(The rest of the code is at the link) I believe that it has something to do with the NSNotificationCenter. I am calling this code from a CCLayerColor, rather than a UIViewController like the demo does. I get this error:
2012-08-25 01:54:19.738 bgmmo[1414:2d07] ERROR - opening session failed as protocol com.orbotix.robotprotocol is not declared in Info.plist
(This was answered in the Sphero IOS Forum)
You need to add the external accessory protocol string to your Info.plist. Edit the Info.plist for you application target and add a entry for key "Supported external accessory protocols" which will create an array enter. Add "com.orbotix.robotprotocol" as a String item in the array.

Resources