Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ios build archive fails #18305

Closed
katout opened this issue Jun 8, 2018 · 9 comments
Closed

ios build archive fails #18305

katout opened this issue Jun 8, 2018 · 9 comments
Labels
package flutter/packages repository. See also p: labels. tool Affects the "flutter" command-line tool. See also t: labels.

Comments

@katout
Copy link

katout commented Jun 8, 2018

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!
@katout
Copy link
Author

katout commented Jun 8, 2018

If I don't use shared_preferences it will succeed

@chinmaygarde
Copy link
Member

@cbracken: Could this be because a pod step failed?

@cbracken
Copy link
Member

cbracken commented 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

@cbracken cbracken added the tool Affects the "flutter" command-line tool. See also t: labels. label Jun 9, 2018
@katout
Copy link
Author

katout commented 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

  1. open ios/Runner.xcodeproj
  2. I checked Runner/Pods is empty in Xcode sidebar.
  3. drop Pods/Pods.xcodeproj into Runner/Pods.
  4. "Valid architectures" to only "arm64" (I removed armv7 armv7s) Error building ios archive in xcode #13364

@cbracken
Copy link
Member

@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
Copy link

I think so too. The cause is cocoapods.

flutter -v build ios

notConnect.txt

flutter -v run (with an iOS device attached)

Solved! tks u really helped me !! :)

@iamatulkumar
Copy link

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
Copy link

lockelost commented 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.

dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter

cupertino_icons: ^0.1.2
file_picker: ^1.4.0
path_provider: ^1.3.0
flutter_html: ^0.11.0
admob_flutter: ^0.3.3
photos_saver: ^0.0.2
qrcode_reader: ^0.4.4

$ flutter --version

Flutter 1.9.1+hotfix.6 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 68587a0 (2 months ago) • 2019-09-13 19:46:58 -0700
Engine • revision b863200
Tools • Dart 2.5.0

$ flutter doctor -v

[✓] Flutter (Channel stable, v1.9.1+hotfix.6, on Mac OS X 10.15.1 19B88, locale en)
• Flutter version 1.9.1+hotfix.6 at /Users/???/development/flutter
• Framework revision 68587a0 (2 months ago), 2019-09-13 19:46:58 -0700
• Engine revision b863200
• Dart version 2.5.0

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/???/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/???/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)
• ???’s iPhone • ????? • ios • iOS 13.1.3

• No issues found!

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 25, 2021
@flutter-triage-bot flutter-triage-bot bot added the package flutter/packages repository. See also p: labels. label Jul 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package flutter/packages repository. See also p: labels. tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

No branches or pull requests

6 participants