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

[iOS] Module 'camera' not found on empty flutter app template #95620

Closed
Bongokarl opened this issue Dec 21, 2021 · 2 comments
Closed

[iOS] Module 'camera' not found on empty flutter app template #95620

Bongokarl opened this issue Dec 21, 2021 · 2 comments
Labels
r: invalid Issue is closed as not valid

Comments

@Bongokarl
Copy link

Bongokarl commented Dec 21, 2021

Hi there,

when I create a blank new flutter app through Android Studio (version 4.1.3) on my MAC and only add "camera: ^0.9.4+5" to "dependencies" in the pubspec.yaml-file I cannot get the app to build in XCode anymore. It fails with the message in the title "Module 'camera' not found".
This is what I do:

  1. Open Android Studio and select "Create new Flutter Project".
  2. Choose "Flutter Application" and set a name for the app
  3. Open pubspec.yaml an add "camera: ^0.9.4+5":
    grafik
  4. Run "flutter pub get"
  5. Edit Podfile in ios folder and set "platform :ios, '11.0'"
  6. Open Terminal in Android Studio, navigate to ios folder and run "pod install"
  7. Right click Runner.xcodeproj and open in XCode
  8. Set deployment target to 11.0 in XCode project
  9. Run the app from XCode project
  10. Observe this error:
    grafik

The weird thing is that sometimes, after a reboot it suddenly works one time. Then I open another project, go back to this one and it doesn't work anymore.
This is my flutter doctor:
[✓] Flutter (Channel stable, 2.8.1, on macOS 11.5 20G71 darwin-arm, locale de-CH)
• Flutter version 2.8.1 at /Users/andi/Development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 77d935a (5 days ago), 2021-12-16 08:37:33 -0800
• Engine revision 890a5fca2e
• Dart version 2.15.1

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/andi/Library/Android/sdk
✗ cmdline-tools component is missing
Run path/to/sdkmanager --install "cmdline-tools;latest"
See https://developer.android.com/studio/command-line for more details.
✗ Android license status unknown.
Run flutter doctor --android-licenses to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.10.2

[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

[✓] Connected device (1 available)
• iPhone von Andreas (mobile) • 2013ab25cd849c7cccfd61a0582aa6219ac9c93e • ios • iOS 14.7.1 18G82

! Doctor found issues in 2 categories.

When I run the ios build from Android Studio it works perfectly fine!
Does anyone have an idea why I get this error in XCode? How can I find the "real" issue or underlying cause?

Best regards and thanks in advance,
Andi

@mamuseferha mamuseferha added the in triage Presently being triaged by the triage team label Dec 21, 2021
@mamuseferha
Copy link

Hi @Bongokarl, this is a fairly common issue and may have been caused because you opened Runner.xcodeproj instead of Runner.xcworkspace, and is not an issue with the camera plugin.

Please see the following links for more information

#54599 (comment)
#10770
#54599 (comment)
https://stackoverflow.com/questions/61956166/flutter-module-not-found-in-xcode

Closing, as this isn't an issue with Flutter itself.
If you disagree, please write in the comments and I will reopen it.
Thank you

@mamuseferha mamuseferha added r: invalid Issue is closed as not valid and removed in triage Presently being triaged by the triage team labels Dec 21, 2021
@github-actions
Copy link

github-actions bot commented Jan 4, 2022

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
r: invalid Issue is closed as not valid
Projects
None yet
Development

No branches or pull requests

2 participants