mobile_scanner icon indicating copy to clipboard operation
mobile_scanner copied to clipboard

[IOS]: Pods/MLImage/Frameworks/MLImage.framework/MLImage' for architecture arm64

Open songhee24 opened this issue 1 year ago • 22 comments

when i start building ios project I get an error:

↳
    ** BUILD FAILED **


Xcode's output:
↳
    Writing result bundle at path:
    	/var/folders/rn/r4vcnfnn7zj7gwx5w7fbgldh0000gn/T/flutter_tools.K8VYGY/flutter_ios_build_temp_diroPUaJI/temporary_xcresult_bundle

    ld: warning: ignoring file /Users/mac/WebstormProjects/srs/build/ios/Debug-iphonesimulator/Pods_Runner.framework/Pods_Runner, building for iOS Simulator-arm64 but attempting to link with file built for iOS Simulator-x86_64
    ld: in /Users/mac/WebstormProjects/srs/ios/Pods/MLImage/Frameworks/MLImage.framework/MLImage(GMLImage.o), building for iOS Simulator, but linking in object file built for iOS, file '/Users/mac/WebstormProjects/srs/ios/Pods/MLImage/Frameworks/MLImage.framework/MLImage' for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    note: Building targets in dependency order
    note: Run script build phase 'Thin Binary' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'Runner' from project 'Runner')
    note: Run script build phase 'Run Script' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'Runner' from project 'Runner')

    Result bundle written to path:
    	/var/folders/rn/r4vcnfnn7zj7gwx5w7fbgldh0000gn/T/flutter_tools.K8VYGY/flutter_ios_build_temp_diroPUaJI/temporary_xcresult_bundle


Error (Xcode): In /Users/mac/WebstormProjects/srs/ios/Pods/MLImage/Frameworks/MLImage.framework/MLImage(GMLImage.o), building for iOS Simulator, but linking in object file built for iOS, file '/Users/mac/WebstormProjects/srs/ios/Pods/MLImage/Frameworks/MLImage.framework/MLImage' for architecture arm64

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

I tried changing the Excluded Architectures to arm64 Screenshot 2023-04-10 at 18 11 14

the project is being built, but I noticed that after it was built, the simulator slows down very seriously, just the usual scroll lags how can i fix this ? what could be the problem with this ?

but when I uploaded it to the testflight and downloaded and checked there are no lags, does it mean that something is wrong with my laptop?

EDITED:

i tried to create a new flutter app which just builds a list no extra loads

Screenshot 2023-04-11 at 18 41 06 I also tried to change the launch runner to arm64

the same thing, it works slowly, it lags when I try to scroll, as I understand it, this is not related to the library mobile_scanner

but why it throws error when i try to run my app without Excluded Architectures to arm64

Deleting pods or flutter clean doesn't change anything

songhee24 avatar Apr 10 '23 12:04 songhee24

I'm having this same issue, please has a fix been found ? changed mine from armv7 to arm64 and it still threw that error

theDeji avatar Apr 11 '23 10:04 theDeji

@theDeji aggressively trying to understand the problem 😅

songhee24 avatar Apr 11 '23 12:04 songhee24

😂 😂 😂 I really do need it fixed

theDeji avatar Apr 11 '23 13:04 theDeji

I try run my app using rosseta but my application broke too.

lucasvini382 avatar Apr 27 '23 21:04 lucasvini382

@lucasvini382 hey did you try to put arm64 in Excluded Architectures ?

songhee24 avatar May 02 '23 18:05 songhee24

Yes @songhee24 i make this

lucasvini382 avatar May 02 '23 18:05 lucasvini382

If I exclude arm64, then the app does not run at all... I guess it is because I am using an ARM based macOS

Tienisto avatar Jul 02 '23 22:07 Tienisto

Anyone found workaround for this?

mrRedSun avatar Jul 20 '23 15:07 mrRedSun

I figured out that I need to install Rosetta 2.

Tienisto avatar Jul 20 '23 16:07 Tienisto

This is Known issues for GoogleMlkit.

themon303 avatar Oct 02 '23 06:10 themon303

Did somebody figure out how to temporarily remove/disable Google/MLKit to allow developing with simulators for features where mobile_scanner will not be used?

rdesimone avatar Oct 12 '23 10:10 rdesimone

XCode 15 + Sonoma + latest flutter (3.13.6) + default excluded architectures in xcode = simulator working for me on M1 mac

mrRedSun avatar Oct 12 '23 10:10 mrRedSun

@mrRedSun would you mind to share a screenshot of the mentioned xCode Build Settings? Thanks!

rdesimone avatar Oct 12 '23 10:10 rdesimone

@rdesimone sure thing image

mrRedSun avatar Oct 12 '23 10:10 mrRedSun

Thanks a lot, I removed i386 and now it works!

rdesimone avatar Oct 12 '23 10:10 rdesimone

So the workaround is to remove i386 and the issue disappears. No sure if we can close the ticket yet, but nice to know

mrRedSun avatar Oct 12 '23 10:10 mrRedSun

it was the only difference I could see between yours and my settings.

rdesimone avatar Oct 12 '23 10:10 rdesimone

I have the same issue, when introducing mobile scanner package, my App is very slow in iOS simulator...

Hilbert2048 avatar Oct 22 '23 05:10 Hilbert2048

Hi all,

I am working on a completely separate project with XCode but have found a workaround for getting this working on simulators on Apple Silicon Macs. You need to run the project built for x86_64 for simulator builds, and then run the simulator in Rosetta. Until Google fix the known issue linked by @themon303 there is no getting around this.

  1. Set up the architecture for your project (not the individual target!), and the Pods project (not a target!) to replicate the following:

    image

    Of importance: Any iOS Simulator SDK should be set to x86_64 and on debug you should enable Build Active Architecture Only. Also note I am not excluding any architectures, Apple themselves do not recommend doing this unless absolutely necessary.

  2. Check that the Pods config file is not intefering and adding an excluded architecture by lookind under Pods -> Targets Support Files -> Pods-[PROJECTNAME] -> Pods-[PROJECTNAME].debug.xcconfig

    image

  3. Unhide Rosetta by going to Product -> Destination -> Destination Architectures -> Show Both

    image

  4. Select a Rosetta Simulator (e.g. iPhone 15 Pro (Rosetta)), and run! (might be advisable to clean the build folder prior to running but it should work regardless).

Good luck!

AnthonyWharton avatar Feb 07 '24 19:02 AnthonyWharton

FYI, here is the open issue link of Google issue: issuetracker.google.com/issues/17896515

kyle-seongwoo-jun avatar May 03 '24 08:05 kyle-seongwoo-jun