API key not valid Kudan (AR) xcode - ios

I'm a beginner to Unity and try to make a simple AR app (IOS). I followed some tutorials and faced a problem. I set the API key and BundleID in Unity correct and changed the "enable Bitcode" to NO. When I want to build & run the application I got the message:
Failed to code sign "Unity-iPhone"
"Fix Issue" the following message:
An App ID with Identifier 'eu.kudan.ar' is not available
When I change the Bundle Identifier to my own team and app name the 'obstacle' seems to be fixed. When the build is ready and the application starts (on the device) the following error occured:
Kudan.AR.KudanTracker:Start()
[ line 374]
(Filename: Line: 374)
2016-08-27 02:56:06.005 ar[633:164754] Error verifying license key for bundleID: eu.bart.CarAR error: (null)
2016-08-27 02:56:06.005 ar[633:164754] API key not valid
What am i doing wrong?
thanks!

You can maybe try with another key.
https://wiki.kudan.eu/Development_License_Keys
And it's normal if it doesn't work with own app name.

Related

iOS extension "Failed to find a valid app with bundleID" & "Error was encountered trying to find service extension"

We have an extension in our iOS project (Broadcast Upload Extension). The extension works well when doing local builds, however whenever we do a TestFlight build a distribute it we encounter following exception (found in device logs):
Error getting proxy for beta app with bundleID
com.foo.bar.screenshareextension: Error
Domain=ASDTestFlightFeedbackErrorDomain Code=5 "Failed to find a valid
app with bundleID com.foo.bar.screenshareextension"
UserInfo={NSDebugDescription=Failed to find a valid app with bundleID
com.foo.bar.screenshareextension}
one more error lists:
[com.foo.bar] Error was encountered trying to find service extension:
error=Error Domain=UNErrorDomain Code=1904 "Unknown application"
UserInfo={NSLocalizedDescription=Unknown application}
the bundle IDs are set correctly (meaning the container app has "com.foo.bar" bundle id while the extension has com.foo.bar.extensionname".
The extension is referenced through
var bundleUrl = NSBundle.MainBundle.GetUrlForResource("Foo.iOS.ScreenShareExtension", "appex", "PlugIns");
I can confirm actually that the extension appex file is physically in the archived file for distribution.
The only difference is that the min OS version is set differently in the container app & in the app extension. However when doing local builds this doesn't seem to matter.
What could be the reason for not being able to target the extension? (seems like it's missing?)
ps: we are using Xamarin.Forms
Not sure if this helps: I encountered a similar error today, the reason is that the default build target of the notification extension is 13.6(the latest OS), while my testing device is in 13.5. After I changed the build target, everything works fine.
I've got same error with native Swift code on iPhone 6 (12.4.8).
I'm still not sure what causes this bug, but for me it fixes only by changing device. On iPhone 8 (13.6) the absolutely same code works just fine, rebuilding for iPhone 6 and it's not even trying.

"Network Failure" (4/NSURLErrorDomain:-1202); "The certificate for this server is invalid

I have configured the iCloud storage in my Xamarin.iOS app, it works properly on simulator but, on physical device, it throws the following exception when accessing the database using the following code.
CKContainer.DefaultContainer.PrivateCloudDatabase;
Objective-C exception thrown. Name: CKException Reason: The
application is missing required entitlement
com.apple.developer.icloud-services Native stack trace: 0
CoreFoundation 0x00000001a921ead0
I have tried the following changes before posting here.
Set different HTTPClient implementation from project options.
Set NSAllowsArbitraryLoads to true from info.plist.
Tried both debug and release builds.
Tried with both development and distribution profile.
Reset the device and enable/disable automatic date time.

GCM : Configuring subspecs failed # CloudMessaging

I am trying to integrate Google Cloud Messaging in my iOS application. I have followed every instruction provided in this link.
I have also integrated Google sign-in and it works fine.
The problem is I am getting assertion failure in the below code.
NSError* configureError;
[[GGLContext sharedInstance] configureWithError:&configureError];
NSAssert(!configureError, #"Error configuring Google services: %#", configureError);
Which is used to configure subspecs for cloud messaging.
This code above is in didFinishLaunchingWithOptions method in AppDelegate.m file.
The error generated is:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Error configuring Google services: Error Domain=com.google.greenhouse Code=-104 "Unable to correctly configure subspec CloudMessaging" UserInfo={NSLocalizedDescription=Unable to correctly configure subspec CloudMessaging, NSLocalizedFailureReason=GCM Sender ID must not be nil or empty.
Now I don't understand the meaning of this error. Yes, it clearly states that sender ID must not be nil. But from where it gets null ID.
I have tested this in simulator. I don't know if that affects or not.
If I comment this code and run in real device I also get the registration token but I don't receive any notification from my server. Server side code is tested and works fine for android.
Finally I solved the problem. First of all thank you all for quick reply.
What I did is explained in the following steps.
Get GCMExample project. Which I downloaded from Github because pod try google does not list GCMExample project.
Generate GoogleServices-Info.plist file from here
Compare plist files of GCMExample and MyProject.
Here I got the difference in it. In My project GCM was disabled and there was no Sender ID in it. I don't know how the hell did that happened.
So I manually set the GCM service enabled and added sender ID of my app that I previously created.
That is how I solved my problem.
Check Below Link for certificate
cloud-messaging_ios_certs
Make sure you are following below steps correctly
Create your App ID with Push Notifications ON.
Create your SSL Certificate.
Download and run it in order to be added to the Provisioning Profile.
To make sure that your provisioning profile has this certificate go to Xcode -> Preferences -> Account -> Your Apple ID -> Your Team -> View Details -> Download All.

GooglePlus Login fail :The operation couldn’t be completed. (com.google.HTTPStatus error 400.)

I'm using Google Play Game Services Prime31 Unity Plugin for my Unity - IOS project. After I import Unity package and build for IOS, I'm not getting build error on Xcode. However, at runtime, when I try Google+ sign in I am getting this error:
"GooglePlus Login fail :The operation couldn’t be completed. (com.google.HTTPStatus error 400.)"
When i press sign in button, choice of google account screen is displayed but after i choose an account, it returns without signing in(following cancel-OK screen is not displayed) and gives the error that I've quoted.
At Unity I've used init method where I passed clientID(which is surely called before auth method) and I set Info.plist additions properly. When I press sign in button PlayGameServices.authenticate() is called. Should I add some other method or sth at Xcode? How can I solve the problem? Thanks in advance.
u test ur app in iOS 8?? I using another google play service plugin and also getting this error when running in iOS 8. But my app is work well in iOS 7.
Cause of issue :
Cause 1: May be bundle id of google console and your application is not matching .(application bundle id and google console bundle id should be same).
Solution : Steps
a: GoTo google console and login with your application google account .
for finding key :: open google console > select your project > API & Auth > Credential
b: change bundle id and regenerate key .
c: replace previous key with your new generated key .
[GMSServices provideAPIKey:#"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"];
Cause 2: May be key is not matching with you google console key .
Solution: Just replace your application key with google console key .
[GMSServices provideAPIKey:#"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"];
Note: Make sure your application bundle id and google console bundle id is same .

iOS Keychain SecItemAdd returns -25243

I'm working on updating an iPhone application with a minor change in its default configuration. It's been awhile since I've built it last, though, and so I've upgraded Xcode to 4.2 and included iOS 5 support in the latest builds.
When I go to test on the device, I get the following assertion error:
2011-11-02 20:57:18.869 RoseBandwidth[903:707] Tried to add item, got result: -25243
2011-11-02 20:57:18.870 RoseBandwidth[903:707] *** Assertion failure in -[KeychainItemWrapper writeToKeychain], /Users/tim/code/RoseBandwidth/Classes/KeychainItemWrapper.m:312
2011-11-02 20:57:18.872 RoseBandwidth[903:707] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Couldn't add the Keychain Item.'
I'm using the implementation of the KeychainItemWrapper class from Apple's GenericKeychain project. It's worth noting that this error only shows up on the device, not in the Simulator (and I'm aware of the access group restriction differences between platforms, but usually I thought that caused problems on the Simulator, not actual hardware).
Why would I be getting this error back? I've touched nothing relevant to the keychain-related parts of the app; it stores and retrieves data exactly like it used to.
Okay, I couldn't quite get your project to build, but from How to share keychain data between iOS applications I think you might want to check your entitlements file. At least in the github project you didn't have anything specified in the Keychain Access Groups.
For future searchers who happen to end up here, another possible cause of the -25243 error (which means No access control, BTW) is running on the simulator.
My best theory is the app's provisioning profile (or the signature thereof) is how the app knows what its bundle seed is. And the bundle seed needs to be part of the your keychain's access group name. But apps run on the simulator don't get signed, and so have a missing (or different?) bundle seed than you specified keychain-access-group.
Or something. It's all so poorly documented, it's hard to tell what's what. Just try running it on a device and see if that helps.
For those of you getting this error and trying to achieve "Shared Key Chain Access" between two apps:
You need to create an App Id for your app with same Team Id you selected when you first activated "Shared Keychain Access" in 'Capabilities'. Create your App Id in here:
Apple Member Center
After that you need to create provisioning profile from that App Id and download it to your computer.(Double click it to install to x-code)
I assume you already know you need "App ID Prefix" to access key chain, but for those who don't know:
"App ID Prefix" is unique text identifier associated with your Apple developer account:
To access "SharedKeychain" you need to implement it like this before you try to write or read from keychain
keychainAccessGroupName = "AB123CDE45.myKeyChainGroup":
You can check out this tutorial for further info:Share Keychain between iOS apps.
Hope that helps.
I get the same error from time to time in the simulator even if I did not touch the code. A reset of the simulator solves the problem for me.
See this question/answer how to reset the simulator: https://stackoverflow.com/a/3442326
As others have pointed out, in device builds error -25243 is often caused by trying to access a keychain access group that you don't have permissions for. (It's missing from your Entitlements.plist file or your provisioning profile.)
But in the simulator there can be another cause. The simulator doesn't support keychain access groups at all, so if you set the kSecAttrAccessGroup property on a keychain item and try to write it you'll get this -25243 error code.
FYI, Apple's GenericKeychain sample code has this comment:
// Ignore the access group if running on the iPhone simulator.
//
// Apps that are built for the simulator aren't signed, so there's no keychain access group
// for the simulator to check. This means that all apps can see all keychain items when run
// on the simulator.
//
// If a SecItem contains an access group attribute, SecItemAdd and SecItemUpdate on the
// simulator will return -25243 (errSecNoAccessForItem).
This worked for me when I used a production certificate and provisioning profile. Using debug did not work.
In my experience, I get that return value -25243 when I realized that I was trying to pass kSecMatchLimit with kSecMatchLimitOne and kSecReturnData with kCFBooleanTrue values to the SecItemAdd() function. I removed those and double checked the app ids and provisioning profiles and everything is good.
I am not sure if this is helpful or not, but in my experience if you will use SecItemAdd() function for shared keychain access, those two parameters must not be there.

Resources