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

Undefined symbol: _OBJC_CLASS_$_GULAppEnvironmentUtil

Open khoogheem opened this issue 5 years ago • 42 comments

[REQUIRED] Step 1: Describe your environment

  • Xcode version: 12.2
  • Firebase SDK version: 8.9
  • Installation method: CocoaPods)
  • Firebase Component: Crashlytiics

[REQUIRED] Step 2: Describe the problem

Undefined symbol: OBJC_CLASS$_GULAppEnvironmentUtil

Steps to reproduce:

Build using 8.0.0

Screen Shot 2021-05-23 at 12 07 41 PM

khoogheem avatar May 23 '21 17:05 khoogheem

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

google-oss-bot avatar May 23 '21 17:05 google-oss-bot

Thanks for reporting, @khoogheem. Can you share the detailed steps reproducing the issue? Also, a pod update may be required to ensure all recent dependencies are being pulled in. Thanks.

rizafran avatar May 24 '21 13:05 rizafran

Pod updated project all Firebase were set to 8.0.0 Clean project Build project

khoogheem avatar May 24 '21 13:05 khoogheem

Can you share your Podfile.lock?

morganchen12 avatar May 24 '21 17:05 morganchen12

Also, are you building with use_frameworks! and not using :linkage => :static?

morganchen12 avatar May 24 '21 22:05 morganchen12

Correct

Sent from your iPhone

On May 24, 2021, at 5:49 PM, Morgan Chen @.***> wrote:

 Also, are you building with use_frameworks! and not using :linkage => :static?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

khoogheem avatar May 25 '21 10:05 khoogheem

this is what we add in:

def firebase
  # Add the pod for Firebase Crashlytics
  pod 'Firebase/Crashlytics'
  # add the Firebase pod for Google Analytics
  pod 'Firebase/Analytics'
  # Firebase Performance
  pod 'Firebase/Performance'
  # add pods for any other desired Firebase products
  # https://firebase.google.com/docs/ios/setup#available-pods
end

khoogheem avatar May 25 '21 12:05 khoogheem

Can you share the full build log output? It's likely this is occurring in a submodule of your app (i.e. one of your dependencies) and not the app itself.

morganchen12 avatar May 25 '21 15:05 morganchen12

Ld /Users/xxx/Library/Developer/Xcode/DerivedData/project-esgmvpqlktgtvldltqmcjtupefnh/Build/Products/Debug-iphonesimulator/FirebaseCrashlytics/FirebaseCrashlytics.framework/FirebaseCrashlytics normal (in target 'FirebaseCrashlytics' from project 'Pods')
    cd /Users/xxx/Developer/xxx/ios-content-app/Pods
    /Applications/Xcode_12_2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -target x86_64-apple-ios13.0-simulator -dynamiclib -isysroot /Applications/Xcode_12_2.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.2.sdk -L/Users/xxx/Library/Developer/Xcode/DerivedData/project-esgmvpqlktgtvldltqmcjtupefnh/Build/Products/Debug-iphonesimulator/FirebaseCrashlytics -F/Users/xxx/Library/Developer/Xcode/DerivedData/project-esgmvpqlktgtvldltqmcjtupefnh/Build/Products/Debug-iphonesimulator/FirebaseCrashlytics -F/Users/xxx/Library/Developer/Xcode/DerivedData/project-esgmvpqlktgtvldltqmcjtupefnh/Build/Products/Debug-iphonesimulator/FirebaseCore -F/Users/xxx/Library/Developer/Xcode/DerivedData/project-esgmvpqlktgtvldltqmcjtupefnh/Build/Products/Debug-iphonesimulator/FirebaseCoreDiagnostics -F/Users/xxx/Library/Developer/Xcode/DerivedData/project-esgmvpqlktgtvldltqmcjtupefnh/Build/Products/Debug-iphonesimulator/FirebaseInstallations -F/Users/xxx/Library/Developer/Xcode/DerivedData/project-esgmvpqlktgtvldltqmcjtupefnh/Build/Products/Debug-iphonesimulator/GoogleDataTransport -F/Users/xxx/Library/Developer/Xcode/DerivedData/project-esgmvpqlktgtvldltqmcjtupefnh/Build/Products/Debug-iphonesimulator/GoogleUtilities -F/Users/xxx/Library/Developer/Xcode/DerivedData/project-esgmvpqlktgtvldltqmcjtupefnh/Build/Products/Debug-iphonesimulator/PromisesObjC -F/Users/xxx/Library/Developer/Xcode/DerivedData/project-esgmvpqlktgtvldltqmcjtupefnh/Build/Products/Debug-iphonesimulator/nanopb -filelist /Users/xxx/Library/Developer/Xcode/DerivedData/project-esgmvpqlktgtvldltqmcjtupefnh/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FirebaseCrashlytics.build/Objects-normal/x86_64/FirebaseCrashlytics.LinkFileList -install_name @rpath/FirebaseCrashlytics.framework/FirebaseCrashlytics -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/xxx/Library/Developer/Xcode/DerivedData/project-esgmvpqlktgtvldltqmcjtupefnh/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FirebaseCrashlytics.build/Objects-normal/x86_64/FirebaseCrashlytics_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -stdlib\=libc++ -fobjc-arc -fobjc-link-runtime -lc++ -lz -framework Security -framework SystemConfiguration -framework FBLPromises -framework FirebaseCore -framework FirebaseInstallations -framework Foundation -framework GoogleDataTransport -framework nanopb -framework Security -framework SystemConfiguration -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/xxx/Library/Developer/Xcode/DerivedData/project-esgmvpqlktgtvldltqmcjtupefnh/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FirebaseCrashlytics.build/Objects-normal/x86_64/FirebaseCrashlytics_dependency_info.dat -o /Users/xxx/Library/Developer/Xcode/DerivedData/project-esgmvpqlktgtvldltqmcjtupefnh/Build/Products/Debug-iphonesimulator/FirebaseCrashlytics/FirebaseCrashlytics.framework/FirebaseCrashlytics

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_GULAppEnvironmentUtil", referenced from:
      objc-class-ref in FIRCLSApplication.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

khoogheem avatar May 25 '21 16:05 khoogheem

if you want the lock file send me an email that I can sent it too.. vs posting here

khoogheem avatar May 25 '21 16:05 khoogheem

Ok.. if I use:

   pod 'Firebase'
  pod 'Firebase/Crashlytics'
  # add the Firebase pod for Google Analytics
  pod 'Firebase/Analytics'
  # Firebase Performance
  pod 'Firebase/Performance'

Then it works... which is odd as the only thing I see different between the two locks is core and analytics are swapped and after I remove it it works as well.. so I am not sure what is going on...

khoogheem avatar May 25 '21 18:05 khoogheem

You should be able to fix this temporarily by going to your Pods.xcodeproj project and adding the GoogleUtilities framework to the FirebaseCrashlytics target's Link Binary with Libraries build phase.

A more permanent fix may need to come from CocoaPods or Firebase; some further investigation is required.

morganchen12 avatar May 25 '21 18:05 morganchen12

Same

  pod 'Firebase/AnalyticsWithoutAdIdSupport'
  pod 'Firebase/Crashlytics'
  pod 'Firebase/Messaging'

andreyoshev avatar Jun 01 '21 20:06 andreyoshev

Had the same issue, XCode -> Product -> Clean Build Folder fixed it.

fmalekpour avatar Jun 01 '21 22:06 fmalekpour

Marking as needs-info for a repro case from a clean build environment

paulb777 avatar Jun 01 '21 23:06 paulb777

Had the same issue, XCode -> Product -> Clean Build Folder fixed it.

Thank you, I was building an an IOS version of my Flutter App. After Running in Android Studio I stopped the run and Switched to Xcode to run the App and saw the error. This fixed it for me

tessSnap avatar Jun 03 '21 13:06 tessSnap

Just a quick add on that I'm seeing the same problem. I updated all my gems, I went through and updated my Podfile (because I was still using the pre-iOS 14 stuff) and I'm seeing this issue.

Here's my current Podfile:

platform :ios, '11.0'

pod 'Firebase' pod 'Firebase/Crashlytics' pod 'Firebase/Analytics' pod 'Firebase/Performance'

pod 'Google-Mobile-Ads-SDK'

I added the "pod 'Firebase'" because that seemed to be a difference but there was no change. I was receiving the error before I added that.

I've cleaned and rebuilt - several times - and this error is persisting.

Not sure what else to do at this point. Thanks.

billdevoe avatar Jun 07 '21 01:06 billdevoe

Not sure what else to do at this point. Thanks.

Here's the Podfile.lock in case it helps:

PODS:

  • Firebase (8.1.0):
    • Firebase/Core (= 8.1.0)
  • Firebase/Core (8.1.0):
    • Firebase/CoreOnly
    • FirebaseAnalytics (~> 8.1.0)
  • Firebase/CoreOnly (8.1.0):
    • FirebaseCore (= 8.1.0)
  • FirebaseAnalytics (8.1.0):
    • FirebaseAnalytics/AdIdSupport (= 8.1.0)
    • FirebaseCore (~> 8.0)
    • FirebaseInstallations (~> 8.0)
    • GoogleUtilities/AppDelegateSwizzler (~> 7.4)
    • GoogleUtilities/MethodSwizzler (~> 7.4)
    • GoogleUtilities/Network (~> 7.4)
    • "GoogleUtilities/NSData+zlib (~> 7.4)"
    • nanopb (~> 2.30908.0)
  • FirebaseAnalytics/AdIdSupport (8.1.0):
    • FirebaseAnalytics/Base (= 8.1.0)
    • FirebaseCore (~> 8.0)
    • FirebaseInstallations (~> 8.0)
    • GoogleAppMeasurement (= 8.1.0)
    • GoogleUtilities/AppDelegateSwizzler (~> 7.4)
    • GoogleUtilities/MethodSwizzler (~> 7.4)
    • GoogleUtilities/Network (~> 7.4)
    • "GoogleUtilities/NSData+zlib (~> 7.4)"
    • nanopb (~> 2.30908.0)
  • FirebaseAnalytics/Base (8.1.0):
    • FirebaseCore (~> 8.0)
    • FirebaseInstallations (~> 8.0)
    • GoogleUtilities/AppDelegateSwizzler (~> 7.4)
    • GoogleUtilities/MethodSwizzler (~> 7.4)
    • GoogleUtilities/Network (~> 7.4)
    • "GoogleUtilities/NSData+zlib (~> 7.4)"
    • nanopb (~> 2.30908.0)
  • FirebaseCore (8.1.0):
    • FirebaseCoreDiagnostics (~> 8.0)
    • GoogleUtilities/Environment (~> 7.4)
    • GoogleUtilities/Logger (~> 7.4)
  • FirebaseCoreDiagnostics (8.1.0):
    • GoogleDataTransport (~> 9.0)
    • GoogleUtilities/Environment (~> 7.4)
    • GoogleUtilities/Logger (~> 7.4)
    • nanopb (~> 2.30908.0)
  • FirebaseInstallations (8.1.0):
    • FirebaseCore (~> 8.0)
    • GoogleUtilities/Environment (~> 7.4)
    • GoogleUtilities/UserDefaults (~> 7.4)
    • PromisesObjC (~> 1.2)
  • Google-Mobile-Ads-SDK (8.5.0):
    • GoogleAppMeasurement (< 9.0, >= 7.0)
    • GoogleUserMessagingPlatform (>= 1.1)
  • GoogleAppMeasurement (8.1.0):
    • GoogleAppMeasurement/AdIdSupport (= 8.1.0)
    • GoogleUtilities/AppDelegateSwizzler (~> 7.4)
    • GoogleUtilities/MethodSwizzler (~> 7.4)
    • GoogleUtilities/Network (~> 7.4)
    • "GoogleUtilities/NSData+zlib (~> 7.4)"
    • nanopb (~> 2.30908.0)
  • GoogleAppMeasurement/AdIdSupport (8.1.0):
    • GoogleUtilities/AppDelegateSwizzler (~> 7.4)
    • GoogleUtilities/MethodSwizzler (~> 7.4)
    • GoogleUtilities/Network (~> 7.4)
    • "GoogleUtilities/NSData+zlib (~> 7.4)"
    • nanopb (~> 2.30908.0)
  • GoogleDataTransport (9.0.1):
    • GoogleUtilities/Environment (~> 7.2)
    • nanopb (~> 2.30908.0)
    • PromisesObjC (~> 1.2)
  • GoogleUserMessagingPlatform (2.0.0)
  • GoogleUtilities/AppDelegateSwizzler (7.4.1):
    • GoogleUtilities/Environment
    • GoogleUtilities/Logger
    • GoogleUtilities/Network
  • GoogleUtilities/Environment (7.4.1):
    • PromisesObjC (~> 1.2)
  • GoogleUtilities/Logger (7.4.1):
    • GoogleUtilities/Environment
  • GoogleUtilities/MethodSwizzler (7.4.1):
    • GoogleUtilities/Logger
  • GoogleUtilities/Network (7.4.1):
    • GoogleUtilities/Logger
    • "GoogleUtilities/NSData+zlib"
    • GoogleUtilities/Reachability
  • "GoogleUtilities/NSData+zlib (7.4.1)"
  • GoogleUtilities/Reachability (7.4.1):
    • GoogleUtilities/Logger
  • GoogleUtilities/UserDefaults (7.4.1):
    • GoogleUtilities/Logger
  • nanopb (2.30908.0):
    • nanopb/decode (= 2.30908.0)
    • nanopb/encode (= 2.30908.0)
  • nanopb/decode (2.30908.0)
  • nanopb/encode (2.30908.0)
  • PromisesObjC (1.2.12)

DEPENDENCIES:

  • Firebase
  • Google-Mobile-Ads-SDK

SPEC REPOS: trunk: - Firebase - FirebaseAnalytics - FirebaseCore - FirebaseCoreDiagnostics - FirebaseInstallations - Google-Mobile-Ads-SDK - GoogleAppMeasurement - GoogleDataTransport - GoogleUserMessagingPlatform - GoogleUtilities - nanopb - PromisesObjC

SPEC CHECKSUMS: Firebase: b5956acddaaa53a6c292bec00649fadd18367344 FirebaseAnalytics: e812eaae316ba8914b1ef06bef18f11efc1f56c6 FirebaseCore: 389c4ce9a7cce4a7e25eb22326b4bee0050557b2 FirebaseCoreDiagnostics: 3e249cee3de5c5f9cfd6cc2a19997231286fec11 FirebaseInstallations: 7f31798a8198c354eadcb87176d2090b62edc187 Google-Mobile-Ads-SDK: 6f5c41bf73db1656e5b203ba9c31e3d0899a128d GoogleAppMeasurement: 9ff7b9e23cced93a5a41736c09bdeb5b5b7fb111 GoogleDataTransport: 04c3e9a480bbcaa2ec3f5d27f1cdeb6a92f20c8d GoogleUserMessagingPlatform: ab890ce5f6620f293a21b6bdd82e416a2c73aeca GoogleUtilities: f8a43108b38a68eebe8b3540e1f4f2d28843ce20 nanopb: a0ba3315591a9ae0a16a309ee504766e90db0c96 PromisesObjC: 3113f7f76903778cf4a0586bd1ab89329a0b7b97

PODFILE CHECKSUM: 04b61b1dfa045b1367ca868c5bb7465e91960528

COCOAPODS: 1.10.1

billdevoe avatar Jun 07 '21 02:06 billdevoe

Who use flutter Don't add strings like pod 'Firebase/Analytics' to your podfile Add firebase_analytics to pubspec instead

VadimZhuk0v avatar Jun 13 '21 13:06 VadimZhuk0v

Hey @khoogheem. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot avatar Jun 18 '21 01:06 google-oss-bot