FLUTTER : MODULE xxxxxxxx not found in XCODE

1,106

EUREKA ! I found an answer to this problem while browsing the web.

The problem was coming from the PODFILE. For some unknown reason, my PODFILE was almost empty. This prevented the dependencies from getting installed, so nothing was found when building.

Here is the code (if it can help someone else) that I pasted in my pod file :

    ENV['COCOAPODS_DISABLE_STATS'] = 'true'

 project 'Runner', {

   'Debug' => :debug,
   'Profile' => :release,
   'Release' => :release,
 }

 def flutter_root
   generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
   unless File.exist?(generated_xcode_build_settings_path)
     raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
   end

   File.foreach(generated_xcode_build_settings_path) do |line|
     matches = line.match(/FLUTTER_ROOT=(.*)/)
     return matches[1].strip if matches
   end
   raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
 end

 require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

 flutter_ios_podfile_setup

 target 'Runner' do
   use_frameworks!
   use_modular_headers!



   flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
 end

 post_install do |installer|
   installer.pods_project.targets.each do |target|
     flutter_additional_ios_build_settings(target)
   end
 end

Does anyone know where I could find good explanations on all those files that are being built for FLUTTER/IOS apps ? (Podfile, Podfile.lock, xcworkspace,... the role of XCODE...) I hate it when I don't understand how things work... it makes it so hard to even start thinking on how to solve potential problems when you have no idea of what goes on really...

Share:
1,106
SylvainJack
Author by

SylvainJack

I have worked as a teacher for about 25 years and decided I wanted to embrace a new career. I started learning Flutter / Dart in January 2020. I know it will be a long way to be able to develop apps on my own, but I want to prove that I can do it!

Updated on January 03, 2023

Comments

  • SylvainJack
    SylvainJack over 1 year

    Am developing a flutter app for IOS and following "flutter pub upgrade" I believe, my app no longer builds... am getting a build error in XCODE saying :

    'Parse issue.

    'Module Audioplayers not found'.

    When I try to build in VS CODE, same problem :

    Xcode build done. 10,9s

    Failed to build iOS app

    Error output from Xcode build:

    ↳ ** BUILD FAILED ** Xcode's output: ↳ /Users/sylvain/Developpeur/WORDCHAMP2/word_champion_V1.0/ios/Runner/GeneratedPluginRegistrant.m:12:9: fatal error: module 'audioplayers' not found

    @import audioplayers;
     ~~~~~~~^~~~~~~~~~~~
    1 error generated.
    note: Using new build system
    note: Planning
    note: Build preparation complete
    note: Building targets in dependency order
    

    Could not build the precompiled application for the device.

    I have found similar questions on stack overflow or git, but nothing I read on it works... I checked target versions etc... It juste won't work.

    Am getting desperate with this as I don't understand at all what could be going on... It probably has to do with my packages....

    Here is my pubspeck.yaml file :

    dependencies:
    

    flutter:

    sdk: flutter
    

    flutter_localizations:

    sdk: flutter
    

    firebase_core: ^1.10.5

    firebase_auth: ^3.3.3

    cloud_firestore: ^3.1.4

    animated_text_kit: ^4.2.1

    email_validator: ^2.0.1

    provider: ^6.0.1

    animations: ^2.0.1

    intl: ^0.17.0

    flutter_tts: ^3.2.2

    connectivity: ^3.0.6

    google_fonts: ^2.1.0

    cupertino_icons: ^1.0.3

    speech_to_text: ^5.3.0

    percent_indicator: ^3.4.0

    flutter_rounded_progress_bar: ^0.2.0

    pdf: ^3.6.5

    path_provider: ^2.0.5

    open_file: ^3.2.1

    shared_preferences: ^2.0.11

    sleek_circular_slider: ^2.0.1

    avatar_glow: ^2.0.1

    audioplayers: ^0.20.1

    Can anyone help ? One more thing : When I click on RUNNER in XCODE : I get three tabs : INFO - BUILD SETTINGS - PACKAGE DEPENDENCIES Under PACKAGE DEPENDENCIES, it's empty, and it just says "Add Packages here".... Would this have anything to do with my problems ?