firebase / firebase-ios-sdk

Firebase SDK for Apple App Development
https://firebase.google.com
Apache License 2.0
5.58k stars 1.46k forks source link

Error when building for docker - IsAppEncrypted.h:22:9: fatal error: 'objc/objc.h' file not found #13157

Closed IvanovGeorge closed 3 months ago

IvanovGeorge commented 3 months ago

Description

Hello. I'm building a project based on Vapor with a Firebase real-time database inside. The project is essentially a swift package, with Firebase dependencies added as usual: .package(url: "https://github.com/firebase/firebase-ios-sdk", from: "10.27.0"), and target dependencies .product(name: "FirebaseDatabase", package: "firebase-ios-sdk"), Evrething works well on the local machine, but when I try to build a docker file using docker build. I got this error (full log below)

In the file included from /build/.build/checkouts/GoogleUtilities/Third_party/IsAppEncrypted/IsAppEncrypted.m:43:
4.130 /build/.build/checkouts/GoogleUtilities/third_party/IsAppEncrypted/Public/IsAppEncrypted.h:22:9: fatal error: file objc/objc.h not found

Is there a way to fix or work around this?

Reproducing the issue

No response

Firebase SDK Version

10.27.0

Xcode Version

15.4

Installation Method

Swift Package Manager

Firebase Product(s)

Database

Targeted Platforms

macOS

Relevant Log Output

[+] Building 5.9s (13/23)                                                                                                     
 => [internal] load .dockerignore                                                                                        0.2s
 => => transferring context: 58B                                                                                         0.2s
 => [internal] load build definition from Dockerfile                                                                     0.2s
 => => transferring dockerfile: 3.39kB                                                                                   0.2s
 => [internal] load metadata for docker.io/library/ubuntu:jammy                                                          0.6s
 => [internal] load metadata for docker.io/library/swift:5.10-jammy                                                      0.7s
 => [build  1/13] FROM docker.io/library/swift:5.10-jammy@sha256:ded3bdf39b1eb72198a9e0fb6102e98b9c30467fa9e70d5f7d17b4  0.0s
 => [internal] load build context                                                                                        0.7s
 => => transferring context: 1.19MB                                                                                      0.6s
 => [stage-1 1/5] FROM docker.io/library/ubuntu:jammy@sha256:19478ce7fc2ffbce89df29fea5725a8d12e57de52eb9ea570890dc5852  0.0s
 => CACHED [build  2/13] RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true     && apt-get -q u  0.0s
 => CACHED [build  3/13] WORKDIR /build                                                                                  0.0s
 => CACHED [build  4/13] COPY ./Package.* ./                                                                             0.0s
 => CACHED [build  5/13] RUN swift package resolve         $([ -f ./Package.resolved ] && echo "--force-resolved-versio  0.0s
 => CACHED [build  6/13] COPY . .                                                                                        0.0s
 => ERROR [build  7/13] RUN swift build -c release                 --static-swift-stdlib                 -Xlinker -ljem  4.3s
------                                                                                                                        
 > [build  7/13] RUN swift build -c release                 --static-swift-stdlib                 -Xlinker -ljemalloc:        
3.851 [1/1] Compiling plugin SwiftProtobufPlugin
3.851 Building for production...
4.100 [1/1155] Compiling p_x25519.c
4.111 [2/1155] Compiling p_rsa_asn1.c
4.130 In file included from /build/.build/checkouts/GoogleUtilities/third_party/IsAppEncrypted/IsAppEncrypted.m:43:
4.130 /build/.build/checkouts/GoogleUtilities/third_party/IsAppEncrypted/Public/IsAppEncrypted.h:22:9: fatal error: 'objc/objc.h' file not found
4.130 #import <objc/objc.h>
4.130         ^~~~~~~~~~~~~
4.130 1 error generated.
4.131 [3/1155] Compiling third-party-IsAppEncrypted IsAppEncrypted.m
4.132 [3/1155] Compiling file.c
4.133 [3/1155] Compiling kyber.c
4.221 [3/1155] Write swift-version-24593BA9C3E375BF.txt
------
Error: failed to fetch an image or build from source: error building: failed to solve: process "/bin/sh -c swift build -c release                 --static-swift-stdlib                 -Xlinker -ljemalloc" did not complete successfully: exit code: 1

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

Expand Package.resolved snippet
```json Replace this line with the contents of your Package.resolved. ```

If using CocoaPods, the project's Podfile.lock

Expand Podfile.lock snippet
```yml Replace this line with the contents of your Podfile.lock! ```
google-oss-bot commented 3 months ago

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

paulb777 commented 3 months ago

Sorry, but Firebase and its dependencies depend on the Objective C runtime.