firebase-ios-sdk icon indicating copy to clipboard operation
firebase-ios-sdk copied to clipboard

Double-quoted include header warnings when using SPM with a ObjC/Swift project

Open reggian opened this issue 2 years ago • 8 comments

Description

When using Firebase iOS SDK with SPM Xcode emits multiple warnings of improper header definitions:

Double-quoted include "FIRAnalytics+AppDelegate.h" in framework header, expected angle-bracketed instead
Double-quoted include "FIRAnalytics+Consent.h" in framework header, expected angle-bracketed instead
Double-quoted include "FIRAnalytics+OnDevice.h" in framework header, expected angle-bracketed instead
etc.

Reproducing the issue

Unfortunately this is not reproducible every time. The last time what I did was:

  1. Create an ObjC iOS app project
  2. Add firebase as SPM dependency
  3. Add FirebaseAnalyticsWithoutAdIdSupport to app target
  4. Import the firebase header into the AppDelegate.m (#import <FirebaseCore/FirebaseCore.h>)

Firebase SDK Version

10.15.0

Xcode Version

15.0

Installation Method

Swift Package Manager

Firebase Product(s)

Analytics

Targeted Platforms

iOS

Relevant Log Output

No response

If using Swift Package Manager, the project's Package.resolved

Expand Package.resolved snippet
{
  "pins" : [
    {
      "identity" : "abseil-cpp-binary",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/google/abseil-cpp-binary.git",
      "state" : {
        "revision" : "bfc0b6f81adc06ce5121eb23f628473638d67c5c",
        "version" : "1.2022062300.0"
      }
    },
    {
      "identity" : "firebase-ios-sdk",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/firebase/firebase-ios-sdk",
      "state" : {
        "revision" : "8a8ec57a272e0d31480fb0893dda0cf4f769b57e",
        "version" : "10.15.0"
      }
    },
    {
      "identity" : "googleappmeasurement",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/google/GoogleAppMeasurement.git",
      "state" : {
        "revision" : "03b9beee1a61f62d32c521e172e192a1663a5e8b",
        "version" : "10.13.0"
      }
    },
    {
      "identity" : "googledatatransport",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/google/GoogleDataTransport.git",
      "state" : {
        "revision" : "aae45a320fd0d11811820335b1eabc8753902a40",
        "version" : "9.2.5"
      }
    },
    {
      "identity" : "googleutilities",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/google/GoogleUtilities.git",
      "state" : {
        "revision" : "c38ce365d77b04a9a300c31061c5227589e5597b",
        "version" : "7.11.5"
      }
    },
    {
      "identity" : "grpc-binary",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/google/grpc-binary.git",
      "state" : {
        "revision" : "f1b366129d1125be7db83247e003fc333104b569",
        "version" : "1.50.2"
      }
    },
    {
      "identity" : "gtm-session-fetcher",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/google/gtm-session-fetcher.git",
      "state" : {
        "revision" : "d415594121c9e8a4f9d79cecee0965cf35e74dbd",
        "version" : "3.1.1"
      }
    },
    {
      "identity" : "interop-ios-for-google-sdks",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/google/interop-ios-for-google-sdks.git",
      "state" : {
        "revision" : "2d12673670417654f08f5f90fdd62926dc3a2648",
        "version" : "100.0.0"
      }
    },
    {
      "identity" : "leveldb",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/firebase/leveldb.git",
      "state" : {
        "revision" : "0706abcc6b0bd9cedfbb015ba840e4a780b5159b",
        "version" : "1.22.2"
      }
    },
    {
      "identity" : "nanopb",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/firebase/nanopb.git",
      "state" : {
        "revision" : "819d0a2173aff699fb8c364b6fb906f7cdb1a692",
        "version" : "2.30909.0"
      }
    },
    {
      "identity" : "promises",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/google/promises.git",
      "state" : {
        "revision" : "e70e889c0196c76d22759eb50d6a0270ca9f1d9e",
        "version" : "2.3.1"
      }
    },
    {
      "identity" : "swift-protobuf",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/apple/swift-protobuf.git",
      "state" : {
        "revision" : "cf62cdaea48b77f1a631e5cb3aeda6047c2cba1d",
        "version" : "1.23.0"
      }
    }
  ],
  "version" : 2
}

If using CocoaPods, the project's Podfile.lock

No response

reggian avatar Aug 30 '23 06:08 reggian

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

google-oss-bot avatar Aug 30 '23 06:08 google-oss-bot

Thanks for reporting, @reggian. I'm unable to reproduce the issue using the iOS quickstart. I also found this related issue though they're using CocoaPods. Could you provide a sample app that reproduces the issue to investigate?

rizafran avatar Aug 31 '23 18:08 rizafran

Hey @rizafran, thank you for looking into this. I am sorry to report that there are no more warnings (or rather not sorry for the exact same reason). I have tested and re-tested and re-re-tested, the problem seems to have solved itself automagically. I will close this issue and re-open or create a new one if the problem arises again and I will try to provide a reproducible project.

reggian avatar Sep 04 '23 18:09 reggian

I have encountered the issue again on my project then managed reproduce it with a simple shared ObjC-Swift project. I have also edited the issue title and description to make it more precise.

reggian avatar Sep 26 '23 09:09 reggian

I have same issue.

maztaflex avatar Oct 16 '23 02:10 maztaflex

Does this still reproduce in Xcode 15.2?

paulb777 avatar May 29 '24 17:05 paulb777

I have Xcode 15.4 and it does, yes.

reggian avatar Jun 06 '24 08:06 reggian

Reproduces using SPM + Xcode 16 beta 1. Screenshot 2024-06-18 at 21 21 53

parrots avatar Jun 19 '24 03:06 parrots

Same warnings here on my project (ObjC/Swift) Reproduces using SPM + Xcode 15.4 Using last Firebase SDK version 10.28.1

Capture d’écran 2024-07-05 à 17 41 39

HugoMartins avatar Jul 05 '24 15:07 HugoMartins

Thanks for the reports everyone. These warnings are safe to suppress and I recommend doing so by going to your target's Build Settings, and adding -Wno-quoted-include-in-framework-header to Other C Flags. CocoaPods will by default add this flag, but that behavior does not happen automatically with SPM or the manual zip integration. Changing the style of imports may have unexpected effects, so suppressing the warning is safer for now.

ncooke3 avatar Jul 08 '24 19:07 ncooke3