sergiikhliustin/BazelPods

Unable to Build FBSDKShareKit

Closed this issue · 7 comments

It seems like the BUILD file is unable to locate the file in the dependencies.
Here's the log for the same :

swift_library(
    name = "sources",
    module_name = "myAPP",
    srcs = glob(["**/*.swift"]),
    deps = [
            "//Pods/FBSDKCoreKit_Basics",
            "//Pods/FBAEMKit",
            "//Pods/FBSDKCoreKit",
            "//Pods/FBSDKShareKit",
            "//Pods/FirebaseCrashlytics",
            "//Pods/SwiftyJSON",
            "//Pods/ScalingCarousel",
            ],
    # visibility = ["//visibility:private"],
    # copts = [
        # "-DBAZELBUILD"
    # ]
)

Generated BUILD File for FBSDKShareKit

 load('@build_bazel_rules_ios//rules:framework.bzl', 'apple_framework')
# Add a config setting release for compilation mode
# Assume that people are using `opt` for release mode
# see the bazel user manual for more information
# https://docs.bazel.build/versions/master/be/general.html#config_setting
config_setting(
  name = "release",
  values = {
    "compilation_mode": "opt"
  }
)
apple_framework(
  name = "FBSDKShareKit",
  module_name = "FBSDKShareKit",
  bundle_id = "org.cocoapods.FBSDKShareKit",
  swift_version = "5",
  link_dynamic = False,
  testonly = False,
  platforms = {
    "ios": "13.0"
  },
  srcs = glob(
    [
      "FBSDKShareKit/FBSDKShareKit/**/*.h",
      "FBSDKShareKit/FBSDKShareKit/**/*.m",
      "FBSDKShareKit/FBSDKShareKit/**/*.swift"
    ]
  ),
  public_headers = glob(
    [
      "FBSDKShareKit/FBSDKShareKit/*.h",
      "FBSDKShareKit/FBSDKShareKit/Internal/FBSDKVideoUploader.h"
    ]
  ),
  deps = [
    "//Pods/FBSDKCoreKit:FBSDKCoreKit",
    "//Pods/FBSDKCoreKit_Basics:FBSDKCoreKit_Basics"
  ],
  objc_defines = [
    "COCOAPODS=1"
  ] + select(
    {
      "//conditions:default": [
        "POD_CONFIGURATION_DEBUG=1",
        "DEBUG=1"
      ],
      ":release": [
        "POD_CONFIGURATION_RELEASE=1"
      ]
    }
  ),
  swift_defines = [
    "COCOAPODS"
  ] + select(
    {
      "//conditions:default": [
        "DEBUG"
      ]
    }
  ),
  weak_sdk_frameworks = [
    "Accounts",
    "AudioToolbox",
    "CoreGraphics",
    "Foundation",
    "QuartzCore",
    "Security",
    "Social",
    "UIKit"
  ],
  xcconfig = {
    "GCC_PREPROCESSOR_DEFINITIONS": [
      "FBSDKCOCOAPODS=1"
    ],
    "OTHER_SWIFT_FLAGS": [
      "-Xcc",
      "-DFBSDKCOCOAPODS"
    ]
  },
  visibility = [
    "//visibility:public"
  ]
)

Error:

bjs/FBSDKShareKit_objc/arc/FBSDKShareUtility.o)
In file included from Pods/FBSDKShareKit/FBSDKShareKit/FBSDKShareKit/Internal/FBSDKShareUtility.m:24:
bazel-out/ios-sim_arm64-min13.0-applebin_ios-ios_sim_arm64-fastbuild-ST-7f67114cf0a4/bin/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit.framework/PrivateHeaders/FBSDKCoreKit+Internal.h:53:10: fatal error: 'FBSDKGraphRequestFactory.h' file not found
 #import "FBSDKGraphRequestFactory.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Error in child process '/usr/bin/xcrun'. 1

This file exists, but I think somehow bazel run is unable to link the dependencies.

Have you solved the problem?

Nope, still stuck.

@slice-dharamd could you please provide the exact version of FBSDKShareKit or podspec

'11.2.1'

#import <FBSDKShareKit/FBSDKGraphRequestFactory.h>
You can try this

@slice-dharamd I've checked briefly and cannot understand what's wrong with the headers. Is it possible for you to upgrade ShareKit to 12.0.0 or above and check?

Checked this with sharekit 12.0.0 on indpependent project, works fine 😪