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

177930107: Dynamic links trowing error

Open VladislavShergin opened this issue 4 years ago • 15 comments

Step 1: Environment details

  • Xcode version: 12.3 (12C33)
  • Firebase SDK version: - Firebase/Analytics (7.4.0): - Firebase/Core - Firebase/Auth (7.4.0): - Firebase/CoreOnly - FirebaseAuth (~> 7.4.0) - Firebase/Core (7.4.0): - Firebase/CoreOnly - FirebaseAnalytics (= 7.4.0)
  • Installation method: `CocoaPods
  • Firebase Component: Dinamic Links

[REQUIRED] Step 2: Problem details

There is an error appearing with the text: Thread 1: EXC_BAD_ACCESS (code-1, address=0x40925bac0) after integrating the Google Dinamic links into our project. We've tried different versions of Dinamic Links SDK, for example: v.7.4.0, 7.3.1, 4.0.0, 3.1.1, they are all showing the same error.

We've also tried to switch the FirebaseDeepLinkAutomaticRetrievalEnabled parameter to NO, after that the error is not appearing, however the feature stop work after that.

Screenshot attached: image

NOTE: The same problem has been opened in the link https://github.com/firebase/firebase-ios-sdk/issues/3945 before, however no-one resolved it after, due to the lack of the details the issue were closed.

VladislavShergin avatar Jan 18 '21 08:01 VladislavShergin

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 Jan 18 '21 08:01 google-oss-bot

Hi @VladislavShergin - sorry for the troubles you're seeing.

Do you have a set of steps that can be used to reproduce this? Does it reproduce in the Quickstart, or only in your project? Hopefully we'll be able to reproduce this and track it down this time.

Also is this happening in the simulator or on device? Any particular iOS version?

Thanks!

ryanwilson avatar Jan 18 '21 15:01 ryanwilson

Hi Ryan, first of all thank you very much for quick respond.

1 The exact reproducing steps are simple, we used Cocoa to integrate FirebaseDynamicLinks, right after it we press on RUN and it shows Thread and Crashing, project cannot proceed at this step.

2 This happening right in the Xcode with connected Simulator Device and Real Phone, both cases are showing this thread.

Additional info: We've found out other people have this problem also, and we found out that if we disable FirebaseDeepLinkAutomaticRetrievalEnabled with a value NO to the Info.plist the error is disappearing, unfortunately the whole feature stops working. The link for this method is https://github.com/firebase/firebase-ios-sdk/issues/4308

Screenshot: image

3 We would like to know for which features FirebaseDeepLinkAutomaticRetrievalEnabled is responsible exactly, it seems after we disable it it do not pass any data for Firebase. And there is no any additional information or guide to get whole explanation for this online.

Hope you can help us with this problem, it is very important for us to have this feature in our application.

VladislavShergin avatar Jan 19 '21 01:01 VladislavShergin

Dear Ryan, we also have additional question.

The main reason we've integrated Google Dynamic links is to get Source/Medium for tracking orders through the dynamic link. We would like to saw conversion of each order with Source/Medium in Google Analytics associated project. The project is directly connected to ur Firebase.

We've integrated Dynamic links in Android and it works perfectly, example screenshot: image And for the IOS we did the same, but data of the source and medium is not showing in any case, example screenshot: image As you can see from a screenshot for IOS, and as a result the source showing as (direct), we've followed all procedure explained on official site and youtube guide.

Our main goal is not to resolve a Thread for SDK, but to have the main source and medium regarding to the order in GA - conversions.

Please tell us is there any way to check or trace the medium/source for dynamic links or is there is something what we did wrong while implementing the feature.

Thank you.

VladislavShergin avatar Jan 19 '21 10:01 VladislavShergin

@VladislavShergin can you share a full stack trace and try to reproduce this crash in the quickstart?

morganchen12 avatar Jan 19 '21 16:01 morganchen12

I've tried in firebase-quick-start app and was not able to reproduce this issue.

Could you please try to reproduce this issue in our quick start app and let us know?

eldhosembabu avatar Jan 19 '21 20:01 eldhosembabu

I have a similar issue, same kind of exception but on the line 79 _wkWebView = [[WKWebView alloc] init]; of the file FIRDLJavaScriptExecutor.m.

This issue only happens when I compile with Xcode 12 for an iOS 11.X simulator. It works properly with an iOS 14.X simulator.

@VladislavShergin are you using an M1 mac ? Just tried on an Intel based mac and can't seem to reproduce.

Claes34 avatar Jan 20 '21 10:01 Claes34

Hi everyone, thank you very much for your respond. @Heidan34 @eldhosembabu @ryanwilson We found out that Dynamic Links SDK is conflicting with NewRelic's SDK, the NewRelic has a script file which blocks the Dynamic Links code and creating this issue. After we disable NewRelic the issue resolved, however In our situation we really need to use both NewRelic and Dynamic Links.

VladislavShergin avatar Jan 22 '21 01:01 VladislavShergin

I would like to emphasize that after we disable the NewRelic the issue was not found and the code started to work, however we are having an another issue now. We cannot get the source/medium regarding to the conversions in Google Analytics. I've created a separate issue, which linked here: https://github.com/firebase/firebase-ios-sdk/issues/7336

VladislavShergin avatar Jan 22 '21 01:01 VladislavShergin

@VladislavShergin Wow thanks! I spent a few hours today trying to figure this out and ended up working around it by commenting out the problem lines in the podfile. Using NewRelic in my project as well. I could have sworn it was working previously. Not sure if it was a version change in the pod that caused it to stop or what.

mobee-bill avatar Jan 27 '21 19:01 mobee-bill

I am seeing the exact same scenario as @Claes34, and I'm on M1. Any suggestions on how to resolve this?

asowers1 avatar Feb 04 '21 19:02 asowers1

@asowers1 unfortunatly this is a bug known to Apple that impact old simulators only. Apple should fix this someday... Keep big sur and xcode updated until it is

Claes34 avatar Feb 06 '21 18:02 Claes34

@Claes34 I am not on a simulator, and still running into this.

I've had to comment out line 121 in FIRDLJavaScriptExecutor.m.

image

nmalancea avatar Jul 21 '21 11:07 nmalancea

I've been having this same issue for weeks as well, and it's held us from releasing an implementation of DynamicLinks because we also absolutely need NewRelic.

We are using

pod 'Firebase/DynamicLinks', '~> 8.1'
pod 'NewRelicAgent', '7.3.2'

I tried adding the FirebaseDeepLinkAutomaticRetrievalEnabled = NO but even though this did prevent the crash, it also prevented the DynamicLinks from opening.

The solution that worked for us

Believe it or not, placing the NewRelic.start() call at the very top of didFinishLaunchingWithOptions made it work for me. It seems that somehow NewRelic and Firebase are competing for resources and NewRelic being initialized first makes them both work well.

This breaks

FirebaseApp.configure()
NewRelic.start("key")

This works

NewRelic.start("key")
FirebaseApp.configure()

Ironically, the NewRelic setup guide does warn that we absolutely must place their init code in the first line of didFinishLaunchingWithOptions unless we want bad things to happen. Apparently these are the bad things?

image

If you try this, i'd love to know if it works for you

@nmalancea tagging you because you seem to still be running into this!

tuliot avatar Jul 22 '21 06:07 tuliot

Just to share that I had the same issue/crash when adding the Firebase/DynamicLinks through Cocoapods, and the above suggestion about initialising the NewRelic Before Firebase fixes the issue 🤷‍♂️

lucasecf avatar Jun 22 '22 13:06 lucasecf

I can confirm this change fixes the issue. I had the same crash, where DynamicLinks conflicted with NewRelic

bogdan-razvan avatar May 15 '23 12:05 bogdan-razvan

The Firebase Dynamic Links service will be shutdown on August 25, 2025. In the meantime, only critical or security issues will be fixed in the SDK.

More at https://firebase.google.com/support/dynamic-links-faq

paulb777 avatar Aug 22 '23 16:08 paulb777

Hi there,

I understand this is a good fix if the native layer is firing the call.

Considering the latest documentation shows NewRelic.startAgent(appToken,agentConfiguration); and is done on the JS layer, how can we control the timing of this effectively?

Is the trick to use older versions as suggested in the fix?

daxfrost avatar Sep 18 '23 20:09 daxfrost