【问题标题】:FLUTTER : MODULE xxxxxxxx not found in XCODE颤振:在 XCODE 中找不到模块 xxxxxxxx
【发布时间】:2022-01-12 18:13:56
【问题描述】:

我正在为 IOS 开发一个颤振应用程序并遵循“颤振 pub 升级”我相信,我的应用程序不再构建......在 XCODE 中出现构建错误说:

'解析问题。

'未找到模块音频播放器'。

当我尝试在 VS CODE 中构建时,同样的问题:

Xcode 构建完成。 10,9s

无法构建 iOS 应用

Xcode 构建的错误输出:

↳ ** 构建失败 ** Xcode 的输出: ↳ /Users/sylvain/Developpeur/WORDCHAMP2/word_champion_V1.0/ios/Runner/GeneratedPluginRegistrant.m:12:9:致命错误:找不到模块“audioplayers”

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

无法为设备构建预编译的应用程序。

我在堆栈溢出或 git 上发现了类似的问题,但我读到的任何内容都没有...我检查了目标版本等... 它只是行不通。

我对此感到绝望,因为我完全不明白会发生什么...... 这可能与我的包裹有关....

这是我的 pubspeck.yaml 文件:

dependencies:

颤动:

sdk: flutter

flutter_localizations:

sdk: flutter

firebase_core:^1.10.5

firebase_auth:^3.3.3

cloud_firestore:^3.1.4

动画文本套件:^4.2.1

email_validator: ^2.0.1

提供者:^6.0.1

动画:^2.0.1

国际:^0.17.0

flutter_tts: ^3.2.2

连接性:^3.0.6

google_fonts:^2.1.0

cupertino_icons: ^1.0.3

speech_to_text: ^5.3.0

百分比指标:^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

头像发光:^2.0.1

音频播放器:^0.20.1

谁能帮忙? 还有一件事:当我在 XCODE 中单击 RUNNER 时:我得到三个选项卡:INFO - BUILD SETTINGS - PACKAGE DEPENDENCIES 在 PACKAGE DEPENDENCIES 下,它是空的,它只是说“在此处添加包”....这与我的问题有什么关系吗?

【问题讨论】:

    标签: ios xcode flutter module


    【解决方案1】:

    尤里卡!我在浏览网页时找到了这个问题的答案。

    问题来自 PODFILE。由于某种未知的原因,我的 PODFILE 几乎是空的。这阻止了依赖项的安装,因此在构建时没有找到任何东西。

    这是我粘贴在我的 pod 文件中的代码(如果它可以帮助其他人的话):

        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
    

    有谁知道我在哪里可以找到关于为 FLUTTER/IOS 应用程序构建的所有文件的良好解释? (Podfile,Podfile.lock,xcworkspace,... XCODE 的作用...)我讨厌它,当我不了解事情是如何运作的...它让我什至很难开始思考如何解决潜在的问题当你不知道到底发生了什么时......

    【讨论】:

      猜你喜欢
      • 2022-01-16
      • 2020-10-06
      • 2021-06-15
      • 2020-04-22
      • 2021-07-27
      • 2021-07-04
      • 2021-07-29
      • 2020-09-09
      • 1970-01-01
      相关资源
      最近更新 更多