Knightro63 / flutter_angle

Flutters Almost Native Graphics Layer Engine.
4 stars 1 forks source link

Build failing for iOS simulator #5

Open alexgrusu opened 1 week ago

alexgrusu commented 1 week ago

Log

Launching lib/main.dart on iPhone 15 in debug mode...
Xcode build done.                                            4.5s
Failed to build iOS app
Error (Xcode): Undefined symbol: _eglChooseConfig

Error (Xcode): Undefined symbol: _eglCreateImageKHR

Error (Xcode): Undefined symbol: _eglCreateWindowSurface

Error (Xcode): Undefined symbol: _eglGetDisplay

Error (Xcode): Undefined symbol: _eglGetError

Error (Xcode): Undefined symbol: _eglGetProcAddress

Error (Xcode): Undefined symbol: _eglInitialize

Error (Xcode): Undefined symbol: _eglMakeCurrent

Error (Xcode): Undefined symbol: _eglQueryDeviceAttribEXT

Error (Xcode): Undefined symbol: _eglQueryDisplayAttribEXT

Error (Xcode): Linker command failed with exit code 1 (use -v to see invocation)

Could not build the application for the simulator.
Error launching application on iPhone 15.

Root cause

The following build commands failed: Ld /Users/epsilon/Projects/app/build/ios/Debug-sandbox-iphonesimulator/flutter_angle_darwin/flutter_angle_darwin.framework/flutter_angle_darwin normal (in target 'flutter_angle_darwin' from project 'Pods')

XCode version

epsilon@192 ios % xcodebuild -version

Xcode 15.3
Build version 15E204a

Simulator

iPhone 15
iOS 17.4

Package version: flutter_angle 0.0.4

Podfile

# Uncomment this line to define a global platform for your project
platform :ios, '15.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
  'Debug' => :debug,
  'Profile' => :release,
  'Release' => :release,
}

def flutter_root
  generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
  unless File.exist?(generated_xcode_build_settings_path)
    raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
  end

  File.foreach(generated_xcode_build_settings_path) do |line|
    matches = line.match(/FLUTTER_ROOT\=(.*)/)
    return matches[1].strip if matches
  end
  raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
  use_frameworks!
  use_modular_headers!

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
  target 'RunnerTests' do
    inherit! :search_paths
  end
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
    target.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.0'
    end
  end
end

Is there any way to make the build pass for iOS simulator?

Knightro63 commented 1 week ago

Hi @alexgrusu,

This is currently only made for macOS, iOS, android, android simulator, and windows. The apple os "darwin" package could probably be rewritten to use the new angle 1.5, but I do not have time to write it. Here is an example of someone who has written angle 1.5 to be used with all apple os devices, but is not made for flutter.

Sorry for not having this work for all devices yet.