8000 'Flutter/Flutter.h' file not found on Flutter 2.0.1 · Issue #95 · creativecreatorormaybenot/wakelock · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Jul 11, 2024. It is now read-only.

'Flutter/Flutter.h' file not found on Flutter 2.0.1 #95

Closed
nizwar opened this issue Mar 5, 2021 · 16 comments
Closed

'Flutter/Flutter.h' file not found on Flutter 2.0.1 #95

nizwar opened this issue Mar 5, 2021 · 16 comments
Labels
bug Something isn't working p0 Highest priority requires further investigation The root cause of the issue has not yet been fully identified

Comments

@nizwar
Copy link
nizwar commented Mar 5, 2021

My project is not ready for nullsafety, and still use wakelock-0.2.1+1, its generate following error while running the application

1 error generated. /Library/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/wakelock-0.2.1+1/ios/Classes/messages.m:4:9: fatal error: 'Flutter/Flutter.h' file not found #import <Flutter/Flutter.h> ^~~~~~~~~~~~~~~~~~~

its only happened with latest flutter version (2.0.1), when i downgrade it to 1.22.6, its working really fine, is there any ways to solve this?

Flutter doctor result :
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.0.1, on macOS 11.2.2 20D80 darwin-x64, locale en-ID)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] VS Code (version 1.54.0)
[✓] Connected device (4 available)

@creativecreatorormaybenot
Copy link
Owner

Hi @nizwar :) Thanks for opening the issue!

You can now already use the latest wakelock version when you have not migrated to null safety yet.

I would suggest bumping to the latest version and running flutter clean. Hope it helps 🙂

@creativecreatorormaybenot
Copy link
Owner

I think that there is nothing to do from the wakelock side of things, hence, closing for now. Let me know if this should be reopened :)

@davidpanic
Copy link
davidpanic commented Mar 8, 2021

This happens with wakelock 0.5.0+2 aswell
Happens only on iOS. Compiles on android just fine.

> Compiling wakelock-dummy.m
> Compiling messages.m

[x] /Users/buildmachine/flutter/.pub-cache/hosted/pub.dartlang.org/wakelock-0.5.0+2/ios/Classes/messages.m:4:9: 'Flutter/Flutter.h' file not found

#import <Flutter/Flutter.h>
        ^~~~~~~~~~~~~~~~~~~


> Compiling wakelock_vers.c
> Compiling WakelockPlugin.m

dart: 2.12.0
flutter: 2.0.1

@creativecreatorormaybenot
Copy link
Owner

@psrcek Have you tried running flutter clean?

I am not sure why this would suddenly appear. This code has not been touched.

@davidpanic
Copy link
davidpanic commented Mar 8, 2021 via email

@creativecreatorormaybenot
Copy link
Owner

@psrcek Can you reproduce this with a newly created project? (flutter create bug)

Otherwise, this is probably faulty Podfile configuration.

@ekuleshov
Copy link

Have the same issue and flutter clean didn't resolve it.

Is it suggested to recreate the ios project and podfile somehow?

@creativecreatorormaybenot
Copy link
Owner

@ekuleshov I am not sure - do you think you can look into it?

I bet this is a simple config change necessary, however, I have no idea to be honest.

@ekuleshov
Copy link

@creativecreatorormaybenot I'm not really sure what to look at. Downgrading Flutter to 1.x resolved issue for the time being.

Quick search found things like this flutter/flutter#70895 though recommended workarounds with clean ore removing podfile.lock didn't help here. I'd have to try this again when I'll have some more time.

@creativecreatorormaybenot
Copy link
Owner

@ekuleshov Thanks for investigating.

I will also keep this in my mind to see if I can tackle this asap.

@sokolej79
Copy link

Same issue. On ios not working.
flutter: 2.0.1

@creativecreatorormaybenot creativecreatorormaybenot added bug Something isn't working p0 Highest priority requires further investigation The root cause of the issue has not yet been fully identified labels Mar 11, 2021
@creativecreatorormaybenot
Copy link
Owner

If anyone has insights on this, please let me know :) I am glad to accept any contributions!

@davidpanic
Copy link

I was able to fix the issue with this suggestion.
I just added the line flutter_additional_ios_build_settings(target) in the post_install do decleration in our Podfile.

@creativecreatorormaybenot
Copy link
Owner

Thanks a lot @psrcek 🙏

Are you suggesting that this fix has to be done in your app or in the wakelock plugin? :)

@davidpanic
Copy link

No idea if that should be fixed in wakelock or in the end user app, but fixing it in my app worked for me. Since this seems like a required config migration to flutter 2.0.0 I think it might be a required fix in the app. I haven't tried creating a new app, but my best guess is that line already exists in newly created apps in flutter >=2.0.0.

@LiangLuDev
Copy link

I was able to fix the issue with this suggestion. I just added the line flutter_additional_ios_build_settings(target) in the post_install do decleration in our Podfile.

thanks . Solved using this solution

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working p0 Highest priority requires further investigation The root cause of the issue has not yet been fully identified
Projects
None yet
Development

No branches or pull requests

6 participants
0