Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protobuf 3.12 causes a clang compilation error on Messaging pod v6.14 #5722

Closed
M1ke opened this issue Jun 2, 2020 · 12 comments
Closed

Protobuf 3.12 causes a clang compilation error on Messaging pod v6.14 #5722

M1ke opened this issue Jun 2, 2020 · 12 comments

Comments

@M1ke
Copy link

M1ke commented Jun 2, 2020

Step 1: Describe your environment

  • Xcode version: 10.3
  • Firebase SDK version: 6.14
  • Firebase Component: Messaging
  • Component version: 6.14
  • Installation method: CocoaPods (select one)

Step 2: Describe the problem

Steps to reproduce:

What happened? How can we make the problem occur?

See protocolbuffers/protobuf#7587 for the full error message.

In short: using Pod 6.14 for Firebase messaging requires Protobuf with definition Protobuf (>= 3.9.2, ~> 3.9) which at present requires Protobuf pod 3.12

The linked Protobuf compilation error above occurs with this version, potentially due to protocolbuffers/protobuf#7026.

The fix is fairly simple; downgrade Protobuf to 3.11.x which has to be done by hacking one's Podfile.lock

Would it be acceptable if I opened a PR to hard limit the Protobuf requirement to max out at 3.11.x on the 6.14 branch for Messaging?

@paulb777
Copy link
Member

paulb777 commented Jun 2, 2020

@M1ke Thanks for the report.

Your proposal seems reasonable if there is a definite issue with 3.12.0.

However, first we'd need to confirm that with a reproducible example. Protobuf 3.12.0 has been out for two weeks. Our testing does not show the problem and we haven't seen any other reports. It's possible you have a stale/corrupt Xcode state or some other environment issue. Does rm -rf ~/Library/Developer/Xcode/DerivedData/ make a difference?

Are you able to reproduce in https://github.com/firebase/quickstart-ios/tree/master/messaging?

@M1ke
Copy link
Author

M1ke commented Jun 3, 2020

Thanks for getting back to me. As far as I could see I tried every possible way of clearing my environment:

  • Xcode -> Product -> Clean
  • Deleted ~/Library/Developer/Xcode/DerivedData
  • Cleared npm cache
  • Cleared pods cache
  • Deleted local ios/build and ios/pods directories
  • Deleted Podfile.lock

The same result happened each time. My only other thought is that it could be happening with one of React Native's autolinked pods, which is quite hard to debug. I'm using the default React Native pods plus:

  • rn-fetch-blob
  • react-native-calendar-events
  • react-native-custom-tabs
  • react-native-vector-icons
  • react-native-webview
  • react-native-image-picker
  • react-native-pdf
  • react-native-splash-screen
  • react-native-device-info
  • react-native-async-storage

All of these are autolinked except react-native-vector-icons which is linked manually due to the resource font files it imports.

@paulb777
Copy link
Member

paulb777 commented Jun 4, 2020

Does the issue still occur with the latest release - 6.26.0?

It might be worth raising this on a react-native channel. Most people here aren't too familiar with that environment.

@xiao99xiao
Copy link

xiao99xiao commented Jun 4, 2020

I got issue with Protobuf 3.12 too, but it's a bit different from @M1ke .
Building can succeed but app runs into the error below at start (on an iOS device)

dyld: Library not loaded: @rpath/Protobuf.framework/Protobuf
  Referenced from: /private/var/containers/Bundle/Application/A3DA9078-142C-4132-8AB4-D80902130D69/AppName.app/AppName
  Reason: image not found

Clearing cache does not help.
Downgrading to 3.11.x fixes it.

Environment:
Xcode 11.5, macOS 10.15.1, React Native 0.62.2, Firebase 6.25.0/6.26.0

@paulb777
Copy link
Member

paulb777 commented Jun 4, 2020

@xiao99xiao That issue sounds more like something caused by stale or corrupt Xcode state.

@morganchen12
Copy link
Contributor

@xiao99xiao check your runtime search paths and make sure that Protobuf's build location is discoverable.

@danigv
Copy link

danigv commented Jun 5, 2020

I'm having the same issue as @M1ke . Tried with this environment:

  • Xcode version: 10.1
  • Firebase Component: Messaging
  • Component version: tried with 6.11 and 6.13
  • Installation method: CocoaPods

I get the error when trying to archive, building and running are working ok. This is the error message:

Clang frontend command failed with exit code 70

The problem seems to be in Protobuf 3.12.

The only quick-fix is manually editing Podfile.lock?

@paulb777
Copy link
Member

paulb777 commented Jun 5, 2020

@danigv Recent versions of Firebase require at least Xcode 10.3.

It should never be necessary to edit the Podfile.lock versus specifying constraints in the Podfile like pod 'Protobuf', '< 3.12.0'

@xiao99xiao
Copy link

@paulb777 @morganchen12
Thanks fo reply. I'm using all default settings by cocoapods, and with my project, this issue could be replicate on multiple Macs.

One thing I noticed is, if I target at simulators, everything is ok, app starts properly, but if I target at a real iPhone, app runs into error at start.

I doubt maybe Protobuf fails to build but Xcode doesn't recognized that issue. Guess I need to check the build destination directory to see if Protobuf framework is there.

@paulb777
Copy link
Member

We're likely going to need a reproducible test case to make progress on this issue.

@google-oss-bot
Copy link

Hey @M1ke. 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
Copy link

Since there haven't been any recent updates here, I am going to close this issue.

@M1ke if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

@firebase firebase locked and limited conversation to collaborators Jul 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants