alan-sdk-flutter icon indicating copy to clipboard operation
alan-sdk-flutter copied to clipboard

IOS build failed

Open MarsadMaqsood opened this issue 1 year ago • 3 comments

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

MarsadMaqsood avatar Jul 22 '22 16:07 MarsadMaqsood

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?

snyuryev avatar Jul 26 '22 14:07 snyuryev

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 avatar Jul 26 '22 20:07 MarsadMaqsood

@MarsadMaqsood Common workaround for this flutter issue could be this:

  1. Open iOS project with Xcode
  2. Navigate to Build Settings of your project and add "Any iOS Simulator SDK" with value arm64 inside Excluded Architecture.
  3. Set “Validate Workspace" to “Yes” (Build Settings)
  4. 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
  1. Run the app

snyuryev avatar Jul 27 '22 14:07 snyuryev

alan_voice: 3.7.0 flutter version: 3.0.5 M1 chip

I'm facing this issue, when I'm running from Xcode

Screenshot 2022-10-04 at 19 25 25

kherel avatar Oct 04 '22 17:10 kherel

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 avatar Oct 19 '22 09:10 ilyasarafath

@ilyasarafath please take a look to this comment https://github.com/alan-ai/alan-sdk-flutter/issues/13#issuecomment-1196805694

snyuryev avatar Nov 10 '22 17:11 snyuryev

@MarsadMaqsood Common workaround for this flutter issue could be this:

  1. Open iOS project with Xcode
  2. Navigate to Build Settings of your project and add "Any iOS Simulator SDK" with value arm64 inside Excluded Architecture.
  3. Set “Validate Workspace" to “Yes” (Build Settings)
  4. 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
  1. 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

Amudajr avatar Jan 27 '23 21:01 Amudajr

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 avatar Feb 19 '23 11:02 hoseyneil

@hoseyneil please update to the latest SDK version https://pub.dev/packages/alan_voice/versions/3.11.0

snyuryev avatar Feb 21 '23 12:02 snyuryev