AppsFlyerSDK / segment-appsflyer-ios

The AppsFlyer iOS SDK integration with Segment
https://segment.com/docs/integrations/appsflyer/
MIT License
23 stars 59 forks source link

'AppsFlyerLib/AppsFlyerLib.h' file not found #73

Closed Hans92 closed 1 year ago

Hans92 commented 2 years ago

segment-appsflyer-ios version v6.4.0 is not compiling with Xcode 13.1. There is some issue with importing AppsFlyerLib with SPM in SEGAppsFlyerIntegration.h:

'AppsFlyerLib/AppsFlyerLib.h' file not found

Steps to reproduce:

af-margot commented 2 years ago

Hi @Hans92,

We will check this. The issue is only happening with Xcode 13.1 if I understand correctly?

Hans92 commented 2 years ago

@af-margot I can confirm that it also occurs with Xcode 13.0. First build always fails but building it a second time succeeds.

morluna commented 2 years ago

@af-margot this is also happening for us using segment-appsflyer-ios version 6.3.4 and building with our release configuration only

Screen Shot 2021-11-12 at 1 29 35 PM .

MarcoCarnevali commented 2 years ago

I can confirm it happens for us too with the Swift Package Manager version. Works good with cocoapods.

georgenavarro commented 2 years ago

I was having the same issue where first build failed, which was blocking my CI/CD system from doing clean builds. However if I changed the package file to include the AppsFlyer XCFramework directly as a binary target the problem went away:

// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
    name: "segment-appsflyer-ios",
    platforms: [
        .iOS(.v10)
    ],
    products: [
        // Products define the executables and libraries a package produces, and make them visible to other packages.
        .library(
            name: "segment-appsflyer-ios",
            targets: ["segment-appsflyer-ios"]),
    ],
    dependencies: [
        // Dependencies declare other packages that this package depends on.
        .package(name: "Segment", url: "https://github.com/segmentio/analytics-ios.git" , from: "4.0.0"),
    ],
    targets: [
        // Targets are the basic building blocks of a package. A target can define a module or a test suite.
        // Targets can depend on other targets in this package, and on products in packages this package depends on.
        .target(
            name: "segment-appsflyer-ios",
            dependencies: [
                "Segment",
                "AppsFlyerLib"
                ],
            path: "segment-appsflyer-ios/Classes",
            publicHeadersPath: ""
            ),
        .binaryTarget(
            name: "AppsFlyerLib",
            url: "https://github.com/AppsFlyerSDK/AppsFlyerFramework/releases/download/6.4.3/AppsFlyerLib.xcframework.zip",
            checksum: "8924e43bfec9a0abe3b47b6062c434e08ca824df4648a8ea0abf8018f72709c3"
        )
    ]
)

Obviously this is not ideal, but hopefully this is useful information to help solve the problem.

TimurAsayonok commented 2 years ago

I can confirm it happens with the Swift Package Manager version. v6.4.4

mattlangtree commented 2 years ago

I encountered this issue on v6.4.0 and for me the issue was that part of the AppsFlyer framework files was in git lfs and I hadn't yet pulled the necessary files down. If you're in a similar case, do cat .gitattributes on the root of your project and if AppsFlyer is mentioned, perhaps you're in a similar situation. If that file doesn't exists or AppsFlyer isn't listed, this might not help you.

To get the Git LFS files, run:

brew install git-lfs
git-lfs install
git-lfs pull
rwgrier commented 2 years ago

@af-margot any update on this issue? I'm seeing it as well. The build failures are inconsistent, but the error is always the same:

'AppsFlyerLib/AppsFlyerLib.h' file not found

I'm attempting to use v6.5.2.

abubakrj commented 2 years ago

The same happening with Xcode 13.2.1. I am using version 6.5.2