Johan Albrectsen
Johan Albrectsen

Reputation: 905

flutter_blue^0.6.3 file not found #import "google/protobuf/Any.pbobjc.h" Flutter

When I add flutter_blue: ^0.6.3 to my brand new project dependencies, I get the following error:

Xcode build done.                                            6.0s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    While building module 'protobuf' imported from /Users/johanalbrectsen/.pub-cache/hosted/pub.dartlang.org/flutter_blue-0.6.3/ios/gen/GPBArray.h:33:
    In file included from <module-includes>:1:
    In file included from /Users/johanalbrectsen/AndroidStudioProjects/flutter_blue_test/ios/Pods/Target Support Files/Protobuf/Protobuf-umbrella.h:28:
    In file included from /Users/johanalbrectsen/AndroidStudioProjects/flutter_blue_test/ios/Pods/Protobuf/objectivec/GPBProtocolBuffers.h:44:
    /Users/johanalbrectsen/AndroidStudioProjects/flutter_blue_test/ios/Pods/Protobuf/objectivec/GPBWellKnownTypes.h:44:10: fatal error: 'google/protobuf/Any.pbobjc.h' file not found
     #import "google/protobuf/Any.pbobjc.h"
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1 error generated.
    In file included from /Users/johanalbrectsen/.pub-cache/hosted/pub.dartlang.org/flutter_blue-0.6.3/ios/Classes/FlutterBluePlugin.m:6:
    In file included from /Users/johanalbrectsen/.pub-cache/hosted/pub.dartlang.org/flutter_blue-0.6.3/ios/gen/Flutterblue.pbobjc.h:13:
    In file included from /Users/johanalbrectsen/.pub-cache/hosted/pub.dartlang.org/flutter_blue-0.6.3/ios/gen/GPBProtocolBuffers.h:33:
    /Users/johanalbrectsen/.pub-cache/hosted/pub.dartlang.org/flutter_blue-0.6.3/ios/gen/GPBArray.h:33:9: fatal error: could not build module 'protobuf'
    #import "GPBRuntimeTypes.h"
     ~~~~~~~^~~~~~~~~~~~~~~~~~~
    2 errors generated.
    note: Using new build systemnote: Planning buildnote: Constructing build description

Could not build the application for the simulator.
Error launching application on iPhone 11 Pro Max.

Do you have any idea how to fix this?

Upvotes: 1

Views: 2319

Answers (4)

Arthur Eudeline
Arthur Eudeline

Reputation: 655

Yep, if someone encounter the same issue later, just like @Ritz_04 said, you just have to do downgrade cocoapods to 1.7.5 by doing :

sudo gem uninstall cocoapods --all
sudo gem install cocoapods -v 1.7.5

Then go into your Flutter project and then into the ios folder and do :

rm -rf ./Pods
rm ./Podfile.lock
pod install --repo-update

And you should be ready to go!

Upvotes: 0

Shaybc
Shaybc

Reputation: 3167

this issue is discussed all over, please check this answer on github

Upvotes: 0

ritz_04
ritz_04

Reputation: 11

I had same problem and downgrading cocoapods to 1.7.5 worked for me.

Upvotes: 1

Anil Chauhan
Anil Chauhan

Reputation: 716

Try with:

  • flutter clean
  • Delete Pod folder and Podfile.lock file inside the ios directory of your project
  • pod install
  • pod upgrade and then
  • flutter run on root directory of your project

Upvotes: 0

Related Questions