alan-sdk-flutter
alan-sdk-flutter copied to clipboard
IOS build failed
Uncategorized (Xcode): Command CompileSwiftSources failed with a nonzero exit code
Error (Xcode): Undefined symbol: OBJC_CLASS$_AlanText
Error (Xcode): Undefined symbol: OBJC_CLASS$_AlanButton
Error (Xcode): Undefined symbol: OBJC_CLASS$_AlanConfig
Error (Xcode): Undefined symbol: OBJC_CLASS$_AlanLog
Hi @MarsadMaqsood Could you please provide steps to reproduce your issue. What version of plugin and iOS do you use? What command do you run? What device do you use?
plugin version: 3.6.0
platform :ios, '12.0'
flutter version: 3.0.5
I'm using Macbook Air M1 MacOS Monterey 12.4 and trying to run on Simulator (iPhone 13 Pro)
flutter run
Launching lib/main.dart on iPhone 13 Pro in debug mode...
Running Xcode build...
Xcode build done. 4.4s
Failed to build iOS app
Error output from Xcode build:
↳
Writing result bundle at path:
/var/folders/mn/5c8dql3j5lg85cnw80xdtd0m0000gn/T/flutter_tools.LDJdFi/flutter_ios_build_temp_dirSGG9dA/temporary_
xcresult_bundle
Command CompileSwiftSources failed with a nonzero exit code
Command CompileSwiftSources failed with a nonzero exit code
ld: warning: building for iOS Simulator, but linking in dylib built for iOS, 'AlanSDK.framework'
ld: warning: Could not find or use auto-linked framework 'AlanSDK'
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_AlanText", referenced from:
objc-class-ref in AlanVoicePlugin.o
"_OBJC_CLASS_$_AlanButton", referenced from:
objc-class-ref in AlanVoicePlugin.o
"_OBJC_CLASS_$_AlanConfig", referenced from:
objc-class-ref in AlanVoicePlugin.o
"_OBJC_CLASS_$_AlanLog", referenced from:
objc-class-ref in AlanVoicePlugin.o
ld: symbol(s) not found for architecture arm64
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:
/var/folders/mn/5c8dql3j5lg85cnw80xdtd0m0000gn/T/flutter_tools.LDJdFi/flutter_ios_build_temp_dirSGG9dA/temporary_
xcresult_bundle
Uncategorized (Xcode): Command CompileSwiftSources failed with a nonzero exit code
Error (Xcode): Undefined symbol: _OBJC_CLASS_$_AlanText
Error (Xcode): Undefined symbol: _OBJC_CLASS_$_AlanButton
Error (Xcode): Undefined symbol: _OBJC_CLASS_$_AlanConfig
Error (Xcode): Undefined symbol: _OBJC_CLASS_$_AlanLog
Could not build the application for the simulator.
Error launching application on iPhone 13 Pro.
@MarsadMaqsood Common workaround for this flutter issue could be this:
- Open iOS project with Xcode
- Navigate to Build Settings of your project and add "Any iOS Simulator SDK" with value arm64 inside Excluded Architecture.
- Set “Validate Workspace" to “Yes” (Build Settings)
- Add this lines to pod file.
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
- Run the app
alan_voice: 3.7.0 flutter version: 3.0.5 M1 chip
I'm facing this issue, when I'm running from Xcode

Uncategorized (Xcode): Command CompileSwiftSources failed with a nonzero exit code
Error (Xcode): Undefined symbol: OBJC_CLASS$_AlanText
Error (Xcode): Undefined symbol: OBJC_CLASS$_AlanButton
Error (Xcode): Undefined symbol: OBJC_CLASS$_AlanConfig
Error (Xcode): Undefined symbol: OBJC_CLASS$_AlanLog
facing the same issue . any solution?
@ilyasarafath please take a look to this comment https://github.com/alan-ai/alan-sdk-flutter/issues/13#issuecomment-1196805694
@MarsadMaqsood Common workaround for this flutter issue could be this:
- Open iOS project with Xcode
- Navigate to Build Settings of your project and add "Any iOS Simulator SDK" with value arm64 inside Excluded Architecture.
- Set “Validate Workspace" to “Yes” (Build Settings)
- Add this lines to pod file.
post_install do |installer| installer.pods_project.build_configurations.each do |config| config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64" end end
- Run the app
i did exaclty as you said here but i ran into another error
Lexical or Preprocessor Issue (Xcode): 'Flutter/Flutter.h' file not found /Users/user/.pub-cache/hosted/pub.dartlang.org/package_info-2.0.2/ios/Classes/FLTPackageInfoPlugin.h:4:8
Uncategorized (Xcode): Command SwiftEmitModule failed with a nonzero exit code
I am trying to follow instructions from https://github.com/alan-ai/alan-sdk-flutter/issues/13#issuecomment-1196805694
But I can't find Validate Workspace option in my build settings. Any idea what I'm doing wrong here?
@hoseyneil please update to the latest SDK version https://pub.dev/packages/alan_voice/versions/3.11.0