iOS: Crashlytics Crashing on Init - ios

In my AppDelegate, I call
[Fabric with:#[CrashlyticsKit]];
and everything works fine. Now I pulled my code onto another machine, and the same line gives me the following error:
*** Terminating app due to uncaught exception 'FabricException', reason: '[Fabric] Value of Info.plist key "Fabric" must be a NSDictionary.'
I'm not aware of any additions in my project's plist. Any ideas what this error may be referring to and how to fix it?

Fabric automatically inserts of hunk of text into your application's plist when you install it. These are essential and Fabric throws an exception on initialisation if they're not present.
Unfortunately it doesn't actually tell you it does this, so we ran into this crash on a project where the plist was automatically generated by a tool - which overwrote what Fabric had added.
For reference, this is what the Fabric part of the plist looks like in the current version (not sure where the version number is, but the latest version as of 15th June 2015).
<key>Fabric</key>
<dict>
<key>APIKey</key>
<string>your-api-key</string>
<key>Kits</key>
<array>
<dict>
<key>KitInfo</key>
<dict/>
<key>KitName</key>
<string>Crashlytics</string>
</dict>
</array>
</dict>

One more way to solve this Using Fabric App.
Launch Fabric app and log in with your user ID.
Click on Add New App
Select your .xcodeproj file and follow on screen instruction
Do not manually add Fabric key in your .info plist file

The solution required us to update Crashlytics. The other targets that we had set up had the latest version and those were working fine, but the latest update (3.0.9 at the time of this post) seems to fix the issue.

It just happened to me and this is how I solved it (thanks for the leads to everyone.)
Context: When you have more than one different target in your Xcode project, by creating a New App in the Mac Fabric app is, apparently, not enough.
Solution: If you select the same project (to make it for your Pro version for instance) Fabric app does not touch the Pro´s .plist properly.
So just copy the Fabric dictionary entry of your non-pro version of .plist and paste it into your Pro´s version.
API key goes on Organisation level, so this is the right way to do it.

just change the Fabric key type from String to Dictionary. go to your-project-info.plist>Fabric>kits>item0>KitName and change type to Dictionary. problem resolved for me

May be this will look weird but the same problem happened to me and this is how i solved the problem. I have a project with multiple target and schemes, i have also two additional targets for unit tests and UI Tests. The solution was to uncheck these tests targets from "Analyse", "Run", "Profile" and "Archive" tabs under Manage Schemes > Edit > Build. See the image Below :

my two cents:
in my all I add for mistake to plist of "myAppTests" and not to "myApp" plist.
So as also Eugene noted, be careful to add in EVERY .plist.

For me the reason was:
While you are creating a new target - a new Info.plist files is created automatically.
Thus you need to put the Fabric property to all Info.plist files.
<key>Fabric</key>
<dict>
<key>APIKey</key>
<string>43336ce109856f4452829a8e6b6783886fefb</string>
<key>Kits</key>
<array>
<dict>
<key>KitInfo</key>
<dict/>
<key>KitName</key>
<string>Crashlytics</string>
</dict>
</array>
</dict>
At first I've missed that, and put this code only to the first one - initial Info.plist file.

Related

SceneConfiguration Info.plist contained no UIScene configuration dictionary (looking for configuration named "(no name)")

I'm getting this error when trying to run flutter app to IOS devices, this error occurs when launching the application on the device for the first time.
Assuming you don't actually use scenes, this warning can appear for a few reasons. Most common I've noticed is using a LaunchScreen.storyboard sort of thing, they contain scene data. If indeed you don't use scenes. You can get rid of this by being explicit in your Info.plist. Add the following;
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict/>
</dict>
If you are managing your Info.plist with Targets > Info > Custom iOS Target Properties you would set Application Scene Manifest like the picture

Can't upload files on iCloud drive [duplicate]

I'm developing an iCloud-enabled app where users will be able to import and export files via iCloud Drive. When browsing iCloud Drive, either using the UIDocumentPickerViewController (iOS 8) or the Finder (OS X Yosemite), I can see directories created/owned by other iCloud-Drive-enabled apps, such as, Automator, Keynote, or TextEdit.
I want our app to expose its ubiquitous documents directory in iCloud Drive, too, but haven't been able to figure it out yet. Within some of the aforementioned apps' Info.plist files, I've discovered this key:
<key>NSUbiquitousContainers</key>
<dict>
<key>com.apple.TextEdit</key>
<dict>
<key>NSUbiquitousContainerIsDocumentScopePublic</key>
<true/>
<key>NSUbiquitousContainerSupportedFolderLevels</key>
<string>Any</string>
</dict>
</dict>
These keys are also documented here, but I haven't found any other documentation on the broader subject. Edit/Note: Although it does not contain the answer to my questions, the Document Picker Programming Guide is a helpful resource.
I've tried adding the above-mentioned keys/values to our app but didn't see any effect. Things I've noticed/tried:
For 3rd party apps, iCloud containers are constructed this way: iCloud.$(CFBundleIdentifier). I'm not sure why TextEdit only uses the pure bundle identifier, but for our identifier, I've tried both approaches, i.e., with and without the iCloud. prefix. I've also recognised that you need to hard-code the bundle identifier (i.e., don't use iCloud.$(CFBundleIdentifier)) as only the PLIST's values seem to be resolved at build time, but not the keys.
I've added a sub-directory programmatically (to <containerPath>/Documents) so the container is not empty. However, this shouldn't matter as all the other apps' directories were initially empty, too.
Some Apple apps that appear in iCloud Drive do not have these entries in their Info.plist, e.g., Numbers and Pages.
iCloud is set up correctly and I can programmatically look into the ubiquity container using the URL returned by [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil];.
I am logged into an iCloud account where iCloud Drive is enabled. I can see my iCloud Drive content in the UIDocumentPickerViewController.
I use the iOS 8 beta 5 simulator (and Yosemite beta 5 to view the iCloud Drive directory on the Mac) (Edit/Note: This equally applies to beta 6)
This is how my Entitlements file looks like (relevant parts only)
<key>com.apple.developer.icloud-container-identifiers</key>
<array>
<string>iCloud.$(CFBundleIdentifier)</string>
</array>
<key>com.apple.developer.icloud-services</key>
<array>
<string>CloudDocuments</string>
</array>
<key>com.apple.developer.ubiquity-container-identifiers</key>
<array/>
I've set this up using Xcode's UI in the Capabilities section. I don't get why the last key doesn't have an entry, but adding <string>iCloud.$(CFBundleIdentifier)</string> doesn't help. Instead, it makes Xcode complain in the Capabilities UI, so I've removed it. Edit/Note: In Xcode beta 6, this has been fixed, i.e., the ubiquity container identifier needs to be set and Xcode can fix that for you.
Original Questions: So... is it a bug? Does it not work yet? Am I doing it wrong? I couldn't find a known issue in the release notes.
Edit:
Two more things that I've tried:
Adding the (optional) NSUbiquitousContainerName key (+ value) to the container-specific dictionary, as suggested by Erikmitk.
Adding only the NSUbiquitousContainerIsDocumentScopePublic key/value to the PLIST root dictionary rather than the container-specific dictionary, as it's done in one of the WWDC sample apps (look for NewBox).
I was experiencing a similar problem with my application. I was able to make this work by doing the following:
Add the NSUbiquitousContainers setting to my Info.plist file according to documentation here https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/ExtensibilityPG/FileProvider.html. Here is the relevant code:
<dict>
<!-- ... other top-level Info.plist settings ... -->
<key>NSUbiquitousContainers</key>
<dict>
<key>iCloud.com.example.MyApp</key>
<dict>
<key>NSUbiquitousContainerIsDocumentScopePublic</key>
<true/>
<key>NSUbiquitousContainerSupportedFolderLevels</key>
<string>Any</string>
<key>NSUbiquitousContainerName</key>
<string>MyApp</string>
</dict>
</dict>
</dict>
Important! I then changed the above NSUbiquitousContainerSupportedFolderLevels string value from Any to One
<key>NSUbiquitousContainerSupportedFolderLevels</key>
<string>One</string>
Next, and last, I had to change CFBundleVersion to a higher version. I also bumped the CFBundleShortVersionString to a new version as well.
Built and ran and after that, the folder with my applications icon appeared properly in iCloud Drive! Hope this helps!
When you edited the Info.plist, maybe you forgot to bump up the bundle version number? This is a requirement as per WWDC session #234.
The catch is to call [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil]; (or with another container identifier if it's not the default one) at least once (not per launch, but presumably per version, or when changing one of the respective PLIST entries) in order to initialize the directory. I reckon this step needs to be combined with an increase of the bundle version number, as suggested in roop's answer.
I notice my question may have been confusing in that respect, as I mentioned being able to look into the documents directory* programmatically using the API in question. However, I removed that code from the app later, maybe before getting the rest of the setup right. I'm not going to write into the documents directory directly, only through the Document Picker. Therefore, there hasn't been any need to get the URL.
If you just need a Document Picker to read/store files from/in iCloud Drive or other apps' document directories, there's no need to call URLForUbiquityContainerIdentifier:. Only if you want your app to have its own ubiquity container (and potentially expose it in iCloud Drive and the Document Picker), the steps mentioned in the original post and the call to URLForUbiquityContainerIdentifier: are necessary.
*When mentioning the documents directory, I'm always referring to the one in the ubiquity container, not the local one.
It seems, changing the CFBundleVersion will let it work.
I think you can try it. I got this from Apple Developer Forums.
Hope this work for you.
After dorking around with this all morning, reading all the posts, making all the changes, the key thing that finally worked for me was, as Yet Another Code Maker stated, changing the bundle ID. I think once it has created a container for a bundle, you can't go back and change the visibility of it to have it appear in Finder. I had tried all the different info.plist values but nothing worked until I changed to a new bundle name and forced the system to create a new one. By the way, I didn't see this noted anywhere but the bundle name, the NSUbiquitousContainer name and the NSUbiquitousContainerName can all be different - which is what I did in my case. After spending so much time on this, I figured I would go ahead and put a simple sample app on GitHub in case anyone is still having problems debugging their iCloud folder appearing in Finder - you can find it here. All the required steps are outlined in the README.
In my case (Xcode 7 and iOS 9), the only thing which made it works, after multiple tries, was just use a new bundle identifier (you don't have to change the cloud container identifier, just be sure to select the container you want to use in the Apple Developer Member Centre and to specify in Xcode a custom container instead of the default).
In fact, that means the first time you run your application, the NSUbiquitousContainers section of the info.plist has to be set up. If you set it afterwards as a second step, it won't work...
Well, it's not documented anywhere but try to add Documents folder in the container and store your files there.
Found this hint in replies in this Apple Developer Forum thread.
The .plist entry on this documentation page has an additional entry:
<key>NSUbiquitousContainerName</key>
<string>MyApp</string>
Maybe the missing name is prohibiting it from showing up.
Couldn't find any documentation, but trial and error, I found that:
[[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:#"com.apple.CloudDocs"];
Gives you the base URL for the drive as seen in the picker. Using this base URL I was able to save files in my app and see it on the iCloud drive within Yosemite.
Edit 14.8.14
I tried your plist settings:
<key>NSUbiquitousContainers</key>
<dict>
<key>iCloud.net.redacted.docTest</key>
<dict>
<key>NSUbiquitousContainerIsDocumentScopePublic</key>
<true/>
<key>NSUbiquitousContainerSupportedFolderLevels</key>
<string>Any</string>
</dict>
</dict>
In my little throwaway test app "docTest" it does indeed expose the empty Documents directory in Yosemite and in the document picker.
Screenshot http://spring-appstudio.com/picker-view.png
Just wanted to emphasize one of the OP's discoveries that fixed it for me:
I've also recognised that you need to hard-code the bundle identifier (i.e., don't use iCloud.$(CFBundleIdentifier)) as only the PLIST's values seem to be resolved at build time, but not the keys.
You need to hard code the bundle id. Also update the version.
(I didn't notice this in the question until I went through all the answers).
Same problem occurred to my OSX app.
It is seemed that NSUbiquitousContainers setting works only in the creation time of the iCloud containers. So I tried with new Apple ID(for preparing clean iCloud environment), it becomes to work.
I know this is an old thread but just in case someone runs into the same issue: Only way for me to get my Container folder to be visible in iCloud Drive (after trying all the above suggestions) was to have my app create a temporary file in the Documents folder. As soon as I did that the Container Folder (and the file I created) showed up on my Mac. If this is really the case that I have to create a file to make this folder visible then this would be a bit annoying because my app is a read only app (only reads files added by the user to the Container Folder). The Container Folder needs to be visible as soon as the app is launched for the first time. I guess I will have to detect the first launch.

app runs in simulator, fails on iPad "missing required entitlement ... icloud-services"

Added iCloud to a working iOS app, with data stored in the public database. I have to log on to iCloud in the simulator, but that done, the app runs fine in the simulator. On an iPad, the program crashes on the following statement:
CKContainer * dbContainer = [CKContainer defaultContainer];
The app is terminated "due to uncaught exception 'CKException', reason: 'The application is missing required entitlement com.apple.developer.icloud-services'
When I turn on the iCloud capability in XCode, XCode creates an entry in the .entitlements file for com.apple.developer.icloud-services, with one item in the array: a string with value "CloudKit".
On my iPad I am logged in to iCloud in the same way as on the simulator.
I have been through Apple's entitlement troubleshooting guide in detail several times, I have searched every way I know how, and I can't figure out why this fails. I did find and read the posts suggested as duplicates and none of the solutions suggested worked for me.
After posting this question, I went through the entitlement troubleshooting guide one more time and found the following entitlement section in the built app:
<dict>
<key>keychain-access-groups</key>
<array>
<string>PTXZTRRTHH.*</string>
</array>
<key>get-task-allow</key>
<true/>
<key>application-identifier</key>
<string>PTXZTRRTHH.com.quipzl.Quipzl</string>
<key>com.apple.developer.ubiquity-kvstore-identifier</key>
<string>PTXZTRRTHH.*</string>
<key>com.apple.developer.icloud-services</key>
<string>*</string>
<key>com.apple.developer.icloud-container-environment</key>
<array>
<string>Development</string>
<string>Production</string>
</array>
<key>com.apple.developer.icloud-container-identifiers</key>
<array>
<string>iCloud.com.quipzl.Quipzl</string>
</array>
<key>com.apple.developer.icloud-container-development-container-identifiers</key>
<array>
<string>iCloud.com.quipzl.Quipzl</string>
</array>
<key>com.apple.developer.ubiquity-container-identifiers</key>
<array>
<string>iCloud.com.quipzl.Quipzl</string>
</array>
<key>com.apple.developer.team-identifier</key>
<string>PTXZTRRTHH</string>
<key>aps-environment</key>
<string>development</string>
</dict>
And the app does run on my iPad - until execution reaches the code above, when it throws an exception. Why?
This crash was not due to any missing entitlements, though the exception said it was. I don't know exactly what fixed the problem, but I do know the process that worked, as follows:
1) create a new iOS project of the same type an make sure it runs.
2) enable CloudKit in the new app, and add #import "CloudKit/CloundKit.h" in the default controller created by XCode.
3) add the statement "[CKContainer defaultContainer];" in the viewDidLoad() method.
4) run the app again and make sure it doesn't crash on the added statement.
5) go through all of the app properties in the old app and make sure all of the values are identical to those in the new app.
This last step included around a dozen value changes, and solved the problem: the old app no longer crashes trying to access iCloud.

Xcode 6 Save for Enterprise Deployment does not create plist for ipa anymore?

Xcode 5 helped in creating plist descriptor for enterprise ipa.
Xcode 6 (6A313) creates ipa only.
Is this a bug or intentional change? If so - what would be the reason for taking a step back?
If I did not have previously generated plist using Xcode 5, I would need to crete it manually myself.
Do you know of any automatic tool which would help in the process?
I'm having the same problem. Needed to put a build out last night. I ended up just reusing an old plist and updating it. Here's a template:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>items</key>
<array>
<dict>
<key>assets</key>
<array>
<dict>
<key>kind</key>
<string>software-package</string>
<key>url</key>
<string>[INSERT URL HERE]</string>
</dict>
</array>
<key>metadata</key>
<dict>
<key>bundle-identifier</key>
<string>[INSERT BUNDLE ID HERE]</string>
<key>bundle-version</key>
<string>[INSERT VERSION HERE]</string>
<key>kind</key>
<string>software</string>
<key>title</key>
<string>[INSERT APP TITLE HERE]</string>
</dict>
</dict>
</array>
</dict>
</plist>
Couldn't find other solution than reusing an old .plist-file --- worked perfectly.
I fixed this issue in following manner(As #pir800 mentioned)-
1) Take plist file of an old project and rename it name should be same as ipa file.
2) Changed values of following keys in plist file - a) url. b) bundle-identifier. c) title.
And then put ipa and plist on server. Remaining things are same like Xcode5.
But it is very bad, apple should inform to developer and mention such type changes in document.
I do not my way is correct or wrong but my Enterprise In-house Distribution build properly downloaded and working. ....:)
I replied same on apple developer also. You can check this thread https://devforums.apple.com/message/1076995#1076995 also
If any one find better solution then please reply.
Thank you...
To extend the accepted answer, you need to be a team member of the 299$ enterprise account. Go to Project Navigator (ProjectName) -> Targets -> General tab and select the account that is assoicated with 299$ enterprise developer account. If you cannot find the account you are looking for, go to XCode -> Preferences -> accounts and check if you are the admin / agent / team member of the said account and then proceed to make the ipa and plist file.
I'm not sure about enterprise deployment, but in XCode 7.0, you can create a manifest.plist while exporting an archive for Ad Hoc deployment...
Select Product > Archive
When the build finishes, select the archive you wish to export and choose "Export..."
Choose "Save for Ad Hoc Deployment"
Select your dev team
Choose the desired option for "Device Support"
On the "Summary" page, check the box beside "Include manifest for over-the-air installation." This will add a manifest.plist to the folder where the .ipa file was saved. - Click "Next"
Insert the correct paths to the .ipa, display image, and full size image and click "Export"
Hope this helps.
I'm experiencing exactly the same thing, having to re-use a plist file generated from Xcode5. Just one other thing to add: The validate button, that we're presented with after archiving, does not validate my App correctly. It gets past "Preparing Archive" but then throws up an error, "No matching provisioning profiles found for Applications/plumbsApp.app" - None of the valid provisioning profiles allowed the specified entitlements: application identifier, beta-reports-active, keychain-access-groups.
Now, dismissing this and continuing with the "Export", creates my .ipa file and my users are able to install correctly, with the correct url, of course. So, not totally sure why this is happening. I had the beta release of Xcode running but used the final release of Xcode6. Perhaps the beta, comment, in red-herring. Has anyone else experienced this, where the validation of the archive fails in this way but the App installs ok?

Routing App Coverage File missing but not needed?

I am submitting my app to the app store which uses location services (GPS dot) and MKPinAnnotations and doesn't use anything else for a map, and it looks from what I have researched that the Routing Coverage File is used for overlays?
I dont think I need a Routing Coverage File, but when I go to publish, xcode errors out saying it is missing in the Itunes Connect.
The category for the app is Utilities. It was also navigation but I unticked this hoping it would solve the issue and it didn't.
How can I get around this?
I had the exact same issue earlier today when trying to publish an application that uses the MapKit but does not offer routing capabilities. I resolved it by deselecting all supported routing modes under '{Target} --> Capabilities --> Maps'. If you are just looking at the Info.plist file then you can remove the the MKDirectionsApplicationSupportedModes key and the CFBundleTypeName key that equals MKDirectionsRequest.
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<!--Remove both of these key/value pairs -->
<key>CFBundleTypeName</key>
<string>MKDirectionsRequest</string>
<key>LSItemContentTypes</key>
<array>
<string>com.apple.maps.directionsrequest</string>
</array>
</dict>
</array>
and
<key>MKDirectionsApplicationSupportedModes</key>
<array>
<string>MKDirectionsModeBike</string>
<string>MKDirectionsModeBus</string>
<string>MKDirectionsModeCar</string>
<string>MKDirectionsModeFerry</string>
<string>MKDirectionsModeOther</string>
<string>MKDirectionsModePedestrian</string>
<string>MKDirectionsModePlane</string>
<string>MKDirectionsModeStreetCar</string>
<string>MKDirectionsModeSubway</string>
<string>MKDirectionsModeTaxi</string>
<string>MKDirectionsModeTrain</string>
</array>
turn off map capability solved my problem,
xcode - next to general tap, you should see capability tab,
scroll down to maps section, turn it off,
general tab, change you build and version different from last time,
re-upload to app store.
This time it would not ask for routing profile coverage file,
Done.
This took me a long time to figure out, but the problem was with my scheme. It was the routing app coverage file location. I just change it to "None". Go to your scheme -> Edit Scheme -> Run -> Options -> Routing App Coverage File, change it to None.
see here

Resources