Repository navigation
Error when 'flutter run': Undefined symbols for architecture arm64: #41900
Copy link
Copy link
Closed
Labels
t: xcode"xcodebuild" on iOS and general Xcode project management"xcodebuild" on iOS and general Xcode project managementtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Description
I get error when 'flutter run':
charlesdeMBP:rongchang_app charles$ flutter run
Launching lib/main.dart on yueji的 iPhone in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: G5JFP3Y63E
Running pod install... 2.8s
Running Xcode build...
Xcode build done. 10.2s
Failed to build iOS app
Error output from Xcode build:
↳
2019-10-03 18:01:56.053 xcodebuild[60982:3066650] DTDeviceKit: deviceType from 43905bacecbd9af724d1c568192bbbe425c383b4 was NULL
2019-10-03 18:01:56.115 xcodebuild[60982:3066698] DTDeviceKit: deviceType from 43905bacecbd9af724d1c568192bbbe425c383b4 was NULL
** BUILD FAILED **
Xcode's output:
↳
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_FlutterStandardMessageCodec", referenced from:
objc-class-ref in FlutterWebView.o
"_OBJC_CLASS_$_FlutterError", referenced from:
objc-class-ref in FLTWKNavigationDelegate.o
objc-class-ref in FlutterWebView.o
"_OBJC_CLASS_$_FlutterMethodChannel", referenced from:
objc-class-ref in FLTCookieManager.o
objc-class-ref in FlutterWebView.o
"_FlutterMethodNotImplemented", referenced from:
-[FLTCookieManager handleMethodCall:result:] in FLTCookieManager.o
___83-[FLTWKNavigationDelegate webView:decidePolicyForNavigationAction:decisionHandler:]_block_invoke in FLTWKNavigationDelegate.o
-[FLTWebViewController onMethodCall:result:] in FlutterWebView.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 systemnote: Planning buildnote: Constructing build description
Could not build the precompiled application for the device.
Error launching application on yueji的 iPhone.
It seems not FlutterWebView cause the problem, because I have many dependencies in my application, when I remove FlutterWebView and flutter run get the same error but with other library.
flutter doctor -v show this:
[✓] Flutter (Channel stable, v1.9.1+hotfix.4, on Mac OS X 10.14.6 18G95, locale zh-Hans-CN)
• Flutter version 1.9.1+hotfix.4 at /Users/charles/development/flutter
• Framework revision cc949a8e8b (6 days ago), 2019-09-27 15:04:59 -0700
• Engine revision b863200c37
• Dart version 2.5.0
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/charles/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 28.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.0)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.0, Build version 11A420a
• CocoaPods version 1.8.0
[✓] Android Studio (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 39.0.3
• Dart plugin version 191.8423
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
[✓] VS Code (version 1.38.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.4.1
[✓] Connected device (1 available)
• yueji的 iPhone • 43905bacecbd9af724d1c568192bbbe425c383b4 • ios • iOS 12.4.1
• No issues found!
Thank you very much for any help!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
t: xcode"xcodebuild" on iOS and general Xcode project management"xcodebuild" on iOS and general Xcode project managementtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Activity
BondarenkoStas commentedon Oct 3, 2019
@Charles1198 Please check if you can run it on simulator. Can you please try if it's the same on master channel?
Seems similar to #38746
Charles1198 commentedon Oct 3, 2019
On simulator the same error but " Undefined symbols for architecture x86_64:"
Charles1198 commentedon Oct 3, 2019
There has no error 3 days age, I have published both android and iOS app successfully and not open the project until this morning. Today when I try to run the application again, it runs error. It is so weird.
Charles1198 commentedon Oct 5, 2019
Solved by check flutter channel from stable to master.
BondarenkoStas commentedon Oct 11, 2019
@timtraversy Can you please check if you having the issue on master? (to make sure it's the same issue). The fixes landed on master eventually will be in stable, that's the process of development. Hotfixes to stable are done only for some very severe cases, and in general not a good practice.
I understand your pain, and if you can't use dev and stable also blocks you, I can help to find the fix commits, so you can cherry-pick them into your stable.
pedrobrasileiro commentedon Oct 28, 2019
Dont work from me...
My mac as High Sierra (10.13.6) and continue this error.
This project i created with flutter create name_project
BondarenkoStas commentedon Oct 29, 2019
@pedrobrasileiro You posted doctor with stable, if it doesn't work with master channel then probably there is another cause. Can you please file a new issue with that, including full error log (probably referencing this issue)? In this way things will be less messy and author won't be notified for nothing.
nicowernli commentedon Dec 5, 2019
Still happens to me when I try to use flutter flavors:
$ flutter doctor -v [✓] Flutter (Channel master, v1.12.17-pre.80, on Mac OS X 10.15.1 19B88, locale es-ES) • Flutter version 1.12.17-pre.80 at /Users/nicowernli/Development/lib/flutter • Framework revision 649e188562 (7 hours ago), 2019-12-05 09:41:49 +0100 • Engine revision fdaa7cf121 • Dart version 2.7.0 (build 2.7.0-dev.2.1 413867d678) [✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2) • Android SDK at /Users/nicowernli/Library/Android/sdk • Android NDK location not configured (optional; useful for native profiling support) • Platform android-29, build-tools 29.0.2 • ANDROID_HOME = /Users/nicowernli/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 11.2.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 11.2.1, Build version 11B500 • CocoaPods version 1.8.4 [✓] Android Studio (version 3.5) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin version 41.1.2 • Dart plugin version 191.8593 • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405) [✓] Connected device (1 available) • iPhone 11 Pro Max • 86AEAB75-B219-470A-B54F-547316D93AFC • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-2 (simulator) • No issues found!The error:
Charles1198 commentedon Dec 5, 2019
@nicowernli
I met this problem several times later, every time I can solve it by checkout to master channel and then checkout to stable channel. I know it is not the right solution but it works. Hope to help you.
mayurdhurpate commentedon Jan 10, 2020
Faced this error recently after upgrading from Flutter 1.9 to Flutter 1.12. Not sure if this is because of the Smartlook plugin or a general Flutter issue. Also, many times the Flutter run command succeeds on iOS emulator and fails other times. Also, I deleted the previous Podfile and let Flutter generate the new Podfile and new Podfile.lock.
Output of
flutter run -v: https://pastebin.com/t0G8rEnBError snippet:
Flutter Doctor
12 remaining items
ShizaS commentedon Apr 24, 2020
Im having a similar issue and its been days that i cant figure out the issue .Any help will be appreciated.
Undefined symbols for architecture armv7:
"_FlutterMethodNotImplemented", referenced from:
-[FLTConnectivityPlugin handleMethodCall:result:] in FLTConnectivityPlugin.o
"OBJC_CLASS$_FlutterEventChannel", referenced from:
objc-class-ref in FLTConnectivityPlugin.o
"OBJC_CLASS$_FlutterMethodChannel", referenced from:
objc-class-ref in FLTConnectivityPlugin.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Greatcallie commentedon May 8, 2020
Sorry but I don't understand this, can someone explain?
SeanZom commentedon May 11, 2020
same as #41900 (comment)
yerkbn commentedon Jul 6, 2020
I solved my problem by File-> Workspace Settings changing build system to New Build System
radiKal07 commentedon Dec 21, 2020
Still having this problem
fullflash commentedon May 29, 2021
same issue.
done all cleaning upgrade etc still unable to build with latest mac and xcode 12.5 and flutter 2.2
yxwandroid commentedon Jun 18, 2021
有相同问题
dafinoer commentedon Jun 27, 2021
i stil get same issue
radiKal07 commentedon Jun 28, 2021
@Charles1198 can you please re-open the issue since this is not fixed?
kasvith commentedon Jun 28, 2021
I also get this
dafinoer commentedon Jun 29, 2021
please re-open this issue @Charles1198
twocolors commentedon Jun 30, 2021
I also get this, please re-open this issue @Charles1198
Akshar-Patel commentedon Jul 7, 2021
The following steps work for me for M1 Mac:
1. Clean up
2. Get pods
3. Run the app (IMPORTANT: Running from Xcode might fail)
github-actions commentedon Jul 30, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.