4

How can solve this issues? Error (Xcode): Framework not found Flutter

I tried to more methods,

tried to delete ios then pod install...

tried to flutter clean...

tried to create new project etc.

but still cannot solve.

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.

enter image description here

enter image description here

if I used this methods,

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

i will got this error...

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.
Stanley
  • 311
  • 5
  • 15

9 Answers9

6

In my case, I got this error after deleting the flutter instances while trying to clean up some storage on my 258go macbook to update Xcode :(, in doing so I probably deleted the flutter.framework.

The solutions given here have not changed anything for me.

So I tried to clean up everything in the pod, including the cache. The pod install command failed because it missed the ios tools, which can be downloaded with flutter precache --ios.

So the complete process to solve this problem for me was :

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

I hope that this solution will help someone and prevent them from losing a whole day's work as it did for me.

Ipal
  • 135
  • 1
  • 10
  • has problem....`Xcode's output: ↳ Writing result bundle at path: /var/folders/rg/v6d4v6m545949bhd3pv5555r0000gn/T/flutter_tools.WB2dli/flutter_ios_build_temp_dirDaUUqz/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 Result bundle written to path: Error (Xcode): Framework not found Flutter` – Stanley May 18 '22 at 23:44
  • This is the exact scenario for me, except after trying your solution, I had to upgrade flutter and run my project from the command line using flutter run. – Ali Bakhtiyari Sep 19 '22 at 15:50
  • This was the same case for me, however, running `flutter upgrade` was enough to fix the issue for me. – Ahmed Mohammed Jun 27 '23 at 14:32
3

I have tried many solutions for this error. The only possible solution is to delete the flutter folder in the FLUTTER PATH, and re-copy the flutter folder.

This solved my error.

Aldi Nura
  • 53
  • 4
  • 1
    So I need to backup my project then delete it. Create again then paste back? – Stanley May 17 '22 at 01:03
  • @Stanley Just need to delete flutter folder and then you can put flutter folder to the same path and extract latest flutter zip and restart system,it will work.. – Aldi Nura May 17 '22 at 01:04
  • 1
    what's the extract latest flutter zip? I tried to delete ios>flutter folder, then I create new project. Copy the ios>fullter folder then paste to old project ios>fullter. I got same error... `Error (Xcode): Framework not found Flutter` & `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')` – Stanley May 17 '22 at 07:31
1

Solved the same problem:

  1. flutter upggrade
  2. flutter clean
  3. flutter run
Amer Alzibak
  • 1,489
  • 15
  • 16
1

I was cleaning data storage on my mac and cleared xcode cache, that's why this problem appeared. I had stable Flutter 3.0.0 version in my projects and have problems with last version So my solution was

  1. flutter upgrade (wait .....)
  2. flutter downgrade
  3. flutter pub get
0

I have tried all the answers, the only thing worked for me was to remove Flutter and reinstall it again.

user2682025
  • 656
  • 2
  • 13
  • 39
0

I had the same error after renaming the project and changing bundleId. Fixed it:

cd ios
pod cache clean --all
flutter clean
flutter pub get
KabaDH
  • 1
  • 1
0

That problem of not finding FMDB framework is related to a bug in Cocoapods.

You can solve by it editing the Pods-Runner-frameworks.sh script:

Replace:

if [ -L "${source}" ]; then
  echo "Symlinked..."
  source="$(readlink "${source}")"
fi

with:

if [ -L "${source}" ]; then
  echo "Symlinked..."
  source="$(readlink -f "${source}")"
fi

Note that -f was added.

Then you can archive it and upload your app.

Camilo Ortegón
  • 3,414
  • 3
  • 26
  • 34
0

I have fixed it by adding share_plus: to pubspec.yaml file

Abdelrahman Tareq
  • 1,874
  • 3
  • 17
  • 32
-1

1- flutter channel beta 2- flutter upgrade 3- flutter run 4- flutter channel stable 5- flutter upgrade 6- flutter run