dpa99c / cordova-plugin-firebasex

Cordova plugin for Google Firebase
MIT License
570 stars 460 forks source link

Build error with MacOS Monterey: building for iOS Simulator, but linking in object file built for iOS #678

Closed jpduckwo closed 2 years ago

jpduckwo commented 2 years ago

Bug report

CHECKLIST

Current behavior:

I have a new laptop which came with macOS Monterey, when I checkout the cordova-plugin-firebasex-test project and try and run ios it fails to build with the follow message. I have tried with system Ruby an cocoapods and also brew based Ruby and cocoapods all result in the same issue. I suspect something is changed with the latest xcode simulator that stops it from working.

We get the same issue for our own project.

ld: in /Users/joel/dev/cordova-plugin-firebasex-test/platforms/ios/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/GoogleSignIn(GIDEMMErrorHandler_3a47e13d8ca81b41e9cdb7ef5468004a.o), building for iOS Simulator, but linking in object file built for iOS, file '/Users/joel/dev/cordova-plugin-firebasex-test/platforms/ios/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/GoogleSignIn' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

buildlog.txt

Expected behavior: It compiles

Steps to reproduce: From macOS Monterey with Xcode Version 13.1 (13A1030d) follow the instructions from the test project

Screenshots NA

Environment information

iOS build issue:

Related code: NA

Console output

console output ``` See attached buildoutput.txt ```


**Other information:** NA
jpduckwo commented 2 years ago

Noting my processor is Apple Silicone M1 Pro (arm64)

Husnain-Asharf commented 2 years ago

Hi, can you check this link if it fix your issue. https://stackoverflow.com/questions/63607158/xcode-12-building-for-ios-simulator-but-linking-in-an-object-file-built-for-io

jpduckwo commented 2 years ago

Hi, I tried adding as follows:

image

I then get this error - I also tried removing and adding the plugin again

While building module 'Firebase' imported from /Users/joel/dev/cordova-plugin-firebasex-test/platforms/ios/FirebaseTest/Plugins/cordova-plugin-firebasex/FirebasePlugin.h:3:
In file included from <module-includes>:1:
/Users/joel/dev/cordova-plugin-firebasex-test/platforms/ios/Pods/Headers/Public/Firebase/Firebase.h:15:9: fatal error:
      'FirebaseCore/FirebaseCore.h' file not found
#import <FirebaseCore/FirebaseCore.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
In file included from /Users/joel/dev/cordova-plugin-firebasex-test/platforms/ios/FirebaseTest/Plugins/cordova-plugin-firebasex/AppDelegate+FirebasePlugin.m:2:
/Users/joel/dev/cordova-plugin-firebasex-test/platforms/ios/FirebaseTest/Plugins/cordova-plugin-firebasex/FirebasePlugin.h:3:9: fatal error:
      could not build module 'Firebase'
#import "Firebase.h"
 ~~~~~~~^~~~~~~~~~~~
2 errors generated.

** BUILD FAILED **

The following build commands failed:
    CompileC /Users/joel/Library/Developer/Xcode/DerivedData/FirebaseTest-esmrizpgqdrwkzdlcrdvatmslkcd/Build/Intermediates.noindex/FirebaseTest.build/Debug-iphonesimulator/FirebaseTest.build/Objects-normal/x86_64/FirebasePlugin.o /Users/joel/dev/cordova-plugin-firebasex-test/platforms/ios/FirebaseTest/Plugins/cordova-plugin-firebasex/FirebasePlugin.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'FirebaseTest' from project 'FirebaseTest')
    CompileC /Users/joel/Library/Developer/Xcode/DerivedData/FirebaseTest-esmrizpgqdrwkzdlcrdvatmslkcd/Build/Intermediates.noindex/FirebaseTest.build/Debug-iphonesimulator/FirebaseTest.build/Objects-normal/x86_64/AppDelegate+FirebasePlugin.o /Users/joel/dev/cordova-plugin-firebasex-test/platforms/ios/FirebaseTest/Plugins/cordova-plugin-firebasex/AppDelegate+FirebasePlugin.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'FirebaseTest' from project 'FirebaseTest')
(2 failures)
xcodebuild: Command failed with exit code 65
Husnain-Asharf commented 2 years ago

Please try following steps:

jpduckwo commented 2 years ago

Hey Husnain, I can successfully run the Archive for 'Any iOS Device' even without excluding the architectures. So I guess the problem is only with simulators. As soon as I switch back to a simulator I get the Firebase header compile issue.

Husnain-Asharf commented 2 years ago

You tried following steps ?

Please share your pod file data.

jpduckwo commented 2 years ago

Hey, I have tried all those step and I still get the header compile issue when trying to run on the simulator. Thanks for suggesting though. As a work around I'm testing directly to my phone rather than the simulator.

darshitmaniar commented 2 years ago

Hey Husnain, I can successfully run the Archive for 'Any iOS Device' even without excluding the architectures. So I guess the problem is only with simulators. As soon as I switch back to a simulator I get the Firebase header compile issue.

Yes, I am facing the same issue with simulators.

fabltd commented 2 years ago

Also facing the issue.

Its seems the issue is with Google Sign in. Verison 5.0.2 is being bundled and that doesn't support M1. Google have updated to 'GoogleSignIn', '6.0.2' this does support M1. Investigating if this fixes the simulator issue.

fabltd commented 2 years ago

changing to GoogleSignIn', '6.0.2' in plugin XML fixes the arm error but adds a new error:

ordova-plugin-firebasex/AppDelegate+FirebasePlugin.h:7:65: error: cannot find protocol declaration for 'GIDSignInDelegate' @interface AppDelegate (FirebasePlugin) <UIApplicationDelegate, GIDSignInDelegate, ASAuthorizationControllerDelegate, ASAuthorizationControllerPresent...

Any one any ideas?

mafeifan commented 2 years ago

same issue +1

mafeifan commented 2 years ago

@fabltd the latest version of GoogleSignIn is 6.1.0 have you testing it? https://cocoapods.org/pods/GoogleSignIn#changelog

moJiXiang commented 2 years ago

@fabltd Same issue, did you fix it?

jpike88 commented 2 years ago

GoogleSignIn 6.x is able to be built for simulator + m1 chip. However, a bit of code in this lib will need to be updated to use it. If nobody else will, I'll submit a PR within the next week. @dpa99c are you able to review/merge it? Screen Shot 2022-01-19 at 20 04 25

studioromeo commented 2 years ago

Hey folks. I saw this was included in 14.x.x of the plugin but still having this issue.

Pods/GoogleSymbolUtilities/Frameworks/frameworks/GoogleSymbolUtilities.framework/GoogleSymbolUtilities(overload.o), building for iOS Simulator, but linking in object file built for iOS

Did anyone else have this and get around it?

JustDoItSascha commented 2 years ago

I have the same error with 14.0.0

rkssaravanan12 commented 2 years ago

I have the same error with 14.0.0. We are getting below issue: in /cordova-plugin-firebasex-test/platforms/ios/Pods/GoogleSymbolUtilities/Frameworks/frameworks/GoogleSymbolUtilities.framework/GoogleSymbolUtilities(overload.o), building for iOS Simulator, but linking in object file built for iOS, file 'cordova-plugin-firebasex-test/platforms/ios/Pods/GoogleSymbolUtilities/Frameworks/frameworks/GoogleSymbolUtilities.framework/GoogleSymbolUtilities' for architecture arm64

jpduckwo commented 2 years ago

Hi @dpa99c is it possible to please re-open?

Same issue on 14.0.0 for me, unless there is a change I need to make for the pinned versions?

in xxx/cmj.pm.cordova-testupgrade/platforms/ios/Pods/GoogleSymbolUtilities/Frameworks/frameworks/GoogleSymbolUtilities.framework/GoogleSymbolUtilities(overload.o), building for iOS Simulator, but linking in object file built for iOS, file 'xxx/cmj.pm.cordova-testupgrade/platforms/ios/Pods/GoogleSymbolUtilities/Frameworks/frameworks/GoogleSymbolUtilities.framework/GoogleSymbolUtilities' for architecture arm64`
      "cordova-plugin-firebasex": {
        "IOS_STRIP_DEBUG": "true",
        "FIREBASE_ANALYTICS_COLLECTION_ENABLED": "false",
        "FIREBASE_PERFORMANCE_COLLECTION_ENABLED": "false",
        "FIREBASE_CRASHLYTICS_COLLECTION_ENABLED": "false",
        "ANDROID_ICON_ACCENT": "#FF00FFFF",
        "ANDROID_FIREBASE_PERFORMANCE_MONITORING": "false",
        "ANDROID_PLAY_SERVICES_TAGMANAGER_VERSION": "17.0.0",
        "ANDROID_PLAY_SERVICES_AUTH_VERSION": "19.0.0",
        "ANDROID_FIREBASE_ANALYTICS_VERSION": "19.0.0",
        "ANDROID_FIREBASE_MESSAGING_VERSION": "22.0.0",
        "ANDROID_FIREBASE_CONFIG_VERSION": "21.0.0",
        "ANDROID_FIREBASE_PERF_VERSION": "20.0.2",
        "ANDROID_FIREBASE_AUTH_VERSION": "21.0.1",
        "ANDROID_FIREBASE_INAPPMESSAGING_VERSION": "20.0.0",
        "ANDROID_FIREBASE_FIRESTORE_VERSION": "23.0.2",
        "ANDROID_FIREBASE_FUNCTIONS_VERSION": "20.0.0",
        "ANDROID_FIREBASE_IID_VERSION": "21.1.0",
        "ANDROID_FIREBASE_INSTALLATIONS_VERSION": "17.0.0",
        "ANDROID_FIREBASE_CRASHLYTICS_VERSION": "18.1.0",
        "ANDROID_FIREBASE_CRASHLYTICS_NDK_VERSION": "18.1.0",
        "ANDROID_GSON_VERSION": "2.8.7",
        "ANDROID_FIREBASE_PERF_GRADLE_PLUGIN_VERSION": "1.4.0",
        "ANDROID_GRPC_OKHTTP": "1.32.2"
      },
jpike88 commented 2 years ago

I didn't have this issue on updating, works fine here. for those still with it pls ensure you flush caches, and re-initialise/rebuild your Cordova project

mleech commented 2 years ago

I'm also getting this issue. I'm on version '14.0.0-cli' running on an M1 Mac with Big Sur.

in xxx/platforms/ios/Pods/GoogleSymbolUtilities/Frameworks/frameworks/GoogleSymbolUtilities.framework/GoogleSymbolUtilities(overload.o), building for iOS Simulator, but linking in object file built for iOS, file 'xxx/platforms/ios/Pods/GoogleSymbolUtilities/Frameworks/frameworks/GoogleSymbolUtilities.framework/GoogleSymbolUtilities' for architecture arm64

I followed your advice @jpike88 and cleared the pod cache, deleted node_modules/, plugins/, and platforms/ and re-ran npm install and re-added the platforms, but am still getting the same issue.

jpike88 commented 2 years ago

Ok just realised the fix was for googlesignin, not googlesymbolutilities. Are you using another plugin that may be pulling that in?

mleech commented 2 years ago

I'm assuming it's FirebaseX that's pulling it in - I see a couple of people commenting above that also have the same error relating to GoogleSymbolUtilities

jpduckwo commented 2 years ago

My plugins are

      "cordova-plugin-statusbar": {},
      "cordova-universal-links-plugin": {},
      "cordova-plugin-device": {},
      "cordova-plugin-nativestorage": {},
      "cordova-plugin-inappbrowser": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-firebasex": {
...
      },
      "cordova-plugin-whitelist": {}
studioromeo commented 2 years ago

Not sure if this helps but I created a blank example repo of the issue https://github.com/studioromeo/cordova-firebase-example. It's a fresh cordova ios project with the firebase plugin installed.

Would be interested to hear if you folks find this works / does not work for you

jpduckwo commented 2 years ago

Hi @studioromeo, I gave the blank example repo a try and got the following error on build:

ld: in .../cordova-firebase-example/platforms/ios/Pods/GoogleSymbolUtilities/Frameworks/frameworks/GoogleSymbolUtilities.framework/GoogleSymbolUtilities(overload.o), building for iOS Simulator, but linking in object file built for iOS, file '.../cordova-firebase-example/platforms/ios/Pods/GoogleSymbolUtilities/Frameworks/frameworks/GoogleSymbolUtilities.framework/GoogleSymbolUtilities' for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

villeraikko commented 2 years ago

I'm also still experiencing this problem with version 14.0.0 with M1 processor when building for iOS simulator.

ld: in /Users//platforms/ios/Pods/GoogleSymbolUtilities/Frameworks/frameworks/GoogleSymbolUtilities.framework/GoogleSymbolUtilities(overload.o), building for iOS Simulator, but linking in object file built for iOS, file '/Users//platforms/ios/Pods/GoogleSymbolUtilities/Frameworks/frameworks/GoogleSymbolUtilities.framework/GoogleSymbolUtilities' for architecture arm64

stanislavworkacc commented 2 years ago

You can launch XCODE with Rosseta2. It works for me!!