question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question: Stuck in the glog kit during cocoapods installation.

See original GitHub issue

Please help installing the flipper in my objective-c project, thank you!

  • cocoapods version: 1.7.3

  • developing language: objective-c

  • Xcode version: 10.2.1

  • FB_SONARKIT_ENABLED flag setting: 螢幕快照 2019-07-22 下午12 01 11

  • podfile (from getting started guide):

platform :ios, '12.2'
project 'Demo.xcodeproj'
swift_version = "4.1"
flipperkit_version = '0.23.1'

target 'Demo' do
   use_frameworks!

   ...
    
    # Pods for Debug Tool (flipper)
    pod 'FlipperKit', '~>' + flipperkit_version
    pod 'FlipperKit/FlipperKitLayoutComponentKitSupport', '~>' + flipperkit_version
    pod 'FlipperKit/SKIOSNetworkPlugin', '~>' + flipperkit_version
    pod 'FlipperKit/FlipperKitUserDefaultsPlugin', '~>' + flipperkit_version
    
    ...

  
  # This post_install hook adds the -DFB_SONARKIT_ENABLED=1 flag to OTHER_CFLAGS, necessary to expose Flipper classes in the header files
  post_install do |installer|
    file_name = Dir.glob("*.xcodeproj")[0]
    app_project = Xcodeproj::Project.open(file_name)
    app_project.native_targets.each do |target|
      target.build_configurations.each do |config|
        cflags = config.build_settings['OTHER_CFLAGS'] || '$(inherited) '
        unless cflags.include? '-DFB_SONARKIT_ENABLED=1'
          puts 'Adding -DFB_SONARKIT_ENABLED=1 in OTHER_CFLAGS...'
          cflags << '-DFB_SONARKIT_ENABLED=1'
        end
        config.build_settings['OTHER_CFLAGS'] = cflags
      end
      app_project.save
    end
    installer.pods_project.save
  end

end
  • Pod install log:
Analyzing dependencies
Downloading dependencies
Using AFNetworking (3.1.0)
Using ActiveLabel (1.1.0)
Using Alamofire (5.0.0-beta.6)
Using Bolts (1.9.0)
Installing CocoaAsyncSocket (7.6.3)
Installing CocoaLibEvent (1.0.0)
Installing ComponentKit (0.27)
Using Crashlytics (3.13.2)
Installing DoubleConversion (1.1.5)
Using FBSDKCoreKit (5.0.2)
Using FBSDKLoginKit (5.0.2)
Using FBSDKShareKit (5.0.2)
Using FMDB (2.7.5)
Using Fabric (1.10.2)
Using Firebase (6.3.0)
Using FirebaseAnalytics (6.0.2)
Using FirebaseAnalyticsInterop (1.2.0)
Using FirebaseCore (6.0.3)
Using FirebaseInstanceID (4.2.0)
Using FirebaseMessaging (4.1.0)
Installing Flipper (0.23.1)
Installing Flipper-Folly (2.0.0)
Installing Flipper-PeerTalk (0.0.4)
Installing Flipper-RSocket (1.0.0)
Installing FlipperKit (0.23.1)
Using GTMSessionFetcher (1.2.2)
Using GoogleAppMeasurement (6.0.2)
Using GoogleSignIn (4.4.0)
Using GoogleToolboxForMac (2.2.1)
Using GoogleUtilities (6.2.1)
Using IQKeyboardManagerSwift (6.3.0)
Using MBProgressHUD (0.9.2)
Using MJExtension (3.0.17)
Using MJRefresh (3.2.0)
Using Masonry (1.1.0)
Using Protobuf (3.8.0)
Using ReactiveCocoa (2.5)
Using RxCocoa (5.0.0)
Using RxRelay (5.0.0)
Using RxSwift (5.0.0)
Using RxSwiftNotifications (0.0.1)
Using SDWebImage (5.0.6)
Using WebViewJavascriptBridge (6.0.3)
Installing Yoga (1.14.0)
Installing YogaKit (1.14.0)
Installing boost-for-react-native (1.63.0)
Installing glog (0.3.4)
[!] /bin/bash -c
set -e
#!/bin/bash
set -e

PLATFORM_NAME="${PLATFORM_NAME:-iphoneos}"
CURRENT_ARCH="${CURRENT_ARCH:-armv7}"

export CC="$(xcrun -find -sdk $PLATFORM_NAME cc) -arch $CURRENT_ARCH -isysroot $(xcrun -sdk $PLATFORM_NAME --show-sdk-path)"
export CXX="$CC"

# Remove automake symlink if it exists
if [ -h "test-driver" ]; then
    rm test-driver
fi

./configure --host arm-apple-darwin

# Fix build for tvOS
cat << EOF >> src/config.h

/* Add in so we have Apple Target Conditionals */
#ifdef __APPLE__
#include <TargetConditionals.h>
#include <Availability.h>
#endif

/* Special configuration for AppleTVOS */
#if TARGET_OS_TV
#undef HAVE_SYSCALL_H
#undef HAVE_SYS_SYSCALL_H
#undef OS_MACOSX
#endif

/* Special configuration for ucontext */
#undef HAVE_UCONTEXT_H
#undef PC_FROM_UCONTEXT
#if defined(__x86_64__)
#define PC_FROM_UCONTEXT uc_mcontext->__ss.__rip
#elif defined(__i386__)
#define PC_FROM_UCONTEXT uc_mcontext->__ss.__eip
#endif
EOF

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-apple-darwin-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for arm-apple-darwin-gcc... /Library/Developer/CommandLineTools/usr/bin/cc -arch armv7 -isysroot
checking whether the C compiler works... no
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: unable to lookup item 'Path' in SDK 'iphoneos'
/Users/n2120008075/Library/Caches/CocoaPods/Pods/Release/glog/0.3.4-1de0b/missing: Unknown `--is-lightweight' option
Try `/Users/n2120008075/Library/Caches/CocoaPods/Pods/Release/glog/0.3.4-1de0b/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
configure: error: in `/Users/n2120008075/Library/Caches/CocoaPods/Pods/Release/glog/0.3.4-1de0b':
configure: error: C compiler cannot create executables
See `config.log' for more details

Another question, not sure the getting started guide is correct for objective-c:(https://fbflipper.com/docs/getting-started.html) 螢幕快照 2019-07-22 上午11 52 19

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
palexscommented, Aug 16, 2019

It’s possible to specify different Swift version for selected pods instead of using swift_version = "4.1", e.g.:

    # This post_install hook adds the -DFB_SONARKIT_ENABLED=1 flag to OTHER_CFLAGS, necessary to expose Flipper classes in the header files
    post_install do |installer|
    installer.pods_project.targets.each do |target|
        if ['Flipper', 'FlipperKit', 'Flipper-Folly', 'Flipper-PeerTalk',
            'Flipper-RSocket', 'Yoga', 'YogaKit',
            'CocoaAsyncSocket', 'ComponentKit', 'DoubleConversion',
            'glog', 'CocoaLibEvent', 'OpenSSL-Static', 'boost-for-react-native'
        ].include? target.name
          target.build_configurations.each do |config|
            config.build_settings['SWIFT_VERSION'] = '4.1'
          end
        end
      end
    file_name = Dir.glob("*.xcodeproj")[0]
    app_project = Xcodeproj::Project.open(file_name)
    app_project.native_targets.each do |target|
      target.build_configurations.each do |config|
        cflags = config.build_settings['OTHER_CFLAGS'] || '$(inherited) '
        unless cflags.include? '-DFB_SONARKIT_ENABLED=1'
          puts 'Adding -DFB_SONARKIT_ENABLED=1 in OTHER_CFLAGS...'
          cflags << '-DFB_SONARKIT_ENABLED=1'
        end
        config.build_settings['OTHER_CFLAGS'] = cflags
      end
      app_project.save
    end
    installer.pods_project.save
    end
0reactions
passycommented, Sep 25, 2019

I’m cleaning up some old issues and this one hasn’t seen updates in a long time. Please let me know if this is still a problem and we can reopen it. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

ios - cocoapods - 'pod install' takes forever - Stack Overflow
I ran into the same problem, and I solved it by running the following commands which is given here pod repo remove master...
Read more >
Troubleshooting - CocoaPods Guides
In Xcode "Build Settings", find "Skip Install". Set the value for "Release" to "NO" on your application target. Build again and it should...
Read more >
issue with cocoapods installation | Apple Developer Forums
Step 1 (install HomeBrew) · Step 2 (Run these two commands in your terminal to add Homebrew to your PATH) · Step 3...
Read more >
iOS framework addition failed due to a Cocoapods installation ...
Looking deeper in the logs, it seemed to be failing in the shell. This fixed it for me: Within "iOS Resolver Settings" uncheck...
Read more >
Install pod stuck at Analyzing Dependencies - Treehouse
Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found