PodToBUILD icon indicating copy to clipboard operation
PodToBUILD copied to clipboard

Cannot use Texture example in app

Open LeeWong opened this issue 5 years ago • 3 comments

Hi I encountered the following error when trying to use Texture example(I update build file to use texture 2.8) in a swift app:

/Users/liwang/Documents/projects/atease/mono/App-iOS/BUILD:14:1: Compiling Swift module App_iOS_Sources failed (Exit 1) sandbox-exec failed: error executing command 
  (cd /private/var/tmp/_bazel_liwang/819e8c6e05fda60b9cdfa83fb4ddbefc/sandbox/darwin-sandbox/1/execroot/__main__ && \
  exec env - \
    APPLE_SDK_PLATFORM=iPhoneSimulator \
    APPLE_SDK_VERSION_OVERRIDE=12.1 \
    DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer \
    SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk \
    TMPDIR=/var/folders/25/17gky92x42jg9wykd2770t9w0000gn/T/ \
    XCODE_VERSION_OVERRIDE=10.1.0.10B61 \
  /usr/bin/sandbox-exec -f /private/var/tmp/_bazel_liwang/819e8c6e05fda60b9cdfa83fb4ddbefc/sandbox/darwin-sandbox/1/sandbox.sb /var/tmp/_bazel_liwang/install/1a037b6c0d8096293d1eecfde6528fbd/_embedded_binaries/process-wrapper '--timeout=0' '--kill_delay=15' bazel-out/host/bin/external/build_bazel_rules_swift/tools/wrappers/bazel_xcode_wrapper bazel-out/host/bin/external/build_bazel_rules_swift/tools/wrappers/swift_wrapper /usr/bin/xcrun swiftc '-Xwrapped-swift=-ephemeral-module-cache' @bazel-out/ios-x86_64-min10.0-applebin_ios-ios_x86_64-fastbuild/bin/App-iOS/App_iOS_Sources.swiftmodule-0.params @bazel-out/ios-x86_64-min10.0-applebin_ios-ios_x86_64-fastbuild/bin/App-iOS/App_iOS_Sources.swiftmodule-1.params)
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "../../../../../../Vendor/Texture/pod_support/Headers/Public/AsyncDisplayKit/ASAbsoluteLayoutElement.h"
        ^
/private/var/tmp/_bazel_liwang/819e8c6e05fda60b9cdfa83fb4ddbefc/sandbox/darwin-sandbox/1/execroot/__main__/bazel-out/ios-x86_64-min10.0-applebin_ios-ios_x86_64-fastbuild/bin/Vendor/Texture/Texture_module_map/../../../../../../Vendor/Texture/Source/Layout/ASAbsoluteLayoutElement.h:22:23: error: unknown type name 'CGPoint'; did you mean 'Point'?
@property (nonatomic) CGPoint layoutPosition;
                      ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/MacTypes.h:542:41: note: 'Point' declared here
typedef struct Point                    Point;
                                        ^
<module-includes>:3:9: note: in file included from <module-includes>:3:
#import "../../../../../../Vendor/Texture/pod_support/Headers/Public/AsyncDisplayKit/ASAbstractLayoutController+FrameworkPrivate.h"
        ^
/private/var/tmp/_bazel_liwang/819e8c6e05fda60b9cdfa83fb4ddbefc/sandbox/darwin-sandbox/1/execroot/__main__/bazel-out/ios-x86_64-min10.0-applebin_ios-ios_x86_64-fastbuild/bin/Vendor/Texture/Texture_module_map/../../../../../../Vendor/Texture/Source/Private/ASAbstractLayoutController+FrameworkPrivate.h:15:10: error: 'vector' file not found
#include <vector>
         ^
App-iOS/Sources/AppDelegate.swift:4:8: error: could not build Objective-C module 'AsyncDisplayKit'
import AsyncDisplayKit

Anyone can give me some pointers on how to fix it. It would be wonderful.

Thank you.

LeeWong avatar Jun 02 '19 04:06 LeeWong

Any updates about this?

bondan23 avatar Aug 08 '19 20:08 bondan23

This may be an issue with the way swift is setup to handle implicit imports. At the moment, swift support can definitely use some work and has low coverage. Would you put up the example into a PR or posting an example BUILD file?

jerrymarino avatar Aug 15 '19 15:08 jerrymarino

same problem

#include <vector> file not found

when I run "bazel build //Vendor/Texture:Texture", it's work, but when we run project to test on simulator, It's break error ---- Pod.WORKSPACE -----

new_pod_repository(
  name = "Texture",
  url = "https://github.com/TextureGroup/Texture/archive/3.0.0.zip",
  inhibit_warnings = True,
  # Undefined symbols
  # Compilation error: triggered module compilation from ObjC code
  generate_module_map = False,
)

new_pod_repository(
  name = "PINOperation",
  url = "https://github.com/pinterest/PINOperation/archive/1.2.1.zip",
  generate_header_map = True
)


new_pod_repository(
  name = "PINCache",
  url = "https://github.com/pinterest/PINCache/archive/3.0.3.zip",
  generate_header_map = True
)

new_pod_repository(
  name = "PINRemoteImage",
  url = "https://github.com/pinterest/PINRemoteImage/archive/3.0.3.zip",
  # PINRemoteImage_Core conditionally compiles in PINCache based on these
  # headers
  user_options = ["Core.sdk_frameworks += SystemConfiguration, MobileCoreServices, ImageIO, AudioToolbox"],
  generate_module_map = False,
  generate_header_map = True,
)

---- BUILD FILE----

load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")
load("@build_bazel_rules_apple//apple:ios.bzl", "ios_application")

filegroup(
    name = "Assets",
    srcs = glob(["Assets.xcassets/**"]),
    visibility = ["//visibility:public"],
)

swift_library(
    name = "App_Classes",
    srcs = glob(["*.swift"]),
	visibility = ["//visibility:public"],
	data = [":Assets"],
	deps = [
		"//:all" <- like texture example
	]
)

ios_application(
    name = "Prozer",
    bundle_id = "...",
    families = [
        "iphone",
        "ipad",
    ],
    infoplists = ["Info.plist"],
    launch_storyboard = "LaunchScreen.storyboard",
    minimum_os_version = "12.0",
	deps = [":App_Classes"],
    visibility = ["//visibility:public"],
)

Any updates about this?

baveku avatar Sep 15 '21 15:09 baveku