如何解决此问题?错误(Xcode):未找到框架Flutter

6tqwzwtp  于 2022-12-05  发布在  Flutter
关注(0)|答案(3)|浏览(1017)

如何解决这个问题?Error (Xcode): Framework not found Flutter
我尝试了更多的方法,
尝试删除ios,然后安装pod ...
试着扑干净。
尝试创建新项目等。
但仍然无法解决。

Launching lib/main.dart on iPhone 13 Pro Max in debug mode...
/Users/pin-chientseng/Desktop/yomate/ios/Runner/Info.plist: Property List error: Found non-key inside <dict> at line 56 / JSON error:
JSON text did not start with array or object and option to allow fragments not set. around line 1, column 0.
Xcode build done.                                           221.1s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **

Xcode's output:
↳
    Writing result bundle at path:
        /var/folders/rg/v6d4v6m545949bhd3pv5555r0000gn/T/flutter_tools.hhxYin/flutter_ios_build_temp_dirsANWae/temporary_xcresult_bundle

    ld: framework not found Flutter
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    note: Using new build system
    note: Planning
    note: Build preparation complete
    note: Building targets in dependency order
    warning: Stale file '/Users/pin-chientseng/Desktop/yomate/build/ios/Debug-iphonesimulator/Runner.app/GoogleService-Info.plist' is
    located outside of the allowed root paths.

    note: Removed stale file
    '/Users/pin-chientseng/Library/Developer/Xcode/DerivedData/Runner-bfllcubjuppngacurzilkdnplylp/Build/Intermediates.noindex/Runner
    .build/Debug-iphonesimulator/Runner.build/InputFileList-5F0225AF943341352A9BA345-Pods-Runner-resources-Debug-input-files-37e3c74e
    61b246db180ac6f1b6f5519a-resolved.xcfilelist'

    note: Removed stale file
    '/Users/pin-chientseng/Library/Developer/Xcode/DerivedData/Runner-bfllcubjuppngacurzilkdnplylp/Build/Intermediates.noindex/Runner
    .build/Debug-iphonesimulator/Runner.build/InputFileList-678E497CE5823DAA4909D0F3-Pods-Runner-frameworks-Debug-input-files-6f17fb4
    132a6c963427e5fd8c0f46475-resolved.xcfilelist'

    note: Removed stale file
    '/Users/pin-chientseng/Library/Developer/Xcode/DerivedData/Runner-bfllcubjuppngacurzilkdnplylp/Build/Intermediates.noindex/Runner
    .build/Debug-iphonesimulator/Runner.build/OutputFileList-5F0225AF943341352A9BA345-Pods-Runner-resources-Debug-output-files-2b94b0
    84fd7edee03f689887bc427bd3-resolved.xcfilelist'

    note: Removed stale file
    '/Users/pin-chientseng/Library/Developer/Xcode/DerivedData/Runner-bfllcubjuppngacurzilkdnplylp/Build/Intermediates.noindex/Runner
    .build/Debug-iphonesimulator/Runner.build/OutputFileList-678E497CE5823DAA4909D0F3-Pods-Runner-frameworks-Debug-output-files-3dbe4
    531b144e8e556eea6741f7e46e6-resolved.xcfilelist'

    note: Removed stale file
    '/Users/pin-chientseng/Library/Developer/Xcode/DerivedData/Runner-bfllcubjuppngacurzilkdnplylp/Build/Intermediates.noindex/Runner
    .build/Debug-iphonesimulator/Runner.build/Script-5F0225AF943341352A9BA345.sh'

    note: Removed stale file
    '/Users/pin-chientseng/Library/Developer/Xcode/DerivedData/Runner-bfllcubjuppngacurzilkdnplylp/Build/Intermediates.noindex/Runner
    .build/Debug-iphonesimulator/Runner.build/Script-678E497CE5823DAA4909D0F3.sh'

    note: Removed stale file
    '/Users/pin-chientseng/Library/Developer/Xcode/DerivedData/Runner-bfllcubjuppngacurzilkdnplylp/Build/Intermediates.noindex/Runner
    .build/Debug-iphonesimulator/Runner.build/Script-69D48C77EE5D169DAA62588C.sh'

    /Users/pin-chientseng/Desktop/yomate/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator 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')
    /Users/pin-chientseng/Desktop/yomate/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator 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
    'leveldb-library' from project 'Pods')

    Result bundle written to path:
        /var/folders/rg/v6d4v6m545949bhd3pv5555r0000gn/T/flutter_tools.hhxYin/flutter_ios_build_temp_dirsANWae/temporary_xcresult_bundle

Error (Xcode): Framework not found Flutter

Could not build the application for the simulator.
Error launching application on iPhone 13 Pro Max.

如果我用这种方法,

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      if Gem::Version.new('8.0') > Gem::Version.new(config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'])
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '8.0'
      end
    end
  end
end

我会得到这个错误...

Launching lib/main.dart on iPhone 13 Pro Max in debug mode...
Running pod install...                                             38.2s
Running Xcode build...                                                  
Xcode build done.                                           28.7s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **

Xcode's output:
↳
    Writing result bundle at path:
        /var/folders/rg/v6d4v6m545949bhd3pv5555r0000gn/T/flutter_tools.gk0YEl/flutter_ios_build_temp_dirWL743Q/temporary_xcresult_bundle

    /Users/pin-chientseng/Development/flutter/.pub-cache/hosted/pub.dartlang.org/video_player_avfoundation-2.3.4/ios/Classes/messages
    .g.m:7:9: fatal error: 'Flutter/Flutter.h' file not found
    #import <Flutter/Flutter.h>
            ^~~~~~~~~~~~~~~~~~~
    1 error generated.
    note: Using new build system
    note: Planning
    note: Build preparation complete
    note: Building targets in dependency order

    Result bundle written to path:
        /var/folders/rg/v6d4v6m545949bhd3pv5555r0000gn/T/flutter_tools.gk0YEl/flutter_ios_build_temp_dirWL743Q/temporary_xcresult_bundle

Lexical or Preprocessor Issue (Xcode): 'Flutter/Flutter.h' file not found
/Users/pin-chientseng/Development/flutter/.pub-cache/hosted/pub.dartlang.org/video_player_avfoundation-2.3.4/ios/Classes/messages.g.m
:6:8

Could not build the application for the simulator.
Error launching application on iPhone 13 Pro Max.
ajsxfq5m

ajsxfq5m1#

我已经尝试了很多解决这个错误的方法。唯一可能的解决方法是删除Flutter路径中的Flutter文件夹,并重新复制Flutter文件夹。
这解决了我的错误。

js4nwp54

js4nwp542#

在我的情况下,我得到了这个错误后,删除Flutter示例,而试图清理我的258 go MacBook上的一些存储更新Xcode:(,在这样做,我可能删除了flutter. framework。
这里给出的解决方案对我来说没有任何改变。
所以我试着清理pod里的所有东西,包括该高速缓存。pod install命令失败了,因为它错过了ios工具,这些工具可以用flutter precache --ios下载。
所以我解决这个问题的完整过程是:

cd ios
pod cache clean --all
rm -rf ~/Library/Caches/CocoaPods
rm -rf Pods
rm -rf ~/Library/Developer/Xcode/DerivedData/*
pod deintegrate
flutter precache --ios
pod install

我希望这个解决方案能帮助一些人,防止他们像我一样失去一整天的工作。

roqulrg3

roqulrg33#

1-Flutter通道β 2-Flutter升级3-Flutter运行4-Flutter通道稳定5-Flutter升级6-Flutter运行

相关问题