0

I'm trying to run on FlutterFlow, exporting to an Xcode simulator.

On flutter run I get the following error in terminal:

Lexical or Preprocessor Issue (Xcode): 'TensorFlowLiteC.h' file not found
/Users/andrewmccalister/.pub-cache/hosted/pub.dev/tflite-1.1.2/ios/Classes/TflitePlugin.mm:19:8


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

I proceed to run flutter pub add tensorflow_lite but then get the following error:

The current Dart SDK version is 3.1.0-163.1.beta.

Because d_e_c01_image_recognition depends on tensorflow_lite any which doesn't support null
  safety, version solving failed.

The lower bound of "sdk: '>=1.8.0 <2.0.0'" must be 2.12.0 or higher to enable null safety.
For details, see https://dart.dev/null-safety

Any idea how to fix this issue? The wording suggests Tflite doesn't work with null safety at all. If so, does that mean I have to go to a previous version of Dart?

pubspec.yaml file

name: d_e_c01_image_recognition
description: A new Flutter project.

# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1

environment:
  sdk: '>=2.18.5 <3.0.0' or higher

dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter
  auto_size_text: 3.0.0
  cached_network_image: 3.2.1
  cloud_firestore: 4.2.0
  cloud_firestore_platform_interface: 5.9.1
  cloud_firestore_web: 3.1.1
  file_picker: 5.2.6
  firebase_auth: 4.2.0
  firebase_auth_platform_interface: 6.11.4
  firebase_auth_web: 5.2.0
  firebase_core: 2.4.0
  firebase_core_platform_interface: 4.5.2
  firebase_core_web: 2.0.2
  firebase_storage: 11.0.7
  firebase_storage_platform_interface: 4.1.25
  firebase_storage_web: 3.3.17
  flutter_animate: 4.1.1+1
  flutter_cache_manager: 3.3.0
  flutter_plugin_android_lifecycle: 2.0.9
  font_awesome_flutter: 10.1.0
  from_css_color: 2.0.0
  go_router: 7.1.1
  google_fonts: 4.0.3
  google_sign_in: 6.0.2
  google_sign_in_android: 6.1.8
  google_sign_in_ios: 5.6.1
  google_sign_in_platform_interface: 2.4.0
  google_sign_in_web: 0.11.0+2
  image_downloader: ^0.31.0
  image_picker: ^0.8.6
  image_picker_android: 0.8.5+3
  image_picker_for_web: 2.1.10
  image_picker_ios: 0.8.6+1
  image_picker_platform_interface: 2.6.2
  intl: 0.17.0
  json_path: 0.4.1
  mime_type: 1.0.0
  page_transition: 2.0.4
  path_provider: 2.0.14
  path_provider_android: 2.0.25
  path_provider_foundation: 2.2.2
  path_provider_platform_interface: 2.0.6
  plugin_platform_interface: 2.1.3
  provider: 6.0.4
  rxdart: 0.27.7
  shared_preferences: 2.0.15
  shared_preferences_android: 2.1.0
  shared_preferences_ios: 2.1.1
  shared_preferences_platform_interface: 2.2.0
  shared_preferences_web: 2.1.0
  sign_in_with_apple: 4.3.0
  sign_in_with_apple_platform_interface: 1.0.0
  sign_in_with_apple_web: 1.0.1
  sqflite: 2.2.6
  stream_transform: 2.1.0
  tflite: ^1.1.2
  timeago: 3.2.2
  url_launcher: 6.1.10
  url_launcher_android: 6.0.27
  url_launcher_ios: 6.1.4
  url_launcher_platform_interface: 2.1.2
  video_player: 2.6.0
  video_player_android: 2.4.3
  video_player_avfoundation: 2.4.2
  video_player_platform_interface: 6.1.0
  video_player_web: 2.0.15


  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.0

dev_dependencies:

  flutter_test:
    sdk: flutter

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter.
flutter:

  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  assets:
    - assets/fonts/
    - assets/images/
    - assets/videos/
    - assets/audios/
    - assets/lottie_animations/
    - assets/rive_animations/
    - assets/pdfs/



  # An image asset can refer to one or more resolution-specific "variants", see
  # https://flutter.dev/assets-and-images/#resolution-aware.

  # For details regarding adding assets from package dependencies, see
  # https://flutter.dev/assets-and-images/#from-packages

  # To add custom fonts to your application, add a fonts section here,
  # in this "flutter" section. Each entry in this list should have a
  # "family" key with the font family name, and a "fonts" key with a
  # list giving the asset and other descriptors for the font. For
  # example:
  # fonts:
  #   - family: Schyler
  #     fonts:
  #       - asset: fonts/Schyler-Regular.ttf
  #       - asset: fonts/Schyler-Italic.ttf
  #         style: italic
  #   - family: Trajan Pro
  #     fonts:
  #       - asset: fonts/TrajanPro.ttf
  #       - asset: fonts/TrajanPro_Bold.ttf
  #         weight: 700
  #
  # For details regarding fonts from package dependencies,
  # see https://flutter.dev/custom-fonts/#from-packages

0 Answers0