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

Not able to generate iOS release build #21073

Closed
MiguelCatalan opened this issue Aug 27, 2018 · 11 comments
Closed

Not able to generate iOS release build #21073

MiguelCatalan opened this issue Aug 27, 2018 · 11 comments
Labels
c: crash Stack traces logged to the console platform-ios iOS applications specifically t: xcode "xcodebuild" on iOS and general Xcode project management tool Affects the "flutter" command-line tool. See also t: labels.

Comments

@MiguelCatalan
Copy link

MiguelCatalan commented Aug 27, 2018

Context

This issue is related to #20564, but in that issue, I assumed it was a problem with the project, but now I tested a fresh project getting the same result. So this is why I'm opening a new thread.

I was working before in an old MacBook Pro, using macOS Sierra. I then migrated to one of the new MacBook Pro (15-inch 2018) with High Sierra and the system stopped generating releases archives. I don't know if it is related but it is the only changed piece.

Now I am able to create a project, run in an emulator, run it in a real device and generate the release version for iOS if there is no extra dependency in the pubspec.yaml. If I add any flutter dependency, Xcode keeps giving the device_info/DeviceInfoPlugin.h file not found error.

I know it is probably something related to my setup, but I tested with other machines with the same configuration, resulting in the same result.

I am not able to generate any release since a month ago. My business is suffering because of this. Please, I beg to anyone point me in the right direction to fix this. I am truly desperate.

Steps to Reproduce

  1. Install everything from scratch, following the guide: https://flutter.io/setup-macos/
  2. Create a hello-world-project using the wizard of IntelliJ IDEA
  3. Run the project in the iOS emulator (runs ok)
  4. Run flutter build ios --release
  5. Open Xcode, set Product -> Scheme -> Runner and Product -> Destination -> Generic iOS Device
  6. Genearte release archive with Product -> Archive

Success, a new build is generated. But there is more.

  1. Add any flutter dependency to the pubspec.yaml, let say this one
  2. Run flutter packages get
  3. Double check and run pod install inside the ios directory.
  4. Run flutter build ios --release
  5. Open Xcode, and try to genearte release archive with Product -> Archive

I get an error device_info/DeviceInfoPlugin.h file not found

And thats it.

I did the workflow before with both IntelliJ IDEA CE and Ultimate, and both kotlin-swift and ObjectiveC-Java combinations.

Also try using beta, dev, and master channels.

And with cocoapods 1.4.0, 1.5.0 and 1.5.3

[✓] Flutter (Channel dev, v0.7.0, on Mac OS X 10.13.6 17G2208, locale en-ES)
    • Flutter version 0.7.0 at /Users/miguelcatalan/Projects/Flutter/flutter
    • Framework revision 09fe34708f (5 days ago), 2018-08-22 10:20:51 -0700
    • Engine revision 4b271b2e02
    • Dart version 2.1.0-dev.1.0.flutter-69fce633b7

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at /Users/miguelcatalan/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-27, build-tools 27.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_152-release-915-b08)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 9.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 9.4.1, Build version 9F2000
    • ios-deploy 1.9.2
    • CocoaPods version 1.5.0

[✓] IntelliJ IDEA Ultimate Edition (version 2018.2.2)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 27.1.3
    • Dart plugin version 182.4129.13

[✓] IntelliJ IDEA Community Edition (version 2017.3.5)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 26.0.1
    • Dart plugin version 173.4700

@zoechi zoechi added c: crash Stack traces logged to the console platform-ios iOS applications specifically tool Affects the "flutter" command-line tool. See also t: labels. labels Aug 27, 2018
@zoechi zoechi added this to the Goals milestone Aug 27, 2018
@chengenzhao
Copy link

#18305
check this one, seems like you have the same problem with this issue

@ened
Copy link
Contributor

ened commented Aug 28, 2018

@MiguelCatalan could you try using fastlane for a test? Here the relevant part from my Fastfile:

lane :beta do
  system '(cd ../../ && flutter build ios --release --no-codesign)'
  build_app(
    workspace: "Runner.xcworkspace",
    scheme: "Runner",
    export_method: 'app-store',
    configuration: 'Release'
  )
end

@MiguelCatalan
Copy link
Author

@chengenzhao you are the man. Indeed was related and the solution worked.

But I think that issue should not be closed because I presume it is a bug the tools doesn't generate that file by itself.

@JigneshWorld
Copy link

@ened Thanks man, your snippet helps me a lot.
flutter build ios --release --no-codesign

@xster xster added t: xcode "xcodebuild" on iOS and general Xcode project management and removed tool Affects the "flutter" command-line tool. See also t: labels. labels Jan 5, 2019
@zoechi zoechi added tool Affects the "flutter" command-line tool. See also t: labels. and removed tool Affects the "flutter" command-line tool. See also t: labels. labels Jan 8, 2019
@kangwang1988
Copy link
Contributor

Using the latest master branch 'flutter doctor -v',

KyleWongdeMacBook-Pro:flutter_issue_21073 kylewong$ flutter doctor -v
[✓] Flutter (Channel master, v1.2.2-pre.19, on Mac OS X 10.14.4 18E184e, locale en-CN)
    • Flutter version 1.2.2-pre.19 at /Users/kylewong/Codes/Flutter/alibaba-flutter/flutter
    • Framework revision 20d9de58d0 (6 hours ago), 2019-02-15 18:43:36 -0800Engine revision 033f2072c3
    • Dart version 2.1.2 (build 2.1.2-dev.0.0 0a7dcf17eb)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/kylewong/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
    • All Android licenses accepted.

[!] iOS toolchain - develop for iOS devices (Xcode 10.1)
    • Xcode at /Applications/Xcode.app/Contents/DeveloperXcode 10.1, Build version 10B61
    ✗ Verify that all connected devices have been paired with this computer in Xcode.
      If all devices have been paired, libimobiledevice and ideviceinstaller may require updating.
      To update with Brew, run:
        brew update
        brew uninstall --ignore-dependencies libimobiledevice
        brew uninstall --ignore-dependencies usbmuxd
        brew install --HEAD usbmuxd
        brew unlink usbmuxd
        brew link usbmuxd
        brew install --HEAD libimobiledevice
        brew install ideviceinstaller
    • ios-deploy 1.9.4CocoaPods version 1.6.0

[✓] Android Studio (version 3.3)
    • Android Studio at /Applications/Android Studio.app/ContentsFlutter plugin version 32.0.1Dart plugin version 182.5215Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

[✓] VS Code (version 1.31.1)
    • VS Code at /Applications/Visual Studio Code.app/ContentsFlutter extension version 2.23.0

I failed to reproduce this issue using steps described in this issue:

Steps to Reproduce

  1. Install everything from scratch, following the guide: https://flutter.io/setup-macos/
  2. Create a hello-world-project using the wizard of IntelliJ IDEA
  3. Run the project in the iOS emulator (runs ok)
  4. Run flutter build ios --release
  5. Open Xcode, set Product -> Scheme -> Runner and Product -> Destination -> Generic iOS Device
  6. Genearte release archive with Product -> Archive

Success, a new build is generated. But there is more.

  1. Add any flutter dependency to the pubspec.yaml, let say this one
  2. Run flutter packages get
  3. Double check and run pod install inside the ios directory.
  4. Run flutter build ios --release
  5. Open Xcode, and try to genearte release archive with Product -> Archive

I get an error device_info/DeviceInfoPlugin.h file not found

And thats it.

I did the workflow before with both IntelliJ IDEA CE and Ultimate, and both kotlin-swift and ObjectiveC-Java combinations.

Also try using beta, dev, and master channels.

And with cocoapods 1.4.0, 1.5.0 and 1.5.3

[✓] Flutter (Channel dev, v0.7.0, on Mac OS X 10.13.6 17G2208, locale en-ES)
    • Flutter version 0.7.0 at /Users/miguelcatalan/Projects/Flutter/flutter
    • Framework revision 09fe34708f (5 days ago), 2018-08-22 10:20:51 -0700
    • Engine revision 4b271b2e02
    • Dart version 2.1.0-dev.1.0.flutter-69fce633b7

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at /Users/miguelcatalan/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-27, build-tools 27.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_152-release-915-b08)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 9.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 9.4.1, Build version 9F2000
    • ios-deploy 1.9.2
    • CocoaPods version 1.5.0

[✓] IntelliJ IDEA Ultimate Edition (version 2018.2.2)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 27.1.3
    • Dart plugin version 182.4129.13

[✓] IntelliJ IDEA Community Edition (version 2017.3.5)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 26.0.1
    • Dart plugin version 173.4700

I'm closing this issue now. Feel free to comment below if anyone can reproduce it using the latest master.

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

@git-xbits
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.

How to check this deployment targets?

@lockelost
Copy link

Any update on this?
I'm also facing the same problem.
Release Build works, but Archive fails with the following error.

'xxx/xxxPlugin.h' file not found

I can not release it to AppStore.

@skppetr0007
Copy link

Make sure you open Runner.xcworkspace instead of Runner.xcodeproj

@ayham95
Copy link

ayham95 commented Apr 10, 2020

For more reference:

Make sure to choose Generic iOS device in xcode

@lock
Copy link

lock bot commented Apr 25, 2020

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.

@lock lock bot locked and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: crash Stack traces logged to the console platform-ios iOS applications specifically t: xcode "xcodebuild" on iOS and general Xcode project management tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

No branches or pull requests