Skip to content

Firebase iOS SDK version 10+ fails to compile #231

@AttilaTheFun

Description

@AttilaTheFun

I'm getting this issue when trying to use firebase analytics:

logan@Logans-MBP Snag % bazel build //Services/Sources:AnalyticsServiceImplementation
INFO: Repository swiftpkg_firebase_ios_sdk instantiated at:
  /Users/logan/Developer/Swift/Apps/Snag/WORKSPACE:53:19: in <toplevel>
  /Users/logan/Developer/Swift/Apps/Snag/swift_deps.bzl:62:18: in swift_dependencies
Repository rule swift_package defined at:
  /private/var/tmp/_bazel_logan/9c5dc880d421e060978209038345ac60/external/cgrindel_swift_bazel/swiftpkg/internal/swift_package.bzl:167:32: in <toplevel>
INFO: repository @swiftpkg_firebase_ios_sdk' used the following cache hits instead of downloading the corresponding file.
 * Hash 'd5098cd2d731104dddb11c39b2cbbd3aab11a604c528706a16ff0114abd8d53a' for https://dl.google.com/firebase/ios/swiftpm/10.4.0/FirebaseAnalytics.zip
If the definition of 'repository @swiftpkg_firebase_ios_sdk' was updated, verify that the hashes were also updated.
ERROR: An error occurred during the fetch of repository 'swiftpkg_firebase_ios_sdk':
   Traceback (most recent call last):
        File "/private/var/tmp/_bazel_logan/9c5dc880d421e060978209038345ac60/external/cgrindel_swift_bazel/swiftpkg/internal/swift_package.bzl", line 65, column 31, in _swift_package_impl
                repo_rules.gen_build_files(repository_ctx, pkg_info)
        File "/private/var/tmp/_bazel_logan/9c5dc880d421e060978209038345ac60/external/cgrindel_swift_bazel/swiftpkg/internal/repo_rules.bzl", line 78, column 55, in _gen_build_files
                bld_file = swiftpkg_build_files.new_for_target(repository_ctx, pkg_ctx, target)
        File "/private/var/tmp/_bazel_logan/9c5dc880d421e060978209038345ac60/external/cgrindel_swift_bazel/swiftpkg/internal/swiftpkg_build_files.bzl", line 21, column 40, in _new_for_target
                return _clang_target_build_file(repository_ctx, pkg_ctx, target)
        File "/private/var/tmp/_bazel_logan/9c5dc880d421e060978209038345ac60/external/cgrindel_swift_bazel/swiftpkg/internal/swiftpkg_build_files.bzl", line 198, column 40, in _clang_target_build_file
                "deps": bzl_selects.to_starlark(deps),
        File "/private/var/tmp/_bazel_logan/9c5dc880d421e060978209038345ac60/external/cgrindel_swift_bazel/swiftpkg/internal/bzl_selects.bzl", line 193, column 13, in _to_starlark
                fail("""\
Error in fail: No Starlark expression members were generated for [struct(condition = None, kind = "_target_dep", value = [])]
ERROR: /Users/logan/Developer/Swift/Apps/Snag/WORKSPACE:53:19: fetching swift_package rule //external:swiftpkg_firebase_ios_sdk: Traceback (most recent call last):
        File "/private/var/tmp/_bazel_logan/9c5dc880d421e060978209038345ac60/external/cgrindel_swift_bazel/swiftpkg/internal/swift_package.bzl", line 65, column 31, in _swift_package_impl
                repo_rules.gen_build_files(repository_ctx, pkg_info)
        File "/private/var/tmp/_bazel_logan/9c5dc880d421e060978209038345ac60/external/cgrindel_swift_bazel/swiftpkg/internal/repo_rules.bzl", line 78, column 55, in _gen_build_files
                bld_file = swiftpkg_build_files.new_for_target(repository_ctx, pkg_ctx, target)
        File "/private/var/tmp/_bazel_logan/9c5dc880d421e060978209038345ac60/external/cgrindel_swift_bazel/swiftpkg/internal/swiftpkg_build_files.bzl", line 21, column 40, in _new_for_target
                return _clang_target_build_file(repository_ctx, pkg_ctx, target)
        File "/private/var/tmp/_bazel_logan/9c5dc880d421e060978209038345ac60/external/cgrindel_swift_bazel/swiftpkg/internal/swiftpkg_build_files.bzl", line 198, column 40, in _clang_target_build_file
                "deps": bzl_selects.to_starlark(deps),
        File "/private/var/tmp/_bazel_logan/9c5dc880d421e060978209038345ac60/external/cgrindel_swift_bazel/swiftpkg/internal/bzl_selects.bzl", line 193, column 13, in _to_starlark
                fail("""\
Error in fail: No Starlark expression members were generated for [struct(condition = None, kind = "_target_dep", value = [])]
ERROR: /Users/logan/Developer/Swift/Apps/Snag/Services/Sources/BUILD:59:8: //Services/Sources:AnalyticsServiceImplementation depends on @swiftpkg_firebase_ios_sdk//:SwiftPM-PlatformExclude_FirebaseAnalyticsWithoutAdIdSupportWrap_FirebaseAnalyticsWithoutAdIdSupportTarget in repository @swiftpkg_firebase_ios_sdk which failed to fetch. no such package '@swiftpkg_firebase_ios_sdk//': No Starlark expression members were generated for [struct(condition = None, kind = "_target_dep", value = [])]
ERROR: Analysis of target '//Services/Sources:AnalyticsServiceImplementation' failed; build aborted: Analysis failed
INFO: Elapsed time: 6.330s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets configured)
logan@Logans-MBP Snag % 

In my build file I'm depending on:

"@swiftpkg_firebase_ios_sdk//:SwiftPM-PlatformExclude_FirebaseAnalyticsWithoutAdIdSupportWrap_FirebaseAnalyticsWithoutAdIdSupportTarget",

And in my Package.swift I have:

.package(url: "https://github.com/firebase/firebase-ios-sdk", .upToNextMajor(from: "10.0.0")),

It should be noted that I'm using a newer version of the firebase SDK than the one in your example.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions