본문 바로가기

Programming/flutter

[flutter] agora simulator 연동 문제

Launching lib/main.dart on iPhone 13 in debug mode...

Updating project for Xcode compatibility.

Upgrading project.pbxproj

Upgrading Runner.xcscheme

Xcode build done.                                            6.2s

Failed to build iOS app

Error output from Xcode build:

↳

    ** BUILD FAILED **

Xcode's output:

↳

    ld: building for iOS Simulator, but linking in dylib built for iOS, file '/Users~~~~~~~~ (디렉토리명 삭제) 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

Could not build the application for the simulator.

Error launching application on iPhone 13.

Exited (sigterm)

 

방학이 시작되고 기존에 하던 프로젝트를 다시 열었다.

 

flutter가 2.8로 업데이트 되면서 많은 부분에 변경이 필요하였다.

 

Big Sur 11.6으로 업데이틀 하였으며

 

(포토샵이나, 일러스트나, 후에 작곡 프로그램의 안정성 때문에 사실 안올릴려 하였다. 그냥 카탈리나로 계속 가고 싶었지만, ios simulator를 사용하려면 어쩔 수 없이 업데이트가 필수적이었다.)

 

그러고 나타나는 문제점들이 있었다.

 

개인적인 뇌피셜로 big sur가 이제 arm cpu 기반으로 만들어진 리뉴얼 된 os 이기 때문에 이런점이 있지 않을까 싶다. amr64를 계속 인식해서인지 intel cpu 맥북에서는 안돌아가는 것 같았다. 그래서 pod file에 다음과 같은 코드를 추가해서 문제를 해결하였다. 

 

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'] = '9.0'
      config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'i386 arm64'
      end
  end
end

 

(볼드체로 작성된 부분)

 

다음과 같이 작성하고 문제 없이 simulator에 실행됨을 알 수 있었다.

 

물론 아이폰11 14.6에서는 문제 없이 돌아갔었다. 

 

 

------

 

** 추가 해당 코드를 작성하니 아이폰11 14.6에서 돌아가지 않았다. 15.2로 업데이트를 하고 다시 진행해볼 예정