1

I was building flutter app with tflite 0.9.0 plugin on IOS Simulator. I have followed every step required on pub.dev docs.

  1. Download TensorFlowLiteC.framework. For building a custom version of tensorflow, follow instructions in wiki.
  2. Place the TensorFlowLiteC.framework in the pub-cache folder of this package.

The error given on debug console :

Error (Xcode): Building for iOS Simulator, but linking in object file built for iOS, file '/Users/phicosmac/dev/flutter/.pub-cache/hosted/pub.dartlang.org/tflite_flutter-0.9.0/ios/TensorFlowLiteC.framework/TensorFlowLiteC' for architecture arm64
Could not build the application for the simulator.
Error launching application on iPhone 13 Pro Max.
flutter doctor -v
[✓] Flutter (Channel stable, 3.0.2, on macOS 12.0.1 21A559 darwin-x64, locale en-ID)
    • Flutter version 3.0.2 at /Users/phicosmac/dev/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision cd41fdd495 (9 days ago), 2022-06-08 09:52:13 -0700
    • Engine revision f15f824b57
    • Dart version 2.17.3
    • DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    • Android SDK at /Users/phicosmac/Library/Android/sdk
    • Platform android-32, build-tools 32.1.0-rc1
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)

[✓] VS Code (version 1.68.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.42.0

[✓] Connected device (3 available)
    • iPhone 13 Pro Max (mobile) • 891F5E2C-84C4-4402-B3C8-77BB2EA68589 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-15-0 (simulator)
    • macOS (desktop)            • macos                                • darwin-x64     • macOS 12.0.1 21A559 darwin-x64
    • Chrome (web)               • chrome                               • web-javascript • Google Chrome 102.0.5005.115
    ! Error: fitri’s iPhone is not connected. Xcode will continue when fitri’s iPhone is connected. (code -13)
    ! Error: PhicosDev is not connected. Xcode will continue when PhicosDev is connected. (code -13)
    ! Error: Pay is not connected. Xcode will continue when Pay is connected. (code -13)

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!
full error logs
Launching lib/main.dart on iPhone 13 Pro Max in debug mode...
Upgrading Info.plist
Xcode build done.                                           33.6s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **
Xcode's output:
↳
    Writing result bundle at path:
        /var/folders/c4/6xl2l2p509gbw24xm0vsl2v80000gn/T/flutter_tools.1wMmPt/flutter_ios_build_temp_diruYO0nn/temporary_xcresult_bundle
/Users/phicosmac/dev/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter_wkwebview-2.7.1/ios/Classes/FlutterWebView.m:575:23: warning: 'requiresUserActionForMediaPlayback' is deprecated: first deprecated in iOS 10.0 [-Wdeprecated-declarations]
            configuration.requiresUserActionForMediaPlayback = true;
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                          mediaTypesRequiringUserActionForPlayback
In module 'WebKit' imported from /Users/phicosmac/dev/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter_wkwebview-2.7.1/ios/Classes/FlutterWebView.h:6:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebViewConfiguration.h:218:28: note: 'requiresUserActionForMediaPlayback' has been explicitly marked deprecated here
    @property (nonatomic) BOOL requiresUserActionForMediaPlayback API_DEPRECATED_WITH_REPLACEMENT("mediaTypesRequiringUserActionForPlayback", ios(9.0, 10.0));
                               ^
/Users/phicosmac/dev/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter_wkwebview-2.7.1/ios/Classes/FlutterWebView.m:587:23: warning: 'requiresUserActionForMediaPlayback' is deprecated: first deprecated in iOS 10.0 [-Wdeprecated-declarations]
            configuration.requiresUserActionForMediaPlayback = false;
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                          mediaTypesRequiringUserActionForPlayback
In module 'WebKit' imported from /Users/phicosmac/dev/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter_wkwebview-2.7.1/ios/Classes/FlutterWebView.h:6:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebViewConfiguration.h:218:28: note: 'requiresUserActionForMediaPlayback' has been explicitly marked deprecated here
    @property (nonatomic) BOOL requiresUserActionForMediaPlayback API_DEPRECATED_WITH_REPLACEMENT("mediaTypesRequiringUserActionForPlayback", ios(9.0, 10.0));
                               ^
    2 warnings generated.
/Users/phicosmac/dev/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter_wkwebview-2.7.1/ios/Classes/FlutterWebView.m:575:23: warning: 'requiresUserActionForMediaPlayback' is deprecated: first deprecated in iOS 10.0 [-Wdeprecated-declarations]
            configuration.requiresUserActionForMediaPlayback = true;
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                          mediaTypesRequiringUserActionForPlayback
In module 'WebKit' imported from /Users/phicosmac/dev/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter_wkwebview-2.7.1/ios/Classes/FlutterWebView.h:6:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebViewConfiguration.h:218:28: note: 'requiresUserActionForMediaPlayback' has been explicitly marked deprecated here
    @property (nonatomic) BOOL requiresUserActionForMediaPlayback API_DEPRECATED_WITH_REPLACEMENT("mediaTypesRequiringUserActionForPlayback", ios(9.0, 10.0));
                               ^
/Users/phicosmac/dev/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter_wkwebview-2.7.1/ios/Classes/FlutterWebView.m:587:23: warning: 'requiresUserActionForMediaPlayback' is deprecated: first deprecated in iOS 10.0 [-Wdeprecated-declarations]
            configuration.requiresUserActionForMediaPlayback = false;
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                          mediaTypesRequiringUserActionForPlayback
In module 'WebKit' imported from /Users/phicosmac/dev/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter_wkwebview-2.7.1/ios/Classes/FlutterWebView.h:6:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebViewConfiguration.h:218:28: note: 'requiresUserActionForMediaPlayback' has been explicitly marked deprecated here
    @property (nonatomic) BOOL requiresUserActionForMediaPlayback API_DEPRECATED_WITH_REPLACEMENT("mediaTypesRequiringUserActionForPlayback", ios(9.0, 10.0));
                               ^
    2 warnings generated.
/Users/phicosmac/dev/flutter/.pub-cache/hosted/pub.dartlang.org/local_auth-1.1.11/ios/Classes/FLTLocalAuthPlugin.m:85:56: warning: 'openURL:' is deprecated: first deprecated in iOS 10.0 [-Wdeprecated-declarations]
                        [[UIApplication sharedApplication] openURL:url];
                                                           ^~~~~~~
                                                           openURL:options:completionHandler:
    In module 'UIKit' imported from /Users/phicosmac/flutter/ess-peruri-mobile/ios/Pods/Target Support Files/local_auth/local_auth-prefix.pch:2:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:124:1: note: 'openURL:' has been explicitly marked deprecated here
    - (BOOL)openURL:(NSURL*)url API_DEPRECATED_WITH_REPLACEMENT("openURL:options:completionHandler:", ios(2.0, 10.0)) NS_EXTENSION_UNAVAILABLE_IOS("");
    ^
/Users/phicosmac/dev/flutter/.pub-cache/hosted/pub.dartlang.org/local_auth-1.1.11/ios/Classes/FLTLocalAuthPlugin.m:113:32: warning: 'LAErrorTouchIDNotEnrolled' is deprecated: first deprecated in iOS 11.0 - use LAErrorBiometryNotEnrolled [-Wdeprecated-declarations]
      } else if (authError.code == LAErrorTouchIDNotEnrolled) {
                                   ^
In module 'LocalAuthentication' imported from /Users/phicosmac/dev/flutter/.pub-cache/hosted/pub.dartlang.org/local_auth-1.1.11/ios/Classes/FLTLocalAuthPlugin.m:4:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/LocalAuthentication.framework/Headers/LAError.h:36:5: note: 'LAErrorTouchIDNotEnrolled' has been explicitly marked deprecated here
        LAErrorTouchIDNotEnrolled NS_ENUM_DEPRECATED(10_10, 10_13, 8_0, 11_0, "use LAErrorBiometryNotEnrolled") = kLAErrorTouchIDNotEnrolled,
        ^
/Users/phicosmac/dev/flutter/.pub-cache/hosted/pub.dartlang.org/local_auth-1.1.11/ios/Classes/FLTLocalAuthPlugin.m:181:12: warning: 'LAErrorTouchIDNotAvailable' is deprecated: first deprecated in iOS 11.0 - use LAErrorBiometryNotAvailable [-Wdeprecated-declarations]
          case LAErrorTouchIDNotAvailable:
               ^
In module 'LocalAuthentication' imported from /Users/phicosmac/dev/flutter/.pub-cache/hosted/pub.dartlang.org/local_auth-1.1.11/ios/Classes/FLTLocalAuthPlugin.m:4:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/LocalAuthentication.framework/Headers/LAError.h:33:5: note: 'LAErrorTouchIDNotAvailable' has been explicitly marked deprecated here
        LAErrorTouchIDNotAvailable NS_ENUM_DEPRECATED(10_10, 10_13, 8_0, 11_0, "use LAErrorBiometryNotAvailable") = kLAErrorTouchIDNotAvailable,
        ^
/Users/phicosmac/dev/flutter/.pub-cache/hosted/pub.dartlang.org/local_auth-1.1.11/ios/Classes/FLTLocalAuthPlugin.m:182:12: warning: 'LAErrorTouchIDNotEnrolled' is deprecated: first deprecated in iOS 11.0 - use LAErrorBiometryNotEnrolled [-Wdeprecated-declarations]
          case LAErrorTouchIDNotEnrolled:
               ^
In module 'LocalAuthentication' imported from /Users/phicosmac/dev/flutter/.pub-cache/hosted/pub.dartlang.org/local_auth-1.1.11/ios/Classes/FLTLocalAuthPlugin.m:4:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/LocalAuthentication.framework/Headers/LAError.h:36:5: note: 'LAErrorTouchIDNotEnrolled' has been explicitly marked deprecated here
        LAErrorTouchIDNotEnrolled NS_ENUM_DEPRECATED(10_10, 10_13, 8_0, 11_0, "use LAErrorBiometryNotEnrolled") = kLAErrorTouchIDNotEnrolled,
        ^
/Users/phicosmac/dev/flutter/.pub-cache/hosted/pub.dartlang.org/local_auth-1.1.11/ios/Classes/FLTLocalAuthPlugin.m:184:12: warning: 'LAErrorTouchIDLockout' is deprecated: first deprecated in iOS 11.0 - use LAErrorBiometryLockout [-Wdeprecated-declarations]
          case LAErrorTouchIDLockout:
               ^
In module 'LocalAuthentication' imported from /Users/phicosmac/dev/flutter/.pub-cache/hosted/pub.dartlang.org/local_auth-1.1.11/ios/Classes/FLTLocalAuthPlugin.m:4:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/LocalAuthentication.framework/Headers/LAError.h:41:5: note: 'LAErrorTouchIDLockout' has been explicitly marked deprecated here
        LAErrorTouchIDLockout NS_ENUM_DEPRECATED(10_11, 10_13, 9_0, 11_0, "use LAErrorBiometryLockout")
        ^
/Users/phicosmac/dev/flutter/.pub-cache/hosted/pub.dartlang.org/local_auth-1.1.11/ios/Classes/FLTLocalAuthPlugin.m:204:10: warning: 'LAErrorTouchIDNotEnrolled' is deprecated: first deprecated in iOS 11.0 - use LAErrorBiometryNotEnrolled [-Wdeprecated-declarations]
        case LAErrorTouchIDNotEnrolled:
             ^
In module 'LocalAuthentication' imported from /Users/phicosmac/dev/flutter/.pub-cache/hosted/pub.dartlang.org/local_auth-1.1.11/ios/Classes/FLTLocalAuthPlugin.m:4:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/LocalAuthentication.framework/Headers/LAError.h:36:5: note: 'LAErrorTouchIDNotEnrolled' has been explicitly marked deprecated here
        LAErrorTouchIDNotEnrolled NS_ENUM_DEPRECATED(10_10, 10_13, 8_0, 11_0, "use LAErrorBiometryNotEnrolled") = kLAErrorTouchIDNotEnrolled,
        ^
/Users/phicosmac/dev/flutter/.pub-cache/hosted/pub.dartlang.org/local_auth-1.1.11/ios/Classes/FLTLocalAuthPlugin.m:214:10: warning: 'LAErrorTouchIDLockout' is deprecated: first deprecated in iOS 11.0 - use LAErrorBiometryLockout [-Wdeprecated-declarations]
        case LAErrorTouchIDLockout:
             ^
In module 'LocalAuthentication' imported from /Users/phicosmac/dev/flutter/.pub-cache/hosted/pub.dartlang.org/local_auth-1.1.11/ios/Classes/FLTLocalAuthPlugin.m:4:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/LocalAuthentication.framework/Headers/LAError.h:41:5: note: 'LAErrorTouchIDLockout' has been explicitly marked deprecated here
        LAErrorTouchIDLockout NS_ENUM_DEPRECATED(10_11, 10_13, 9_0, 11_0, "use LAErrorBiometryLockout")
        ^
    7 warnings generated.
    7 warnings generated.
ld: building for iOS Simulator, but linking in object file built for iOS, file '/Users/phicosmac/dev/flutter/.pub-cache/hosted/pub.dartlang.org/tflite_flutter-0.9.0/ios/TensorFlowLiteC.framework/TensorFlowLiteC' for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
/Users/phicosmac/dev/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.8.4+11/ios/Classes/FLTImagePickerPhotoAssetUtil.m:17:44: warning: 'UIImagePickerControllerReferenceURL' is deprecated: first deprecated in iOS 11.0 - Will be removed in a future release, use PHPicker. [-Wdeprecated-declarations]
      NSURL *referenceURL = [info objectForKey:UIImagePickerControllerReferenceURL];
                                               ^
    In module 'UIKit' imported from /Users/phicosmac/flutter/ess-peruri-mobile/ios/Pods/Target Support Files/image_picker/image_picker-prefix.pch:2:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIImagePickerController.h:62:51: note: 'UIImagePickerControllerReferenceURL' has been explicitly marked deprecated here
    UIKIT_EXTERN UIImagePickerControllerInfoKey const UIImagePickerControllerReferenceURL API_DEPRECATED("Will be removed in a future release, use PHPicker.", ios(4.1, 11.0)) API_UNAVAILABLE(tvos); // an NSURL that references an asset in the AssetsLibrary framework
                                                      ^
/Users/phicosmac/dev/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.8.4+11/ios/Classes/FLTImagePickerPhotoAssetUtil.m:21:47: warning: 'fetchAssetsWithALAssetURLs:options:' is deprecated: first deprecated in iOS 11 - Will be removed in a future release [-Wdeprecated-declarations]
      PHFetchResult<PHAsset *> *result = [PHAsset fetchAssetsWithALAssetURLs:@[ referenceURL ]
                                                  ^
In module 'Photos' imported from /Users/phicosmac/dev/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.8.4+11/ios/Classes/FLTImagePickerPhotoAssetUtil.h:6:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/Photos.framework/Headers/PHAsset.h:77:1: note: 'fetchAssetsWithALAssetURLs:options:' has been explicitly marked deprecated here
    + (PHFetchResult<PHAsset *> *)fetchAssetsWithALAssetURLs:(NSArray<NSURL *> *)assetURLs options:(nullable PHFetchOptions *)options API_DEPRECATED("Will be removed in a future release", ios(8, 11), tvos(8, 11)) API_UNAVAILABLE(macos);
    ^
    2 warnings generated.
    note: Using new build system
    note: Planning
    note: Build preparation complete
    note: Building targets in parallel
    Result bundle written to path:
        /var/folders/c4/6xl2l2p509gbw24xm0vsl2v80000gn/T/flutter_tools.1wMmPt/flutter_ios_build_temp_diruYO0nn/temporary_xcresult_bundle
Error (Xcode): Building for iOS Simulator, but linking in object file built for iOS, file '/Users/phicosmac/dev/flutter/.pub-cache/hosted/pub.dartlang.org/tflite_flutter-0.9.0/ios/TensorFlowLiteC.framework/TensorFlowLiteC' for architecture arm64
Could not build the application for the simulator.
Error launching application on iPhone 13 Pro Max.
Exited

Philip Purwoko
  • 407
  • 5
  • 20
  • I have tried [this](https://stackoverflow.com/questions/63607158/xcode-building-for-ios-simulator-but-linking-in-an-object-file-built-for-ios-f), now the only error left was the tflite error `Building for iOS Simulator, but linking in object file built for iOS, file ... for architecture arm64` – Philip Purwoko Jun 17 '22 at 06:55

0 Answers0