Integrate Fabric/Crashlytics via CocoaPods

IosCocoapodsCrashlyticsTwitter Fabric

Ios Problem Overview


I try to integrate Fabric/Crashlytics via CocoaPods, my Podfile looks like this:

pod 'Fabric/Core', '1.2'
pod 'Fabric/Crashlytics', '1.2'

But when I try to build my app, the build fails and I get a Shell Script Invocation Error that the run script isn't found:

.../Script-F8D74CB61AB5D7A50013D134.sh: line 2: ./Fabric.framework/run: No such file or directory

Is it possible to install Fabric only using CocoaPods?

Ios Solutions


Solution 1 - Ios

Fabric now supports installation with CocoaPods: http://docs.fabric.io/ios/fabric/cocoapods.html

If you are just looking for Crashlytics you can use these two pods:

pod 'Fabric'
pod 'Crashlytics'

Along with adding the following build phase script (note: In case the path to your repo contains spaces, you will need the quotes):

"${PODS_ROOT}"/Fabric/run <API Key> <Build Secret>

Run Script Build Phase

If you are looking to use TwitterKit you will need to include:

pod 'TwitterKit'

Solution 2 - Ios

Same problem for me was fixed by changing the line from:

./Pods/Fabric/Fabric.framework/run YOUR_API_KEY YOUR_BUILD_SECRET

to:

../Pods/Fabric/Fabric.framework/run YOUR_API_KEY YOUR_BUILD_SECRET

In other words, just prepend an extra '.' to designate that the 'Pods' directory is a sibling rather than a child of the build directory. YMMV.

Solution 3 - Ios

I had the same problem, use the $PODS_ROOT environment variable which points to your Pods folder; be sure to quote it in case you have spaces in your path; so instead of

./Pods/Fabric/Fabric.framework/run YOUR_API_KEY YOUR_BUILD_SECRET

use

"$PODS_ROOT"/Fabric/Fabric.framework/run YOUR_API_KEY YOUR_BUILD_SECRET

Solution 4 - Ios

Try:

  1. Remove Fabric and Crashlytics in podfile.

  2. pod install

  3. Add Fabric and Crashlytics to podfile again

  4. pod install

  5. Add Run script like above answer.

Hope it help.

Solution 5 - Ios

macOS Sierra, Swift 3

change

${PODS_ROOT}/Fabric/run

to

"${PODS_ROOT}/Fabric/run"

Solution 6 - Ios

I had to use a different path in Xcode 7 using CocoaPods 0.39:

${SRCROOT}/Pods/Fabric/Fabric.framework/run <key> <secret>

podfile:

pod 'Crashlytics'
pod 'Fabric'

I also just updated Fabric to 3.4.1, and that path ^ changed slightly to Fabric/run. Make sure you check the bits after ${SRCROOT} carefully and compare it to what the Fabric app recommends. See the changelog for 3.4.1 for details.

Solution 7 - Ios

in

Fabric (1.6.7)

You should change path from

"${PODS_ROOT}/Fabric/Fabric.framework/run" YOUR_API_KEY YOUR_BUILD_SECRET

to

"${PODS_ROOT}/Fabric/run"  YOUR_API_KEY YOUR_BUILD_SECRET

Solution 8 - Ios

The path to the script that is executed during the build phase is different when you use Cocoapods. The github page on https://github.com/bpoplauschi/CrashlyticsFramework advises to use ./Pods/CrashlyticsFramework/Crashlytics.framework/run however, I found I had to use ./Pods/Fabric/Fabric.framework/run for my installation. Anyways you will have to dig through the Pods directory to find what you are looking for.

Solution 9 - Ios

If you update to Fabric & Crashlytics from older version:

  1. If you have any data in your info.plist file by the key Fabric, make sure to delete all that info along with the key.
  2. Use simple "${PODS_ROOT}/Fabric/run" script. Don't add any API_KEY and BUILD_SECRET

That worked for me, hope this helps.

Solution 10 - Ios

If you relied on something specific to the older Podspecs and can't update to the official libraries yet, you can add

source 'https://github.com/orta/FabricSpecs.git'
source 'https://github.com/CocoaPods/Specs.git'

To the top of your Podfile, and it will look for the older -unofficial- versions before the new ones. See the FabricSpecs repo for more details.

Solution 11 - Ios

For my project, this worked:

"${PODS_ROOT}/Fabric/Fabric.framework/run" YOUR_API_KEY YOUR_BUILD_SECRET

Solution 12 - Ios

Typically I would recommend not going against the grain and using the Fabric App for installation. Its hands down the simplest integration tool I've ever seen given the complexity they are providing.

That being said, since you're dead set on using Cocoapods, the only way to get things going would be the following

  1. Run the Crashlytics App installer to the point where they give you the build phase script.
  2. Copy the script
  3. Undo the installation
  4. Install via Cocoapods
  5. Add the copied script to your buildphase

Solution 13 - Ios

I have meet this issue before. Here is my solution. to add the execution mode for the run file automatically before your run the script.

In the Build Phase -> Run Script add following line:

chmod +x ./Pods/CrashlyticsFramework/Crashlytics.framework/run

./Pods/CrashlyticsFramework/Crashlytics.framework/run YOUR_API_KEY YOUR_BUILD_SECRET

Solution 14 - Ios

Delete podfile.lock and manifest.lock, then re-run podfile install, then continue from there using the "easy" configure app from Fabric.

There are some very nice screen-shot slide-show demos on Fabric.io's site. I found them with Google - don't see where they are accessible from the site.

FYI, if you're having issues, it's not you :). Basically (as of August 3rd), every step of the Fabric onboard process is potentially broken.

  • If you're lucky, you might have no issues.
  • If you're not, :( you might have issues to resolve at every step, including signing up for the service which can put you in an endless sign-up loop, and so on from there.

Hopefully these will all get fixed soon.

Warning: most of the answers you will find via a search will be outdated, because apparently fabric.io changed a lot on July 15th, but if you scroll down anything you find on stack/o, you might find a newer answer.

Solution 15 - Ios

Make sure to uninstall pod 'Answers', '~> 1.3' from your pods if you are using Fabric in your project before.

Solution 16 - Ios

As mentioned in the official documentation, just update your pods repo

pod repo update

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionswalknerView Question on Stackoverflow
Solution 1 - IosSteven HeptingView Answer on Stackoverflow
Solution 2 - Iosc3r34lView Answer on Stackoverflow
Solution 3 - IosjaygoobyView Answer on Stackoverflow
Solution 4 - Ioseric longView Answer on Stackoverflow
Solution 5 - IosAdam SmakaView Answer on Stackoverflow
Solution 6 - IosbrandonscriptView Answer on Stackoverflow
Solution 7 - IosUnRewaView Answer on Stackoverflow
Solution 8 - IoskeyboardsamuraiView Answer on Stackoverflow
Solution 9 - IosAlexander StepanishinView Answer on Stackoverflow
Solution 10 - IosortaView Answer on Stackoverflow
Solution 11 - Iosdeepax11View Answer on Stackoverflow
Solution 12 - IosDaniel GalaskoView Answer on Stackoverflow
Solution 13 - IosStevenChenView Answer on Stackoverflow
Solution 14 - IosRichard GrossmanView Answer on Stackoverflow
Solution 15 - IosMaximo LucosiView Answer on Stackoverflow
Solution 16 - IosVitor ReisView Answer on Stackoverflow