Repository navigation
can not run in device , can only run in simulator with official article https://github.com/flutter/flutter/wiki/Add-Flutter-to-existing-apps#ios #38746
Copy link
Copy link
Closed
Labels
a: existing-appsIntegration with existing apps via the add-to-app flowIntegration with existing apps via the add-to-app flow
Milestone
Description
Steps to Reproduce
- II follow the instructions of the official article about Add-Flutter-to-existing-apps (https://github.com/flutter/flutter/wiki/Add-Flutter-to-existing-apps#ios)
- when I finish , I can run it on the simulator , in my orginal iOS project
- but if I add plugin in dart , like cached_network_image: ^1.1.1
, I can not run it on the device or release mode , only can run in simulator with debug mode , it has compile error .
Logs
this is Xcode compile error
Ld /Users/fuxiaoquan/Library/Developer/Xcode/DerivedData/VpnMaster-gcxshtzmsgkvuledmnwyiqcfsdba/Build/Products/Debug-iphoneos/path_provider/path_provider.framework/path_provider normal arm64
cd /Users/fuxiaoquan/Desktop/beginFromBegin/VpnMaster/Pods
export IPHONEOS_DEPLOYMENT_TARGET=8.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch arm64 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.4.sdk -L/Users/fuxiaoquan/Library/Developer/Xcode/DerivedData/VpnMaster-gcxshtzmsgkvuledmnwyiqcfsdba/Build/Products/Debug-iphoneos/path_provider -F/Users/fuxiaoquan/Library/Developer/Xcode/DerivedData/VpnMaster-gcxshtzmsgkvuledmnwyiqcfsdba/Build/Products/Debug-iphoneos/path_provider -F/Users/fuxiaoquan/Desktop/beginFromBegin/VpnMaster/Pods/../../vpnmaster_flutter/.ios/Flutter/engine -filelist /Users/fuxiaoquan/Library/Developer/Xcode/DerivedData/VpnMaster-gcxshtzmsgkvuledmnwyiqcfsdba/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/path_provider.build/Objects-normal/arm64/path_provider.LinkFileList -install_name @rpath/path_provider.framework/path_provider -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -miphoneos-version-min=8.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/fuxiaoquan/Library/Developer/Xcode/DerivedData/VpnMaster-gcxshtzmsgkvuledmnwyiqcfsdba/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/path_provider.build/Objects-normal/arm64/path_provider_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -fembed-bitcode-marker -fobjc-arc -fobjc-link-runtime -framework Foundation -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/fuxiaoquan/Library/Developer/Xcode/DerivedData/VpnMaster-gcxshtzmsgkvuledmnwyiqcfsdba/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/path_provider.build/Objects-normal/arm64/path_provider_dependency_info.dat -o /Users/fuxiaoquan/Library/Developer/Xcode/DerivedData/VpnMaster-gcxshtzmsgkvuledmnwyiqcfsdba/Build/Products/Debug-iphoneos/path_provider/path_provider.framework/path_provider
ld: warning: Could not find auto-linked framework 'Flutter'
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_FlutterStandardTypedData", referenced from:
objc-class-ref in SqflitePlugin.o
"_OBJC_CLASS_$_FlutterError", referenced from:
objc-class-ref in SqflitePlugin.o
"_OBJC_CLASS_$_FlutterMethodChannel", referenced from:
objc-class-ref in SqflitePlugin.o
"_FlutterMethodNotImplemented", referenced from:
-[SqflitePlugin handleMethodCall:result:] in SqflitePlugin.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
[✓] Flutter (Channel master, v1.9.1-pre.59, on Mac OS X 10.14.6 18G87, locale
zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 10.3)
[✓] Android Studio (version 3.4)
[✓] Connected device (2 available)
what should I do ? can run in device or release mode?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
a: existing-appsIntegration with existing apps via the add-to-app flowIntegration with existing apps via the add-to-app flow
Activity
[-]https://github.com/flutter/flutter/wiki/Add-Flutter-to-existing-apps#ios [/-][+]can not run in device , can only run in simulator, https://github.com/flutter/flutter/wiki/Add-Flutter-to-existing-apps#ios [/+][-]can not run in device , can only run in simulator, https://github.com/flutter/flutter/wiki/Add-Flutter-to-existing-apps#ios [/-][+]can not run in device , can only run in simulator with official article https://github.com/flutter/flutter/wiki/Add-Flutter-to-existing-apps#ios [/+]jmagman commentedon Aug 19, 2019
Flutter is not currently supported on the simulator in profile or release mode. You should be able to run build configurations on a real device, though.
Are you running from your app's xcworkspace? CocoaPods will create a xcworkspace (if one doesn't already exist) and add the plugin targets there.
imfaker commentedon Aug 20, 2019
I am running very well in simulator ,but can not running in device.
And I use cocoapods and add the plugin targets there , follow (https://github.com/flutter/flutter/wiki/Add-Flutter-to-existing-apps#ios)
jmagman commentedon Aug 20, 2019
Can you confirm you are running from your original app's .xcworkspace that contains the Pods project and not the .xcodeproj?
jmagman commentedon Aug 20, 2019
And confirm that you ran
pod install?imfaker commentedon Aug 21, 2019
yes I am sure。If I did not do this , I can not runing in simulator .`


this is my pod project
`
jmagman commentedon Aug 21, 2019
Very fair point 😀
I am just trying to figure out why the arm* architecture Flutter framework isn't found in the search paths because I am not able to reproduce on Channel master, v1.9.2-pre.41. I can run on a device and the simulator in Debug with sqflite plugin, etc. And I see Flutter in your Development Pods...
but you did that I assume since it's working from the simulator...
Are you able to make a test app that reproduces this?
dntzee commentedon Aug 23, 2019
I have the same error,I follow the instructions of the official article about Add-Flutter-to-existing-apps (https://github.com/flutter/flutter/wiki/Add-Flutter-to-existing-apps#ios).
Everything works fine, when I add these dependencies to the pubspec.yaml file,
iOS won't run on the device,
it can only run in the simulator.
cupertino_icons: '0.1.2' dio: '2.1.13' path_provider: '1.2.0' dio_flutter_transformer: '2.0.10' page_transition: '1.1.4' flutter_easyrefresh: '1.2.7' fluro: '1.5.1' event_bus: '1.1.0' image_picker: '0.4.12+1' flutter_screenutil: '0.5.3' fluttertoast: '^2.2.11' video_player: '0.9.0' audioplayer: #^0.5.2 cached_network_image: '1.1.1' shared_preferences: '0.5.3+4' flutter_html: '0.10.4' flutter_webview_plugin: '0.3.2'6 remaining items
leielyq commentedon Aug 28, 2019
@imfaker 你弄好了吗
imfaker commentedon Aug 29, 2019
后面我反正用了其它方法 解决, 这个 问题可能原因 ,是你的 flutter 引擎可能对不上, 如果你的 flutter。framework 是别人 发给你的,不是自己生成的 ,检查下两边的对应库版本是不是 一样 ,都是master channel。然后还有可能 就是我也不知道是 bug 还是 什么原因,你再试试重新 flutter clean生成新的试试。 周末我可能会找下具体的原因,现在这个问题我是偶尔出现 ,有时候又好。
(I used other methods to solve it later. The possible cause of this problem is that your flutter engine may not be right if you have flutter. The framework is sent to you by others, not generated by yourself. Check whether the corresponding library versions on the next two sides are the same, both are master channels. Then there is probably that I don't know if it's a bug or what, you try to re-flutter clean to generate a new one. I may find a specific reason for the weekend. Now I have occasional problems, sometimes good.)
imfaker commentedon Aug 29, 2019
no, I solve this problen in other way , and I think I would found reason in this weekend ,
jmagman commentedon Aug 29, 2019
Yes, you need the same version of the framework that corresponds to the version of Flutter you have installed.
@leielyq is that your issue, too?
leielyq commentedon Aug 29, 2019
I know! My project have path_provider and sqflite . And them has this.
then,I new project,And remove path_provider and sqflite .this is OK!
I speack english a little.
leielyq commentedon Aug 29, 2019
I discover oc and swift project, flutter no work
leielyq commentedon Aug 29, 2019
But,my project use a lot of path_provider,sad
leielyq commentedon Aug 29, 2019
可能看一下你的path_provider版本吗
imfaker commentedon Aug 31, 2019
你报的什么错
shawn736 commentedon Sep 17, 2019
Undefined symbols for architecture arm64:
"OBJC_CLASS$_FlutterMethodChannel", referenced from:
objc-class-ref in PathProviderPlugin.o
"_FlutterMethodNotImplemented", referenced from:
___47+[FLTPathProviderPlugin registerWithRegistrar:]_block_invoke in PathProviderPlugin.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Using the "stable" branch of the Flutter SDK, I have same error only on the real device. When I change to the "master" branch, it both works on the device and simulator.
jmagman commentedon Sep 17, 2019
The issue reported by the originator is that their version of the Flutter.framework did not match the version of Flutter that compiled their dart code (assuming I'm translating correctly). This is expected behavior since there is not guaranteed binary compatibility between different versions of dart. So I'm going to close this issue.
Anyone else with a similar linker error on a real device and not the simulator, should file a new issue and link to this one if:
flutter upgrade. Add-to-app must be run from the master channel. See https://github.com/flutter/flutter/wiki/Add-Flutter-to-existing-apps#intro.flutter clean.fluttertools (the originator's issue).A sample app reproducing the issue is always appreciated as well.
Thanks!
github-actions commentedon Aug 27, 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.