【问题标题】:Flutter IOS error: error: no such module 'flutter_config'Flutter IOS错误:错误:没有这样的模块'flutter_config'
【发布时间】:2023-03-16 22:03:01
【问题描述】:

我在尝试在 Code Magic CI 上构建我的颤振项目时遇到问题。我正在使用 Flutter 2.2.3(同样的问题也发生在 2.8)和 Xcode 版本 12.4(同样的问题在 13.2)

/Users/builder/clone/ios/Runner/AppDelegate.swift:5:8: error: no such module 'flutter_config'
 import flutter_config
        ^
 remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
 remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
 /Users/builder/clone/ios/Runner/AppDelegate.swift:5:8: error: no such module 'flutter_config'
 import flutter_config
        ^
 note: Using new build system
 note: Planning
 note: Build preparation complete
 note: Building targets in dependency order
 /Users/builder/clone/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.2.99. (in target 'FMDB' from project 'Pods')

Encountered error while building for the device.

在本地启动应用程序时出现另一个错误:

ld: warning: Could not find or use auto-linked library 'swift_Concurrency'
ld: warning: Could not find or use auto-linked library 'swiftFileProvider'
ld: warning: Could not find or use auto-linked library 'swiftDataDetection'
ld: warning: Could not find or use auto-linked framework 'AVFAudio'
ld: warning: Could not find or use auto-linked framework 'DataDetection'
Undefined symbols for architecture arm64:
  "__swift_FORCE_LOAD_$_swiftDataDetection", referenced from:
      __swift_FORCE_LOAD_$_swiftDataDetection_$_FBAudienceNetwork in FBAudienceNetwork(FBAudienceNetwork.o)
     (maybe you meant: __swift_FORCE_LOAD_$_swiftDataDetection_$_FBAudienceNetwork)
  "_OBJC_CLASS_$_SKAdImpression", referenced from:
      objc-class-ref in FBAudienceNetwork(FBAdSKAdNetworkManager.m.o)
  "__swift_FORCE_LOAD_$_swiftFileProvider", referenced from:
      __swift_FORCE_LOAD_$_swiftFileProvider_$_FBAudienceNetwork in FBAudienceNetwork(FBAudienceNetwork.o)
     (maybe you meant: __swift_FORCE_LOAD_$_swiftFileProvider_$_FBAudienceNetwork)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
warning: no rule to process file '/../flutter2/.pub-cache/hosted/pub.dartlang.org/flutter_config-2.0.0/ios/Classes/BuildDotenvConfig.rb' of type 'text.script.ruby' for architecture 'arm64' (in target 'flutter_config' from project 'Pods')
warning: no rule to process file '/../flutter2/.pub-cache/hosted/pub.dartlang.org/flutter_config-2.0.0/ios/Classes/BuildXCConfig.rb' of type 'text.script.ruby' for architecture 'arm64' (in target 'flutter_config' from project 'Pods')
warning: no rule to process file '/../flutter2/.pub-cache/hosted/pub.dartlang.org/flutter_config-2.0.0/ios/Classes/ReadDotEnv.rb' of type 'text.script.ruby' for architecture 'arm64' (in target 'flutter_config' from project 'Pods')
warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'FMDB' from project 'Pods')
warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'Flutter' from project 'Pods')

【问题讨论】:

    标签: ios flutter build config


    【解决方案1】:

    在您的 ios/Podfile 文件中,取消注释 platform 行并将其值设为 11

    # Uncomment this line to define a global platform for your project
    platform :ios, '11.0'
    

    确保在您的 Xcode 中也进行更改

    然后在您的ios 目录中,运行以下命令

    rm -rf Pods/
    rm -rf Podfile.lock
    pod install
    
    

    【讨论】:

    • 不幸的是,它没有帮助。我的 podfile 中已经有平台:ios,'11.0'。另外,我之前尝试过清理 dods 和 lock-file。这样做并在 XCode UI 中更改 Ios 部署目标并不能解决问题。
    猜你喜欢
    • 2021-08-04
    • 2016-01-04
    • 2015-11-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-02-10
    • 1970-01-01
    • 2018-09-23
    相关资源
    最近更新 更多