Flutter-permission-handler: Xcode build failed with 'Enums.h' file not found

Created on 1 May 2019  ·  16Comments  ·  Source: Baseflow/flutter-permission-handler

🐛 Bug Report

Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    In file included from /Library/Flutter/sdk/.pub-cache/hosted/pub.dartlang.org/permission_handler-3.0.1/ios/Classes/util/Codec.m:6:
    /Library/Flutter/sdk/.pub-cache/hosted/pub.dartlang.org/permission_handler-3.0.1/ios/Classes/util/Codec.h:7:9: fatal error: 'Enums.h' file not found
    #import "Enums.h"
            ^~~~~~~~~
    1 error generated.

Expected behavior

Able to build and run

Reproduction steps

  1. Create a new flutter repo
  2. Add a geolocator and permission_handler together in a pubspec.yaml
  geolocator: ^4.0.2
  permission_handler: ^3.0.1

Configuration

Version: 3.0.1

Platform:

  • [x] :iphone: iOS
  • [ ] :robot: Android

Most helpful comment

We have just release version 3.0.2 which should fix this issue.

All 16 comments

Same issue on 3.0.0
Working fine in 2.2.0
My project is swift based.

Same here

Same here!

Same

any fix ?

Same issue with v3.0.0 and also v3.0.1.

As sais jeanmatthieud, for me the (provisional) solution is to use v2.2.0

Here as well, is there maybe a way to manually fix the .h file?

same

i fix the error by remove geolocator: ^4.0.3 from my pugspec.yaml

Same issue here.

i fix the error by remove geolocator: ^4.0.3 from my pugspec.yaml

What if you do need geolocator: ^4.0.3?

@mvanbeusekom Any help, specially I need to use geolocator: ^4.0.3 ?

@melbit-lukeshan i try to downupgrade geolocator with 3.0.1 , it works . you can try. but also need author to fixed it.

I down upgrade geolocator with 3.0.1, it works well on ios but it gives me bugs in some Android devices.

Ok so there is a conflict with the package "permissions_handler" and "geolocator". Both have a header file called Enums.h .... What we did to resolve this temporarily ... was to upgrade cocoapods to the latest and then do a flutter build... it fails... then open the Xcode Runner workspace... Search within the PODS sub project and search for "Enums.h" ... you will see two files of this name in two different packages... I chose one and renamed it to "Enums1.h" and then had to adjust all the imports within that package to "Enums1.h" ... now it builds .... and works...! Someone needs to fix this. Thanks

We have just release version 3.0.2 which should fix this issue.

Was this page helpful?
0 / 5 - 0 ratings