firebase / FirebaseUI-iOS

iOS UI bindings for Firebase.
Apache License 2.0
1.5k stars 471 forks source link

Multitude of warnings after updating to XCode 8.3 #271

Closed oviroa closed 7 years ago

oviroa commented 7 years ago

35 issues appeared after updating to XCode 8.3, similar to the one below:

ld: warning: pointer not aligned at address 0x1002FA73F (_firanalytics_PropertyFilter_fields + 79 from /Users/myUser/Documents/workspace/BestShot/Motion.git/trunk/Motion-Apple/BestShot/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/FirebaseAnalytics(gmp_audience.pb_f393ced1a3b55a03cc2eea8de166e335.o))

morganchen12 commented 7 years ago

This is a known issue that's from upstream Firebase; I'll let you know when they make any progress.

DevAndArtist commented 7 years ago

I'm hitting 32 of these warnings, it's kinda annoying. The issue came up during Xcode 8.3 Beta. You guys need quite a while for this to fix. 🤔

morganchen12 commented 7 years ago

This has been fixed internally and should go out in the next release, around 4/6. You can all relax now. :)

Tr736 commented 7 years ago

any idea when this fix will be released today?

morganchen12 commented 7 years ago

The launch has been moved back a few days; expect it at the start of next week. (oops)

llcoole93 commented 7 years ago

Thank god this is being fixed... I thought something just started blowing up for no reason. Thanks for the thread

umeshchand1507 commented 7 years ago

I'm still seeing same 32 build time warnings with Xcode 8.3.

oliverdowling commented 7 years ago

Is it safe to ignore the warnings for an App Store release, or should I wait until an update is available?

enzosterro commented 7 years ago

Oh, boy. I have 39 warning with xCode 8.3.

DevAndArtist commented 7 years ago

@enzosterro I have 64 of them, because of multiple targets 😜 Btw. it's Xcode.

googoodalls commented 7 years ago

Any progress? I met this issue with firebase CocoaPods Today on Xcode 8.3.1 official release, I believe I am using the latest firebase.

matmartinez commented 7 years ago

When is "start of next week" again? I literally can't wait.

morganchen12 commented 7 years ago

Hm, I don't have any new information for you folks other than to say the release is coming soon. Will post more stuff if anything comes up, but it looks like we've just been a little slow on some ship blockers.

DevAndArtist commented 7 years ago

Besides the fact that Firebase JS, NodeJS, Java and Python gets updated frequently, but Swift/ObjC takes ages. 🤔

mthormann-dhi commented 7 years ago

Have version numbers regressed or is the current pod update incorrect? The Firebase pod seems to have changed today. I'm seeing the main Firebase pod reverting to 3.6.0 from 3.15.0, FirebaseRemoteConfig reverting to 1.3.0 from 1.3.4, and FirebaseAnalytics reverting to 3.4.2 from 3.7.0. Some of the old removed pods are now back as well (GoogleIphoneUtilities, etc.). I've cleaned my pod cache, etc. and have been checking for updates for this issue.

This is all with the recommended settings below for Analytics and RemoteConfig.

pod 'Google/Analytics'
pod 'Firebase/RemoteConfig'
esetnik commented 7 years ago

Beware updating Firebase to v3.16.0. It is crashing my app unit tests. I had to revert to v3.15.0

@mthormann-dhi according to the firebase documentation you should use:

pod 'Firebase/Core'
pod 'Firebase/RemoteConfig'

It looks like they released a new update to Firebase v3.16.0 https://github.com/CocoaPods/Specs/commit/dddbd3e6897df269b4e97b2e6d8c1aae145fbed4

mthormann-dhi commented 7 years ago

Not seeing the issue from yesterday with bad pod update specs out there but seeing the same crash with 3.16.0 as @esetnik trying to run unit tests with Firebase 3.16.0. More specifics on the error.

Error 2017-04-13 09:19:13.418 EFCSeeker[55062:5088991] *** Terminating app due to uncaught exception 'com.firebase.instanceid', reason: 'Could not configure Firebase InstanceID. Google Sender ID must not be nil or empty.'

*** First throw call stack:
(
    0   CoreFoundation                      0x0000000110aadb0b __exceptionPreprocess + 171
    1   libobjc.A.dylib                     0x00000001153c1141 objc_exception_throw + 48
    2   CoreFoundation                      0x0000000110b16625 +[NSException raise:format:] + 197
    3   EFCSeekerTests                      0x000000012aaff1be +[FIRInstanceID(FIRApp) exitApp:withReason:] + 188
    4   EFCSeekerTests                      0x000000012aafef90 -[FIRInstanceID(FIRApp) configureInstanceIDWithApp:] + 451
    5   EFCSeekerTests                      0x000000012aafed9e +[FIRInstanceID(FIRApp) didReceiveConfigureSDKNotification:] + 151
    6   CoreFoundation                      0x0000000110a4cc2c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
    7   CoreFoundation                      0x0000000110a4cb29 _CFXRegistrationPost + 425
    8   CoreFoundation                      0x0000000110a4c892 ___CFXNotificationPost_block_invoke + 50
    9   CoreFoundation                      0x0000000110a10162 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1826
    10  CoreFoundation                      0x0000000110a0f2c1 _CFXNotificationPost + 673
    11  Foundation                          0x0000000114e8fb24 -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
    12  EFCSeeker                           0x000000010f71133a +[FIRApp sendNotificationsToSDKs:] + 381
    13  EFCSeeker                           0x000000010f7100bc +[FIRApp configureDefaultAppWithOptions:sendingNotifications:] + 341
    14  EFCSeeker                           0x000000010f70fdb4 +[FIRApp configure] + 306
morganchen12 commented 7 years ago

FIRInstanceID expects a valid GCM Sender ID in the options of the FIRApp instance your app is using, which is normally grabbed from your GoogleService-Info.plist file. How are you setting up your unit tests?

If you don't want to mess with configuring your tests until later, you can just pin your FirebaseMessaging dependency at 1.2.2 and upgrade later.

Going to close this issue now as the discussion has derailed a bit and the ld warnings from Analytics are now gone.

nickvelloff commented 7 years ago

ld warnings from Analytics are now gone.

Fresh project, fresh pod install and I get the 39 warning in Xcode 8.3. Should I be pointing to something specifically not yet released?

morganchen12 commented 7 years ago

Have you run pod repo update lately?

If so, what version of Firebase does CocoaPods say you're using? What CocoaPods version are you using?

Have you tried cleaning in Xcode or deleting DerivedData?

nickvelloff commented 7 years ago

@morganchen12 apologies... just realized my local pod repo was out of date. No more warnings. Thanks!

DevAndArtist commented 7 years ago

Same here, latest version is crashing the unit tests.

import UIKit
import Firebase

@UIApplicationMain
final class ApplicationDelegate : UIResponder, UIApplicationDelegate {

    // From `UIApplicationDelegate`
    var window: UIWindow?

    override init() {

        // Configure Firebase
        FIRApp.configure()  // <===== Will crash here

        super.init()
    }
}

In a unit test file

import XCTest
@testable import ModuleName

Pressing cmd + u will result into a crash like already described by @esetnik and @mthormann-dhi.

🤦🏻‍♂️

mthormann-dhi commented 7 years ago

@DevAndArtist In my case, it's probably what @morganchen12 hinted at. We swap out different GoogleService-info.plist files (per configuration) with a build script in Build Phases for our app targets. That build script phase doesn't exist on my test targets but previously never threw an error. Going to copy to my test targets when I get a chance to see if that does the trick. It should I think.

mthormann-dhi commented 7 years ago

@DevAndArtist @morganchen12 Something has definitely changed with 3.16.0 with where Firebase is looking for the GoogleService-info.plist file for test targets (or maybe it just wasn't before for test targets). I see the GoogleService-info.plist file being put as normal into the .app that the test target is running against. Anyways I've hacked around it until I have more time to research by bypassing the FIRApp.configure() call while running unit tests (with a simple scheme argument). I do have the Firebase pods installed for my test targets as well so maybe I can remove those at some point (just install Firebase pod for the main app) to fix this issue as well.

nickvelloff commented 7 years ago

with where Firebase is looking for the GoogleService-info.plist file for test targets

I do believe the docs state that the GoogleService-info.plist should be added to all targets.

morganchen12 commented 7 years ago

If you're running into the tests issue with updated Firebase I'd encourage you make sure the GoogleService-Info.plist file is in your test bundle and not just your main app bundle. If for whatever reason you don't want to duplicate the plist file in your test bundle, take a look at FIROptions.init(contentsOfFile:) and FIRApp.configure(with:).

This is no longer a FirebaseUI issue and so this isn't really the right place to discuss this--please at the very least read all the comments and do some digging before posting something.

DevAndArtist commented 7 years ago

@morganchen12 I'm aware that this isn't the place for filing these issues. However there isn't a better place on https://github.com/firebase/ for these type of issues, because there is no repository for the iOS projects. The Slack channel isn't a better alternative, because everything is unstructured and no one would ever search through a humongous messaging stream.

You guys should consider open a repo exactly for that matter. Similar to what Realm does for it's Mobile Platform, even if it's closed source project.

https://github.com/realm/realm-mobile-platform

Thanks. ;)

LordAndrei commented 7 years ago

FWIW: I did a pod update and all warnings have happily vanished. Installing Firebase 3.16.0 (was 3.15.0) Installing FirebaseAnalytics 3.8.0 (was 3.7.0) Installing FirebaseCore 3.6.0 (was 3.5.2) Installing FirebaseInstanceID 1.0.10 (was 1.0.9) Installing FirebaseMessaging 1.2.3 (was 1.2.2)

mthormann-dhi commented 7 years ago

@morganchen12 I concur with @DevAndArtist. Please tell us where to discuss this if this isn't the place. I'm still running into the exact same issue loading a valid FIROptions file or even the individual options (which should make all the test bundle stuff moot, right?) overload on init. I verified the GCM Sender ID exists in the FIROptions as well before the FIRApp.configure(with:) call. I'd be happy to take this conversation elsewhere. Just need to know where please.

Thanks a ton!

morganchen12 commented 7 years ago

Yeah, that's why I'm answering the questions here :)

In the future there will be a better place for this sort of discussion, but this is deliberately vague because I can't talk about it until it happens. Stay tuned!

@mthormann-dhi InstanceID will look for a valid GCM sender ID in every FIRApp that's configured. Are you configuring more than one FIRApp?

mthormann-dhi commented 7 years ago

@morganchen12 Thanks for sticking with this :)

No, just one time per app launch. Our app is multi-tenant (supporting different app targets) with multiple configurations but we only call FIRApp.configure once per app launch (with one .plist) in appDidFinishLaunching. The error is happening even with the explicit FIRApp.configure call (with sender ID and every parameter correctly filled in except for our unused androidClientID and deepLinkURLScheme).

morganchen12 commented 7 years ago

If you set an exception breakpoint and print out [FIROptions defaultOptions].GCMSenderID, what does it say?

mthormann-dhi commented 7 years ago

▿ Optional

morganchen12 commented 7 years ago

This is most likely a bug on our end, I've let the Instance ID team know and will keep this updated.

mthormann-dhi commented 7 years ago

Thanks!

ghost commented 7 years ago

3.16 Fixed all the warnings on the simulator, however when archiving I'm getting similar errors.

I built a fresh Xcode project only configuring Firebase and the warnings only occur after installing 'Firebase/AdMob'. I tried some things with linking binaries with libraries with no luck. Also in a timely fashion this popped up on the Apple forums a few days ago https://forums.developer.apple.com/thread/75793 . Same warnings, makes me think this whole thing might be related and if it's not I'm sorry, i'm new to this.

richardbradshaw1 commented 7 years ago

Had 39 Warnings. Pod Update cleared them all.

Analyzing dependencies Downloading dependencies Installing Firebase 3.16.0 (was 3.14.0) Installing FirebaseAnalytics 3.8.0 (was 3.7.0) Using FirebaseAuth (3.1.1) Installing FirebaseCore 3.6.0 (was 3.5.1) Using FirebaseDatabase (3.1.2) Installing FirebaseInstanceID 1.0.10 (was 1.0.9) Using FirebaseStorage (1.1.0) Installing GTMSessionFetcher 1.1.9 (was 1.1.8) Using GoogleToolboxForMac (2.1.1)

DevAndArtist commented 7 years ago

@morganchen12 Did you guys solved the issue? Either you did or deleting the .xcworkspace file and de-integrating all pods and re-integrating them solved the issue for me. My GoogleService-Info.plist is not linked to my unit test target at all.

esetnik commented 7 years ago

@DevAndArtist no I had to revert to 3.15.0. I have GoogleService-Info.plist in my test target and it still crashes. Something definitely changed.

morganchen12 commented 7 years ago

No progress yet.

DevAndArtist commented 7 years ago

@esetnik I had a few issues to fix:

How I solved the issue.

FRAMEWORK_SEARCH_PATHS = "$PODS_CONFIGURATION_BUILD_DIR/RxCocoa"
HEADER_SEARCH_PATHS = ${PODS_ROOT}/Firebase/Core/Sources

First line fixed the issue with RxCocoa. Second line the issue with Firebase.

My pod file:

# Uncomment the next line to define a global platform 
# for your project
platform :ios, '10.0'

abstract_target 'project' do

  # Comment the next line if you're not using Swift and 
  # don't want to use dynamic frameworks
  use_frameworks!

  pod 'Firebase/Core'
  pod 'Firebase/Auth'
  pod 'Firebase/Analytics'
  pod 'Firebase/Database'

  # pod 'Firebase/AdMob'
  # pod 'Firebase/AppIndexing'
  # pod 'Firebase/Crash'
  # pod 'Firebase/DynamicLinks'
  # pod 'Firebase/Invites'
  # pod 'Firebase/Messaging'
  # pod 'Firebase/RemoteConfig'
  # pod 'Firebase/Storage'

  pod 'RxSwift', '~> 3.0'
  pod 'RxCocoa', '~> 3.0'
  pod 'RxSwiftExt', '~> 2.0'
  pod 'FunctionalLayout', '~> 1.0'
  pod 'Reveal-SDK', :configurations => ['Debug']

  target 'production' do
    # The target 'production' has its own copies of all 
    # pods from abstract target 'project' (inherited)
  end

  target 'development' do
    # The target 'development' has its own copies of all 
    # pods from abstract target 'project' (inherited)
  end

  target 'unitTests' do
    inherit! :search_paths
    # Pods for testing
  end

  target 'uiTests' do
    inherit! :search_paths
    # Pods for testing
  end
end

Result:

Profit :)

francoisduchemin commented 7 years ago

I still have 3 issues when archiving: Linker asked to preserve internal global: 'sharedInstance.sharedInstance' Linker asked to preserve internal global: 'block_descriptor_tmp' Linker asked to preserve internal global: 'block_literal_global'

54lihaoxin commented 7 years ago

With the latest 3.16 upgrade on Xcode 8.3.1, all warnings are gone, but unit test always crash.

2017-04-14 14:53:22.351 MyProject[28753] <Error> [Firebase/Core][I-COR000004] App with name __FIRAPP_DEFAULT does not exist. 2017-04-14 14:53:22.354 MyProject[28753] <Error> [Firebase/Messaging][I-IID001000] Firebase is not set up correctly. Sender ID is nil or empty. 2017-04-14 14:53:22.356 MyProject[28753] <Notice> [Firebase/Analytics][I-ACS023007] Firebase Analytics v.3800000 started 2017-04-14 14:53:22.356 MyProject[28753] <Notice> [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled 2017-04-14 14:53:22.381 MyProject[28753:712475] *** Terminating app due to uncaught exception 'com.firebase.instanceid', reason: 'Could not configure Firebase InstanceID. Google Sender ID must not be nil or empty.'

See StackOverflow here: http://stackoverflow.com/questions/43412066/firebase-configuration-fails-swift/43415184#

Boggartfly commented 7 years ago

Everything works in debug mode. When I archive I get the same warnings as @54lihaoxin

alexandrahably commented 7 years ago

I am running into the same issue as @DevAndArtist mentioned. Unit tests target stops at FIRApp.configure(). I tried all options mentioned above to resolve my issue, none of them worked.

morganchen12 commented 7 years ago

For those of you running into crashes, do you also have the

[Firebase/Core][I-COR000004] App with name __FIRAPP_DEFAULT does not exist.

line in your error logs?

alexandrahably commented 7 years ago

@morganchen12 Exactly, I do have it.

alexandrahably commented 7 years ago

I downgraded my project to '3.15.0', everything works fine. With '3.16.0' I had problems with the unit tests target and even in the main app target during runtime.

morganchen12 commented 7 years ago

Can you upload a sample project that has this issue? Also, when you run your app, are there warnings in console of duplicate class implementations?

54lihaoxin commented 7 years ago

Let me ask one thing for those who have unit test crashes with 3.16/3.17:

Did you rename GoogleService-Info.plist to something else and configure Firebase with FIRApp.configure(with: FIROptions(contentsOfFile: configFilePath))

I did this because I have multiple build targets so I suffix the filenames with corresponding bundle ID. It actually works (for analytics and remote config stuff), but I am seeing the following console log with -FIRDebugEnabled in argument (https://firebase.google.com/docs/analytics/debugview)

2017-05-09 10:32:51.554 FirebaseDemo[43232] <Error> [Firebase/Core][I-COR000012] Could not locate configuration file: 'GoogleService-Info.plist'.
2017-05-09 10:32:51.556 FirebaseDemo[43232] <Debug> [Firebase/Analytics][I-ACS024000] Debug mode is on
2017-05-09 10:32:51.556 FirebaseDemo[43232] <Error> [Firebase/Analytics][I-ACS020006] Google App ID from GoogleService-Info.plist is empty. Please, define GOOGLE_APP_ID in GoogleService-Info.plist for Analytics to work reliably.
2017-05-09 10:32:51.560 FirebaseDemo[43232] <Warning> [Firebase/Analytics][I-ACS005000] The AdSupport Framework is not currently linked. Some features will not function properly. Learn more at http://goo.gl/9vSsPb
2017-05-09 10:32:51.561 FirebaseDemo[43232] <Info> [Firebase/Messaging][I-IID013010] InstanceID library version 1.0.10
2017-05-09 10:32:51.562 FirebaseDemo[43232] <Error> [Firebase/Analytics][I-ACS025020] Analytics requires Google App ID from GoogleService-Info.plist. Your data may be lost. Google App ID has been changed. Original, new ID: (nil), 1:892880578787:ios:804d980568a1434e
2017-05-09 10:32:51.630 FirebaseDemo[43232] <Notice> [Firebase/Analytics][I-ACS023007] Firebase Analytics v.3900000 started

This inspired me to keep one config file with the original name GoogleService-Info.plist, and then unit test is not crashing again.

It seems to me Firebase fails to create a default instance with the config file in the default name GoogleService-Info.plist.