Skip to content

ios build archive fails #18305

Closed
Closed
@katout

Description

@katout

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!

Activity

katout

katout commented on Jun 8, 2018

@katout
Author

If I don't use shared_preferences it will succeed

chinmaygarde

chinmaygarde commented on Jun 9, 2018

@chinmaygarde
Member

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

cbracken

cbracken commented on Jun 9, 2018

@cbracken
Member

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

added
toolAffects the "flutter" command-line tool. See also t: labels.
on Jun 9, 2018
katout

katout commented on Jun 9, 2018

@katout
Author

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

cbracken commented on Jun 15, 2018

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

raphaelcrv commented on Feb 15, 2019

@raphaelcrv

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

iamatulkumar commented on Aug 21, 2019

@iamatulkumar

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

lockelost commented on Nov 27, 2019

@lockelost

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

github-actions commented on Aug 25, 2021

@github-actions

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.

locked as resolved and limited conversation to collaborators on Aug 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    packageflutter/packages repository. See also p: labels.toolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @chinmaygarde@cbracken@katout@lockelost@raphaelcrv

        Issue actions

          ios build archive fails · Issue #18305 · flutter/flutter