error: no known class method for selector 'isPedometerEventTrackingAvailable' - ios

I am using Diagnostic plugin to my IOS IONIC 2 app. i am getting an error when i do ionic build ios with production mode (--prod). Could anyone help me how to solve this issue?
Thanks in advance:)
error: no known class method for selector
'isPedometerEventTrackingAvailable'
return [CMPedometer respondsToSelector:#selector(isPedometerEventTrackingAvailable)] &&
[CMPedometer isPedometerEventTrackingAvailable];

Check github issue.
Also here.
Either update your Xcode version to 8.0 or above.
cordova.plugins.diagnostic#3.2.0 adds support for the new
UserNotifications framework added in iOS 10. To build using v3.2.0,
you will need to use XCode 8+ because there's no way to conditionally
include a framework using the tag in the plugin.xml.
Or downgrade your diagnostic plugin to 3.1

Related

"CreateTextureFromCVTextureCache" Error on Unity3d IOS build

So I have been working on an IOS app built-in unity3d. When I try and push the app to
my iPhone in Xcode I receive a "Use of undeclared identifier 'CreateTextureFromCVTextureCache' when
doing the build.
The full code snippet is in the link below:
https://drive.google.com/file/d/1ZDb0pbHCfI8zmroe9F34Pk_EIt2C585S/view?usp=sharing
I hope you can help.
'CreateTextureFromCVTextureCache' is deprecated in Metal API, use 'CreateBGRA32TextureFromCVTextureCache' instead.
After further investigation I noticed that the CreateTextureFromCVTextureCache class is deprecated for Metal graphics api. Hope This help others.

Ionic iOS build failing with phonegap-plugin-push

I have added the following package info in my package.json under cordovaPlugins array as the plugin documentation says.
{
"variables": {
"SENDER_ID": "XXXXXXX"
},
"locator": "phonegap-plugin-push"
}
However, the iOS build is failing and I'm unable to figure out what's wrong as I'm new to iOS app development. Here's the partial log that shows the error, which majorly says,
'UIRemoteNotificationType' is deprecated: first deprecated in iOS 8.0 - Use UIUserNotificationType for user notifications and registerForRemoteNotifications for receiving remote notifications instead
and more of similar logs talking about UIRemoteNotificationTypeNone, UIRemoteNotificationTypeBadge etcetera.
Can anyone help me out with this?
I played around a little and updated my ionic and cordova CLI's,
also updated ios-deploy library and re-installed iOS platform. Things are working now.
I think ios-deploy was out dated.

Was I supposed to get a warning [duplicate]

This question already has an answer here:
Why is the Xcode compiler not warning me about invalid methods for my Deployment Target?
(1 answer)
Closed 9 years ago.
In my code I use
[[self presentingViewController] dismissViewControllerAnimated:YES
completion:dismissBlock];
The thing is my deployment target is set to: 5.0.
While base SDK is 6.1.
Was I not supposed to get a warning by XCode? (because I think the above method got introduced in iOS6).
Unfortunately no, Xcode doesn't check if you use symbols that are not available in your deployment SDK.
It only checks your code against the base SDK.
But you can use some third-party software for this, like DeployMate.
That being said, as others pointed it out, dismissViewControllerAnimated:completion: is available since iOS 5, so your code is safe.
But it's always a good idea to check for unavailable or deprecated APIs in your app, using something like DeployMate.
EDIT
Here's an answer to your comment:
If you deployment target is 5.0 and your base SDK 6.0, using a symbol available in the 6.0 SDK on an iOS 5 device will crash the application.
But Xcode won't warn about this when compiling, hence the need of some third-party software.
Once you identified the problematic symbol, using respondsToSelector: is the way to go, as it's better than simple version checking.
This way, you can have conditional code that will run with both SDK versions:
if( [ someObject respondsToSelector: #selector( someIOS6Method ) ] )
{ /* iOS 6 code */ }
else
{ /* iOS 5 code */ }
Only do this if you have detected SDK issues. Don't do this for everything.
According to UIVIewController class reference, this method is available from iOS 5.0 and higher.
Availability
Available in iOS 5.0 and later.
It is not ok to warn you. It doesn't have this warnining included in the default bundle of the SDK.

ShareKit plugin not working - Cordova 1.9 & ShareKit 2.0 & ShareKit js plugin & Xcode 4.4

I have upgraded my Xcode 4.4, Phonegap to Cordova 1.9 and installed the Sharekit 2.0 and I cannot get ShareKit to work. Prior to upgrading, ShareKit v.021 worked properly -except the known issues with that old version
I installed ShareKit 2.0 as per the WIKI. I then updated the ShareKit plugin as per these directions
My ios app is completely html, css, and js. I call ShareKit via javascript with the following commands:
shareToFacebook(msg, url) and shareToTwitter(msg, url)
In the simulator, I get the following error and I have no idea how to fix it. I inherited this project and I am a newbie, so I am flying a little blind.
2012-09-21 16:38:29.744 mcs[3976:17603] Assertion failure in +[SHK sharersDictionary], /Users/Main/Documents/ShareKit/ShareKit/Classes/ShareKit/Core/SHK.m:528*
**2012-09-21 16:38:29.745 mcs[3976:17603] WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: ShareKit: You do not have properly set sharersPlistName***
I have the defaul SHKSharers.plist in my project with the 9 services still enabled though. I had only twitter and facebook and I got the same errors.
Any help would be greatly appreciated.
In your custom SHKConfigurator file add this:
- (NSString*)sharersPlistName {
return #"SHKSharers.plist";
}
SHKSharers.plist is default one comes with ShareKit. You can have one of your own. But make sure you return your plist name in sharersPlistName function.

How to get my iOS4.2 SDK developed code working with iOS3.1.3?

I am new to iPhone development. I started developing a project using iOS4.2 SDK. It works properly on both an iOS4.2 device and simulator. Later I realized that my app wasn't working on devices with iOS3.1.3. To solve this I updated the "Deployment Target" in my app's configuration file to "3.1.3".
The problem I am having is that I use UITapGestureRecognizer in some of my classes. On compiling my code using iOS 3.1.3 SDK I get the following errors:
error: 'UITapGestureRecognizer' undeclared (first use in this function)
error: 'tap' undeclared (first use in this function)
From what I have ready, this seems to be because iOS .1.3 does not support UITapGestureRecognizer, so to run this i made the following changes wherever I use UITapGestureRecognizer:
Class mailClass = (NSClassFromString(#"UITapGestureRecognizer"));
if(mailClass != nil)
{
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:#selector(findOutTheTagmap:)];
[imageView addGestureRecognizer:tap];
[tap release];
}
I also updated my Target configuration and set the UIKit Framework to "Weak". Additionally I have also made the following changes:
Base SDK: 3.1.3
Compiler Version: GCC4.2 (also tried with GCC4.0)
Mac OS X Deployment Target: Compiler Default (also tried with 10.4 and 10.6)
iOS Deployment Target: 3.1.3
Yet, when I try compiling my code, I am still shown the same errors. What is surprising is that a few days ago someone was helping me and this worked.
I have tried pretty much everything I have found in forums.
Does anyone have an idea on how I can proceed?
Thanks in advance!
Base SDK is the version of the SDK used to compile your application. You need to make sure it's set to a version that has all the features you're using. UIGestureRecognizer requires 3.2 or later, so you should set your Base SDK 3.2 or later. And actually, 3.2 was iPad only; if your app is for iPhone, you'll need to set Base SDK to 4.0 or later. 3.1.3 for the Deployment Target is correct. Check your code to make sure there aren't other classes you're using which aren't available in 3.1.3 (check the docs).
Matt Gallagher has a great article on this which I highly recommend, here. While you're there, read his whole blog, it's great. :)
Setting a different SDK as you've done can be useful for getting hard errors about what you can't use, but as you can see it's difficult to impossible (depending on the class) to work around.
Instead, you should always be building against the latest SDK. (In fact, newer versions of Xcode have a "latest" setting you should use.) Set iOS Deployment Target (IPHONEOS_DEPLOYMENT_TARGET) to your minimum version.

Resources