PathProvider not found on iOS build

2,929 views
Skip to first unread message

Ha Thuy, Suesi Tran

unread,
Mar 12, 2018, 4:46:30 AM3/12/18
to Flutter Dev
Hi,

I'm trying to use PathProvider from https://flutter.io/reading-writing-files/#introduction to access device's storage. It works fine on Android, but on iOS, i have compile error 

fatal error: 'path_provider/PathProviderPlugin.h' file not found

Tried solutions listed here: https://github.com/flutter/flutter/issues/10654, but none works. Any other suggestion?

Mikkel Ravn

unread,
Mar 12, 2018, 4:55:43 AM3/12/18
to Ha Thuy, Suesi Tran, Flutter Dev
If the iOS part of your app uses Swift, this may be https://github.com/flutter/flutter/issues/15099.

--
You received this message because you are subscribed to the Google Groups "Flutter Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Mikkel Nygaard Ravn
Software Engineer

Ha Thuy, Suesi Tran

unread,
Mar 12, 2018, 7:20:18 AM3/12/18
to Flutter Dev
Hi,

I tried to apply the workaround from this SO post, but I cant find the file PathProviderPlugin.h either. Looks like it's not generated.


On Monday, March 12, 2018 at 7:55:43 PM UTC+11, Mikkel Ravn wrote:
If the iOS part of your app uses Swift, this may be https://github.com/flutter/flutter/issues/15099.
On Mon, Mar 12, 2018 at 9:46 AM, 'Ha Thuy, Suesi Tran' via Flutter Dev <flutt...@googlegroups.com> wrote:
Hi,

I'm trying to use PathProvider from https://flutter.io/reading-writing-files/#introduction to access device's storage. It works fine on Android, but on iOS, i have compile error 

fatal error: 'path_provider/PathProviderPlugin.h' file not found

Tried solutions listed here: https://github.com/flutter/flutter/issues/10654, but none works. Any other suggestion?

--
You received this message because you are subscribed to the Google Groups "Flutter Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Mikkel Ravn

unread,
Mar 12, 2018, 7:34:16 AM3/12/18
to Ha Thuy, Suesi Tran, Flutter Dev
Applying the following workaround works for me. Let me know if it doesn't work for you.

To reproduce the error:
flutter create -i swift hello
cd hello
// add path_provider dependency to pubspec.yaml
// assume single iOS Simulator or device active
flutter run
// observe: build error from Xcode about not being able to find file path_provider/PathProviderPlugin.h

To work around it:
// Open ios/Runner.xcworkspace in Xcode
// Expand project tree as shown below
// Select PathProviderPlugin.h
// Change Target Membership to Public in the right-hand panel.
// Building in Xcode and using flutter run now both work.




On Mon, Mar 12, 2018 at 12:20 PM, 'Ha Thuy, Suesi Tran' via Flutter Dev <flutt...@googlegroups.com> wrote:
Hi,

I tried to apply the workaround from this SO post, but I cant find the file PathProviderPlugin.h either. Looks like it's not generated.

On Monday, March 12, 2018 at 7:55:43 PM UTC+11, Mikkel Ravn wrote:
If the iOS part of your app uses Swift, this may be https://github.com/flutter/flutter/issues/15099.

On Mon, Mar 12, 2018 at 9:46 AM, 'Ha Thuy, Suesi Tran' via Flutter Dev <flutt...@googlegroups.com> wrote:
Hi,

I'm trying to use PathProvider from https://flutter.io/reading-writing-files/#introduction to access device's storage. It works fine on Android, but on iOS, i have compile error 

fatal error: 'path_provider/PathProviderPlugin.h' file not found

Tried solutions listed here: https://github.com/flutter/flutter/issues/10654, but none works. Any other suggestion?

--
You received this message because you are subscribed to the Google Groups "Flutter Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Mikkel Nygaard Ravn
Software Engineer

--
You received this message because you are subscribed to the Google Groups "Flutter Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Ha Thuy, Suesi Tran

unread,
Mar 12, 2018, 7:49:30 AM3/12/18
to Flutter Dev
Yes this works. Thank you so much ^^

Kavinda Jayakody

unread,
Dec 23, 2019, 8:20:36 AM12/23/19
to Flutter Development (flutter-dev)
For me this was solved by editing podfile as mentioned by this [https://github.com/flutter/flutter/issues/10654#issuecomment-389034245][1] and change the xcode's build system to legacy.


Reply all
Reply to author
Forward
0 new messages