Closed
Description
I created an application and try to release build it, it's error .
and I tried it with the smallest project to reproduce it, but it was useless.
please help!
How to
Terminal
flutter create foober
cd foober
open pubspec.yaml
add text
shared_preferences: ^0.4.1
Terminal
flutter packages get
flutter build ios
open ios/Runner.xcodeproj
in xcode
SideBar -> Runner [click]
Signing -> Team [select my team]
Product -> Destination -> Generic iOS Device.
Product -> Archive
error log
ld: warning: directory not found for option '-L/Users/{Account}/Library/Developer/Xcode/DerivedData/Runner-dsaqpbxjbtkcgvdontanncvipuur/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/shared_preferences'
ld: library not found for -lshared_preferences
clang: error: linker command failed with exit code 1 (use -v to see invocation)
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, v0.5.3-pre.11, on Mac OS X 10.13.4 17E202, locale ja-JP)
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 9.4)
[✓] Android Studio (version 3.1)
[✓] Connected devices (1 available)
• No issues found!
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
katout commentedon Jun 8, 2018
If I don't use shared_preferences it will succeed
chinmaygarde commentedon Jun 9, 2018
@cbracken: Could this be because a pod step failed?
cbracken commentedon Jun 9, 2018
This sounds like
pod install
may have failed.@katout, would you mind attaching the output of
flutter -v build ios
?Assuming that fails, what happens if you run
flutter -v run
with an iOS device attached?/cc @xster
katout commentedon Jun 9, 2018
Thank you for reply! @chinmaygarde and @cbracken.
I think so too. The cause is cocoapods.
flutter -v build ios
notConnect.txt
flutter -v run (with an iOS device attached)
this case, success!
connect.txt
found a solution
cbracken commentedon Jun 15, 2018
@katout thanks for the update.
For what it's worth, as of the latest dev branch release, you should be able to safely set the architectures to the default value. Flutter should now be able to detect the change to the project and run the appropriate pod steps. I expect this should make it to the beta branch within a week.
Details of the Xcode changes at:
https://github.com/flutter/engine/wiki/iOS-Builds-Supporting-ARMv7
raphaelcrv commentedon Feb 15, 2019
Solved! tks u really helped me !! :)
iamatulkumar commentedon Aug 21, 2019
I figured out the problem, all of the deployment targets need to be the same. That is, in the project file, the target, and the pods project as well.
lockelost commentedon Nov 27, 2019
This is always reproducible.
I even created a new project, just pasting this dependency causes Archive problem.
Build for a physical device or Generic device works fine.
$ flutter --version
$ flutter doctor -v
github-actions commentedon Aug 25, 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 -v
and a minimal reproduction of the issue.