segment-appsflyer-ios icon indicating copy to clipboard operation
segment-appsflyer-ios copied to clipboard

'AppsFlyerLib/AppsFlyerLib.h' file not found

Open Hans92 opened this issue 3 years ago • 9 comments

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:

  • clone the repo
  • open Package.swift in Xcode 13.1
  • try to build

Hans92 avatar Nov 08 '21 13:11 Hans92

Hi @Hans92,

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

af-margot avatar Nov 08 '21 16:11 af-margot

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

Hans92 avatar Nov 08 '21 20:11 Hans92

@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 .

morluna avatar Nov 12 '21 20:11 morluna

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

MarcoCarnevali avatar Nov 23 '21 17:11 MarcoCarnevali

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.

georgenavarro avatar Dec 02 '21 02:12 georgenavarro

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

TimurAsayonok avatar Jan 12 '22 16:01 TimurAsayonok

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

mattlangtree avatar Jan 20 '22 21:01 mattlangtree

@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.

rwgrier avatar Feb 04 '22 15:02 rwgrier

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

abubakrj avatar Feb 21 '22 05:02 abubakrj