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

pod install step fails when running with --local-engine on newly-created project #9154

Closed
cbracken opened this issue Apr 3, 2017 · 4 comments
Labels
c: regression It was better in the past than it is now tool Affects the "flutter" command-line tool. See also t: labels.

Comments

@cbracken
Copy link
Member

cbracken commented Apr 3, 2017

Steps to Reproduce

  1. flutter create foobar
  2. cd foobar
  3. Open ios/Runner.xcworkspace and set up signing
  4. flutter run --local-engine ios_debug_unopt -d mydevice -v

Output:

[ +592 ms
] Launching lib/main.dart on the Doom Melon in debug mode...

[   +1 ms] /Users/cbracken/.homebrew/bin/idevicesyslog
[   +2 ms] Building Runner.app for 956919950000126a7f5aaf03cbd5fbc18ac75e65
[   +7 ms] xcodebuild -version
[ +101 ms
] Exit code 0 from: xcodebuild -version
[        ] Xcode 8.3
           Build version 8E162
[   +1 ms] python -c import six
[  +33 ms] Trying to resolve native pub services.
[   +1 ms] Looking for YAML at 'pubspec.yaml'
[  +37 ms] No services specified in the manifest
[        ] Found 0 service definition(s).
[        ] Copying service frameworks to '/Users/cbracken/src/text_input/ios/Frameworks'.
[        ] Creating service definitions manifest at 'ios/ServiceDefinitions.json'
[  +39 ms] pod --version
[ +362 ms
] pod --version
[ +360 ms
] Exit code 0 from: pod --version
[        ] 1.2.0
[   +1 ms] Running pod install...

[   +1 ms] [ios/] pod install
[ +663 ms
] Analyzing dependencies
                    Fetching podspec for `Flutter` from `/Users/cbracken/src/flutter/engine/src/out/ios_debug_unopt`
                    [!] No podspec found for `Flutter` in `/Users/cbracken/src/flutter/engine/src/out/ios_debug_unopt`
[   +2 ms] 'flutter run' took 4061ms.
Error running pod install: Exit code 1 from: pod install

#0      throwToolExit (package:flutter_tools/src/base/common.dart:29)
#1      _runPodInstall (package:flutter_tools/src/ios/mac.dart:365)
<asynchronous suspension>
#2      buildXcodeProject (package:flutter_tools/src/ios/mac.dart:156)
<asynchronous suspension>
#3      IOSDevice.startApp (package:flutter_tools/src/ios/devices.dart:205)
<asynchronous suspension>
#4      HotRunner.run (package:flutter_tools/src/run_hot.dart:200)
<asynchronous suspension>
#5      RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:281)
<asynchronous suspension>
#6      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:151)
<asynchronous suspension>
#7      RunCommand.verifyThenRunCommand (package:flutter_tools/src/commands/run.dart:196)
<asynchronous suspension>
#8      FlutterCommand.run (package:flutter_tools/src/runner/flutter_command.dart:121)
#9      CommandRunner.runCommand (package:args/command_runner.dart:194)
<asynchronous suspension>
#10     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:261)
<asynchronous suspension>
#11     CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:109)
#12     Future.Future.sync (dart:async/future.dart:208)
#13     CommandRunner.run (package:args/command_runner.dart:109)
#14     FlutterCommandRunner.run (package:flutter_tools/src/runner/flutter_command_runner.dart:157)
#15     run.<anonymous closure> (package:flutter_tools/executable.dart:140)
<asynchronous suspension>
#16     AppContext._run (package:flutter_tools/src/base/context.dart:76)
<asynchronous suspension>
#17     AppContext.runInZone.<anonymous closure> (package:flutter_tools/src/base/context.dart:66)
#18     _rootRun (dart:async/zone.dart:1120)
#19     _CustomZone.run (dart:async/zone.dart:1001)
#20     runZoned (dart:async/zone.dart:1465)
#21     AppContext.runInZone (package:flutter_tools/src/base/context.dart:65)
#22     run (package:flutter_tools/executable.dart:113)
<asynchronous suspension>
#23     main (package:flutter_tools/executable.dart:66)
<asynchronous suspension>
#24     main (file:///Users/cbracken/src/flutter/flutter/packages/flutter_tools/bin/flutter_tools.dart:8)
#25     _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:263)
#26     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:151)


[  +46 ms] ensureAnalyticsSent: 38ms
[   +1 ms] exiting with code 1
@cbracken
Copy link
Member Author

cbracken commented Apr 3, 2017

/cc @jakobr-google is there something I need to do here on the engine side?

Based on ios/Podfile, it looks like we're looking for a podspec for Flutter in $FLUTTER_FRAMEWORK_DIR. When I run without --local-engine, that env var appears to point at the cached engine location (bin/cache/artifacts/engine/ios), where I see a Flutter.podspec. When running with a local engine, it's pointing at the engine's build dir (in my case, /Users/cbracken/src/flutter/engine/src/out/ios_debug_unopt), where I don't see that file.

I was able to hack around this by adding a symlink'ed Flutter.podspec in my local engine dir, but it'd be nice for this to work automatically. (Unless I'm missing a step somewhere?)

@cbracken cbracken added tool Affects the "flutter" command-line tool. See also t: labels. c: regression It was better in the past than it is now labels Apr 3, 2017
@jakobr-google
Copy link
Contributor

Yes, we should copy shell/platform/darwin/ios/framework/Flutter.podspec to the engine's build dir when we build. I missed that when I added the file. The buildbot recipe uploads the file, which is why you see it in the cache.

jakobr-google added a commit to jakobr-google/engine that referenced this issue Apr 4, 2017
So `flutter run --local-engine=...` will work out of the box.

Fixes flutter/flutter#9154.
jakobr-google added a commit to flutter/engine that referenced this issue Apr 5, 2017
So `flutter run --local-engine=...` will work out of the box.

Fixes flutter/flutter#9154.
brianosman pushed a commit to brianosman/engine that referenced this issue Jun 16, 2017
So `flutter run --local-engine=...` will work out of the box.

Fixes flutter/flutter#9154.
@nisdis
Copy link

nisdis commented Jan 20, 2018

Hi,
I had the same issue recently, however, I used a different approach.
I needed to update pods with pod update

Which got to to this error:

Please set FLUTTER_FRAMEWORK_DIR to the directory containing Flutter.framework

[!] Invalid 'Podfile' file: Please set FLUTTER_FRAMEWORK_DIR to the directory containing Flutter.framework.

 #  from /path-to/flutter/examples/platform_view/ios/Podfile:5
 #  -------------------------------------------
 #  if ENV['FLUTTER_FRAMEWORK_DIR'] == nil
 >    abort('Please set FLUTTER_FRAMEWORK_DIR to the directory containing Flutter.framework')
 #  end
 #  -------------------------------------------

After a bit of search on DuckDuckGo I tried this for a solution

export FLUTTER_FRAMEWORK_DIR=/path-to/flutter/bin/cache/artifacts/engine/ios

and reran pod update and flutter run

This seemed to work!

Is there a better method to solve this ?

Thanks

@github-actions
Copy link

github-actions bot commented Sep 4, 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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: regression It was better in the past than it is now tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

No branches or pull requests

3 participants