Error runing Xcode build on Flutter using TensorFlowLite - ios

I'm creating an app on Flutter using the TensorFlowLite library and after finishing all the Flutter Code, I'm trying to debug it on a iOS Simulator and on the console I'm getting the following error:
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
Writing result bundle at path:
/var/folders/13/q8h3_c012wvc3mxcfpzrf6fr0000gn/T/flutter_tools.8a658a/flutter_ios_build_temp_dirNlQoAO/temporary_xcresult_bundle
/Users/chrisley/terminal-addons/flutter/.pub-cache/hosted/pub.dartlang.org/tflite-1.1.2/ios/Classes/TflitePlugin.mm:20:9: fatal error: 'TensorFlowLiteC.h' file not found
#import "TensorFlowLiteC.h"
^~~~~~~~~~~~~~~~~~~
1 error generated.
error: the following command failed with exit code 1 but produced no further output
CompileC /Users/chrisley/Library/Developer/Xcode/DerivedData/Runner-eguofderrkwgjseuiagmsjusmxtx/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/tflite.build/Objects-normal/arm64/TflitePlugin.o /Users/chrisley/terminal-addons/flutter/.pub-cache/hosted/pub.dartlang.org/tflite-1.1.2/ios/Classes/TflitePlugin.mm normal arm64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'tflite' from project 'Pods')
note: Building targets in dependency order
/Users/chrisley/Documents/Development/Flutter/tensorflow_test/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'TensorFlowLiteC' from project 'Pods')
warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')
warning: Run script build phase 'Thin Binary' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')
Result bundle written to path:
/var/folders/13/q8h3_c012wvc3mxcfpzrf6fr0000gn/T/flutter_tools.8a658a/flutter_ios_build_temp_dirNlQoAO/temporary_xcresult_bundle
Lexical or Preprocessor Issue (Xcode): 'TensorFlowLiteC.h' file not found
/Users/chrisley/terminal-addons/flutter/.pub-cache/hosted/pub.dartlang.org/tflite-1.1.2/ios/Classes/TflitePlugin.mm:19:8
2
Could not build the application for the simulator.
Error launching application on iPhone 14 Pro Max.
I tried to solve the error adding pod 'TensorFlowLiteObjC' in the Podfile but it didn't work.

Related

Fastlane with XCode 14: ARCHIVE FAILED

My current version of Fastlane 2.173.0 works OK with XCode 13 and builds and publishes my iOS RN/Native project to TestFlight. But after moving to XCode 14 I have got next error on start building (gym).
[16:56:49]: $ set -o pipefail && xcodebuild -workspace MyProject.xcworkspace -scheme MyProject -configuration Release -destination 'generic/platform=iOS' -archivePath /Users/vagrant/Library/Developer/Xcode/Archives/2022-10-31/MyProject\ 2022-10-31\ 16.56.49.xcarchive archive | tee /var/folders/9l/1ysg9vq51p37q0lgksxhdb9r0000gn/T/fastlane_logs3640665801/gym/MyProject-MyProject.log | xcbeautify
[16:56:52]: ▸ Resolve Package Graph
[16:56:54]: ▸ Resolved source packages
[16:56:54]: ▸ DLog - https://github.com/ikhvorost/DLog # 1.4.0
[16:56:54]: ▸ PromiseQ - https://github.com/ikhvorost/PromiseQ.git # 1.7.0
[16:56:54]: ▸ Realm - https://github.com/realm/realm-cocoa.git # 10.15.1
[16:56:54]: ▸ RealmDatabase - https://github.com/realm/realm-core # 11.4.1
[16:57:10]: ▸ ⚠️ Run script build phase 'Bundle Settings File' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'MyProject' from project 'MyProject')
[16:57:10]: ▸ ⚠️ Run script build phase 'Bundle React Native code and images' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'MyProject' from project 'MyProject')
[16:57:10]: ▸ ⚠️ Run script build phase 'Embed Frameworks' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'MyProject' from project 'MyProject')
[16:57:10]: ▸ ⚠️ Run script build phase 'Start Packager' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'MyProject' from project 'MyProject')
[16:57:10]: ▸ ⚠️ Run script build phase '[CP-User] [RNFB] Core Configuration' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'MyProject' from project 'MyProject')
[16:57:10]: ▸ ** ARCHIVE FAILED **
gym fails immediately after start from the above log. I've tied to upgrade Fastlane, Ruby, Cocoapods to the latest versions but it doesn't help and I'm still observing the failure.
I need to use new iOS SDK from XCode 14 for new features so how to fix "ARCHIVE FAILED" issue?
XCode 14 strictly checks your project and distribution settings, "Development Team" and Bitcode for pods etc. from the one side, and maybe has some bugs from the other.
You should make next changes to avoid the issue:
Remove Mac Catalyst from the destinations (if you don't use it) in your project:
General > Supported Destinations
Disabling signing, bitcode and Mac Catalyst for all your pods in Podfile:
post_install do |installer|
react_native_post_install(installer)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
flipper_post_install(installer)
# XCode 14 fix
installer.generated_projects.each do |project|
project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
config.build_settings['ENABLE_BITCODE'] = 'NO'
config.build_settings['SUPPORTED_PLATFORMS'] = 'iphoneos iphonesimulator'
config.build_settings['SUPPORTS_MACCATALYST'] = 'NO'
config.build_settings['SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD'] = 'NO'
end
end
end
end
Update Fastlane to 2.210.1 because it has fix for deliver and pilot.

Flutter Build errors xcode ios

After upgrading to Xcode 14, I got these errors messages when I try build/run my project on Mac:
Android studio -> Build -> Flutter -> Build iOS
shared_preferences: ^2.0.15
Flutter version: 3.3.2
Note that everything were working without any problem before the upgrading, and no problem in Windows.
Automatically signing iOS for device deployment using specified development team in Xcode project: 65456KJ35R
Running Xcode build...
Xcode build done. 18.4s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
Writing result bundle at path:
/var/folders/cc/3b8b8j7s3nd92qwt4_6zgzhh0000gn/T/flutter_tools.DBua0Q/flutter_ios_build_temp_dirdSTTIY/temporary_xcresult_bundle
/Users/test/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.1/ios/Classes/FLTSharedPreferencesPlugin.m:27:41: error: no type or protocol named 'FlutterPluginRegistrar'
+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar> *)registrar {
^
/Users/test/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.1/ios/Classes/FLTSharedPreferencesPlugin.m:29:34: error: property 'messenger' not found on object of type 'NSObject *'
UserDefaultsApiSetup(registrar.messenger, plugin);
^
3 errors generated.
Command SwiftCompile failed with a nonzero exit code
note: Building targets in dependency order
warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')
warning: Run script build phase 'Thin Binary' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')
Result bundle written to path:
/var/folders/cc/3b8b8j7s3nd92qwt4_6zgzhh0000gn/T/flutter_tools.DBua0Q/flutter_ios_build_temp_dirdSTTIY/temporary_xcresult_bundle
Generics Issue (Xcode): No type or protocol named 'FlutterPlugin'
/Users/test/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.1/ios/Classes/FLTSharedPreferencesPlugin.h:5:50
Generics Issue (Xcode): No type or protocol named 'FlutterPluginRegistrar'
/Users/test/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.1/ios/Classes/FLTSharedPreferencesPlugin.m:26:40
Semantic Issue (Xcode): Property 'messenger' not found on object of type 'NSObject *'
/Users/test/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.1/ios/Classes/FLTSharedPreferencesPlugin.m:28:33
Uncategorized (Xcode): Command SwiftCompile failed with a nonzero exit code
Encountered error while building for device.
Process finished with exit code 1
flutter run -v
flutter.txt
flutter build ios -v
iosbuild.log
I tested to build the new project with only shared_preferences: ^2.0.15 package and here is the result :
buildlog.log
Following packages have also conflicts while building for iOS in Mac
searchable_dropdown: ^1.1.3
file_picker: ^4.6.1
html_editor_enhanced: ^2.5.0
image_cropper: ^3.0.0

fatal error: 'Flutter/Flutter.h' file not found in flutter IOS Build

Launching lib/main.dart on iPhone 14 Pro in debug mode...
Running pod install...
Running Xcode build...
Xcode build done. 14.5s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
Writing result bundle at path:
/var/folders/d7/k5tgg8zx1fb1hlrnhzbg4l_40000gn/T/flutter_tools.FBHN8u/flutter_ios_build_temp_dirQbWTC1/temporary_xcresult_bundle
In file included from /usr/local/Caskroom/flutter/3.3.3/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_ios-6.0.17/ios/Classes/FLTURLLauncherPlugin.m:7:
/usr/local/Caskroom/flutter/3.3.3/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_ios-6.0.17/ios/Classes/FLTURLLauncherPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
In file included from /usr/local/Caskroom/flutter/3.3.3/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.1/ios/Classes/FLTSharedPreferencesPlugin.m:5:
/usr/local/Caskroom/flutter/3.3.3/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.1/ios/Classes/FLTSharedPreferencesPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
note: Building targets in dependency order
warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')
warning: Run script build phase 'Thin Binary' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')
Result bundle written to path:
/var/folders/d7/k5tgg8zx1fb1hlrnhzbg4l_40000gn/T/flutter_tools.FBHN8u/flutter_ios_build_temp_dirQbWTC1/temporary_xcresult_bundle
Lexical or Preprocessor Issue (Xcode): 'Flutter/Flutter.h' file not found
/usr/local/Caskroom/flutter/3.3.3/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_ios-6.0.17/ios/Classes/FLTURLLauncherPlugin.h:4:8
Lexical or Preprocessor Issue (Xcode): 'Flutter/Flutter.h' file not found
/usr/local/Caskroom/flutter/3.3.3/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.1/ios/Classes/FLTSharedPreferencesPlugin.h:4:8
Could not build the application for the simulator.
Error launching application on iPhone 14 Pro.
right now and after downgrading cocopods to 1.10.0 and platform :ios, '13.0' the build works but the runner stopped when launching the app in the emulator
this is the
Running pod install... Running Xcode build... Xcode build done. 307,7s Exception: Unable to launch com.xxxxxxx.xxx on D94FEC60-1F58-427F-8C7D-2E8C216362C5: ProcessException: Process exited abnormally: An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=1): The request to open "com.xxxxxxxxxx.xxx" failed. The request was denied by service delegate (SBMainWorkspace). Underlying error (domain=FBProcessExit, code=128): The operation couldn’t be completed. The process exited. The process exited. Command: xcrun simctl launch D94FEC60-1F58-427F-8C7D-2E8C216362C5 com.xxxxxxx.xxxx --enable-dart-profiling --enable-checked-mode --verify-entry-points --start-paused --observatory-port=0 Error launching application on iPhone 14 Pro.

Problem building to IOS with Flutter in Android Studio

friends...
For reasons I don't know why... When I am building to iOS Emulator, I have this error:
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
/Users/user./.pub-cache/hosted/pub.dartlang.org/google_sign_in-4.1.1/ios/Classes/FLTGoogleSignInPlugin.m:139:19: warning: unused variable 'sourceApplication' [-Wunused-variable]
NSString *sourceApplication = options[UIApplicationOpenURLOptionsSourceApplicationKey];
^
1 warning generated.
ld: framework not found App
clang: error: linker command failed with exit code 1 (use -v to see invocation)
note: Using new build system
note: Planning build
note: Constructing build description
warning: Mapping architecture armv7 to i386. Ensure that this target's Architectures and Valid Architectures build settings are configured correctly for the iOS Simulator platform. (in target 'image_picker' from project 'Pods')
warning: Mapping architecture arm64 to x86_64. Ensure that this target's Architectures and Valid Architectures build settings are configured correctly for the iOS Simulator platform. (in target 'image_picker' from project 'Pods')

My app is not building debug console says Could not build the application for the simulator

This is the output when trying to build the basic application when creating a new file. Launching lib/main.dart on iPhone XR in debug mode...
Xcode build done.
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
While building module 'Flutter' imported from /Users/davywavy/Desktop/Flutter Projects/premium/ios/Runner/GeneratedPluginRegistrant.h:8:
In file included from :1:
In file included from /Users/davywavy/Desktop/Flutter Projects/premium/ios/Flutter/Flutter.framework/Headers/Flutter.h:37:
In file included from /Users/davywavy/Desktop/Flutter Projects/premium/ios/Flutter/Flutter.framework/Headers/FlutterAppDelegate.h:11:
/Users/davywavy/Desktop/Flutter Projects/premium/ios/Flutter/Flutter.framework/Headers/FlutterPlugin.h:140:58: warning: this block declaration is not a prototype [-Wstrict-prototypes]
completionHandler:(nonnull void (^)())completionHandler;
^
void
1 warning generated.
1 warning generated.
ld: framework not found Flutter
clang: error: linker command failed with exit code 1 (use -v to see invocation)
note: Using new build systemnote: Planning buildnote: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone XR.
Exited (sigterm)
I have tried fixing my path flutter upgrade, flutter doctor -v everything looks right.
Launching lib/main.dart on iPhone XR in debug mode...
Xcode build done.
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
error: /Users/davywavy/Desktop/Flutter Projects/premium/ios/Flutter/Debug.xcconfig: unable to open file (in project "Runner") (in target 'Runner')
error: /Users/davywavy/Desktop/Flutter Projects/premium/ios/Flutter/Debug.xcconfig: unable to open file (in project "Runner") (in target 'Runner')
error: /Users/davywavy/Desktop/Flutter Projects/premium/ios/Flutter/Debug.xcconfig: unable to open file (in project "Runner") (in target 'Runner')
error: /Users/davywavy/Desktop/Flutter Projects/premium/ios/Flutter/Debug.xcconfig: unable to open file (in project "Runner") (in target 'Runner')
error: /Users/davywavy/Desktop/Flutter Projects/premium/ios/Flutter/Debug.xcconfig: unable to open file (in project "Runner") (in target 'Runner')
error: /Users/davywavy/Desktop/Flutter Projects/premium/ios/Flutter/Debug.xcconfig: unable to open file (in project "Runner") (in target 'Runner')
note: Using new build systemnote: Planning buildnote: Using build description from disk
Could not build the application for the simulator.
Error launching application on iPhone XR.
Exited (sigterm)
new output

Resources