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

Adds add2app Flutter module and an iOS project to run it. #126

Merged
merged 17 commits into from Aug 14, 2019

Conversation

@RedBrogdon
Copy link
Contributor

RedBrogdon commented Aug 9, 2019

No description provided.

RedBrogdon added 8 commits Aug 9, 2019
@RedBrogdon RedBrogdon requested review from xster and johnpryan Aug 9, 2019
@xster
Copy link
Contributor

xster commented Aug 9, 2019

also cc @jmagman

Copy link
Member

jmagman left a comment

In other places we've added the Pods/ directory to the .gitignore and not checked it in. But it depends if we want users to be able to just run from Xcode immediately without needing to run pod install.
https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
Up to you!

experimental/add2app/example_module/pubspec.yaml Outdated Show resolved Hide resolved
RedBrogdon added 4 commits Aug 12, 2019
@johnpryan
Copy link
Contributor

johnpryan commented Aug 12, 2019

I'm seeing an error running pod install:

pod install
Ignoring eventmachine-1.2.7 because its extensions are not built.  Try: gem pristine eventmachine --version 1.2.7
Ignoring executable-hooks-1.6.0 because its extensions are not built.  Try: gem pristine executable-hooks --version 1.6.0
Ignoring ffi-1.11.1 because its extensions are not built.  Try: gem pristine ffi --version 1.11.1
Ignoring ffi-1.9.25 because its extensions are not built.  Try: gem pristine ffi --version 1.9.25
Ignoring gem-wrappers-1.4.0 because its extensions are not built.  Try: gem pristine gem-wrappers --version 1.4.0
Ignoring http_parser.rb-0.6.0 because its extensions are not built.  Try: gem pristine http_parser.rb --version 0.6.0
Ignoring nokogiri-1.8.5 because its extensions are not built.  Try: gem pristine nokogiri --version 1.8.5
Ignoring nokogiri-1.8.4 because its extensions are not built.  Try: gem pristine nokogiri --version 1.8.4
Ignoring sassc-2.0.0 because its extensions are not built.  Try: gem pristine sassc --version 2.0.0
Ignoring sassc-1.12.1 because its extensions are not built.  Try: gem pristine sassc --version 1.12.1

[!] Invalid `Podfile` file: cannot load such file -- ../example_module/.ios/Flutter/podhelper.rb.

 #  from /Users/ryjohn/code/github/flutter/samples/experimental/add2app/SimpleIOSExample/Podfile:6
 #  -------------------------------------------
 #  flutter_application_path = '../example_module'
 >  load File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')
 #  
 #  -------------------------------------------
@RedBrogdon
Copy link
Contributor Author

RedBrogdon commented Aug 12, 2019

@johnpryan I ran into the same issue while testing a clone. There's a pod-helper script that's created by flutter create and flutter build, but not meant to be checked in. As a result, if you do a pod install first thing after cloning, the script isn't there and CocoaPods bombs.

I've added a line to the podfile that will run flutter create on your behalf automatically to fix this. Can you pull the latest changes and try again?

@johnpryan
Copy link
Contributor

johnpryan commented Aug 12, 2019

@RedBrogdon I'm still running into a missing "podhelper.rb" error.

Here's my steps:

git clone git@github.com:flutter/samples.git
cd samples
git checkout -b RedBrogdon-add2app master
git pull git://github.com/RedBrogdon/samples.git add2app
cd experimental/add2app/SimpleIOSExample/
pod install

Here's the output:

Ignoring eventmachine-1.2.7 because its extensions are not built.  Try: gem pristine eventmachine --version 1.2.7
Ignoring executable-hooks-1.6.0 because its extensions are not built.  Try: gem pristine executable-hooks --version 1.6.0
Ignoring ffi-1.11.1 because its extensions are not built.  Try: gem pristine ffi --version 1.11.1
Ignoring ffi-1.9.25 because its extensions are not built.  Try: gem pristine ffi --version 1.9.25
Ignoring gem-wrappers-1.4.0 because its extensions are not built.  Try: gem pristine gem-wrappers --version 1.4.0
Ignoring http_parser.rb-0.6.0 because its extensions are not built.  Try: gem pristine http_parser.rb --version 0.6.0
Ignoring nokogiri-1.8.5 because its extensions are not built.  Try: gem pristine nokogiri --version 1.8.5
Ignoring nokogiri-1.8.4 because its extensions are not built.  Try: gem pristine nokogiri --version 1.8.4
Ignoring sassc-2.0.0 because its extensions are not built.  Try: gem pristine sassc --version 2.0.0
Ignoring sassc-1.12.1 because its extensions are not built.  Try: gem pristine sassc --version 1.12.1
~/code/github/flutter/samples/experimental/add2app/example_module ~/code/github/flutter/samples/experimental/add2app/SimpleIOSExample
Recreating project ....
  example_module.iml (created)
  example_module_android.iml (created)
  .idea/libraries/Flutter_for_Android.xml (created)
  .idea/libraries/Dart_SDK.xml (created)
  .idea/modules.xml (created)
  .idea/workspace.xml (created)
Because every version of flutter_test from sdk depends on pedantic 1.7.0 and example_module depends on pedantic ^1.8.0+1, flutter_test from sdk is forbidden.
So, because example_module depends on flutter_test any from sdk, version solving failed.
Running "flutter pub get" in example_module...                          
pub get failed (1)

[!] Invalid `Podfile` file: cannot load such file -- ../example_module/.ios/Flutter/podhelper.rb.

 #  from /Users/ryjohn/code/github/flutter/samples/experimental/add2app/SimpleIOSExample/Podfile:7
 #  -------------------------------------------
 #  system("pushd #{flutter_application_path} && flutter create . && popd")
 >  load File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')
 #  
 #  -------------------------------------------
@jmagman
Copy link
Member

jmagman commented Aug 12, 2019

@RedBrogdon I'm still running into a missing "podhelper.rb" error.

Just to confirm, you're on the master channel, right?

experimental/README.md Outdated Show resolved Hide resolved
@@ -25,7 +25,15 @@ flutter channel stable

## Index

There aren't actually any samples in here just yet. Things are coming, though!
### [add2app](add2app)

This comment has been minimized.

@xster

xster Aug 12, 2019

Contributor

Sorry, I'm gonna make a crappy request. Can we replace all add2app with add-to-app?

This comment has been minimized.

@RedBrogdon

RedBrogdon Aug 13, 2019

Author Contributor

Not a big deal. What about the project path? Would you prefer to see that change from add2app as well?

This comment has been minimized.

@xster

xster Aug 13, 2019

Contributor

Yes please. We're trying to avoid 'clever' names and use plain english as much as possible.

experimental/add2app/README.md Outdated Show resolved Hide resolved

# Added these two lines for Flutter:
flutter_application_path = '../example_module'
system("pushd #{flutter_application_path} && flutter create . && popd")

This comment has been minimized.

@xster

xster Aug 12, 2019

Contributor

This line is surprising. What's the intent here?

This comment has been minimized.

@jmagman

jmagman Aug 13, 2019

Member

We have a thread in the Add-to-app chat about this. The podhelper.rb script is in the .gitignore, so someone who just cloned this repo needs to create it or they can't pod install. I don't really want it to be checked in, but maybe there's a better solution?

This comment has been minimized.

@xster

xster Aug 13, 2019

Contributor

Ah ok. Aren't these made by running flutter packages get instead of flutter create?

This comment has been minimized.

@RedBrogdon

RedBrogdon Aug 13, 2019

Author Contributor

Both work, apparently. Does flutter create also get packages?

This comment has been minimized.

@RedBrogdon

RedBrogdon Aug 13, 2019

Author Contributor

Strike that, actually. When I try with flutter packages get, the script is created, but there's some other part of the module missing. I end up with an error in Xcode that states it can't find lib/main.dart.

This comment has been minimized.

@xster

xster Aug 13, 2019

Contributor

What are the error outputs? Might be a valid bug.

This comment has been minimized.

@RedBrogdon

RedBrogdon Aug 14, 2019

Author Contributor

Weird. I can no longer replicate the failure.

experimental/add2app/SimpleIOSExample/Podfile Outdated Show resolved Hide resolved
experimental/add2app/SimpleIOSExample/Podfile Outdated Show resolved Hide resolved
experimental/add2app/example_module/README.md Outdated Show resolved Hide resolved
@johnpryan
Copy link
Contributor

johnpryan commented Aug 13, 2019

@xster Switching to the master channel fixed it.

Now the XCode 10.3 build is failing:

:-1: Unable to load contents of file list: '/Users/ryjohn/code/github/flutter/samples/experimental/add2app/SimpleIOSExample/Pods/Target Support Files/Pods-SimpleIOSExample/Pods-SimpleIOSExample-frameworks-Debug-input-files.xcfilelist' (in target 'SimpleIOSExample')
RedBrogdon added 2 commits Aug 13, 2019
@RedBrogdon
Copy link
Contributor Author

RedBrogdon commented Aug 13, 2019

PTAL.

All comments addressed except for two waiting on replies. The current code builds out of the box on my machine with these steps:

  • cd experimental/add2app/SimpleIOSExample
  • pod install
  • open SimpleIOSExample.xcworkspace
  • Run that sucker.

@johnpryan Do you mind checking to see if a fresh copy of this PR builds for you?

@johnpryan
Copy link
Contributor

johnpryan commented Aug 13, 2019

for future reference, gem install cocoapods upgraded my cocoapods version to 1.7.5. I was using an older version (something like 1.3)

Copy link
Contributor

xster left a comment

LGTM

cc @goderbauer, here's the sample project

experimental/add2app/SimpleIOSExample/Podfile Outdated Show resolved Hide resolved
Copy link
Contributor

johnpryan left a comment

LGTM

@RedBrogdon RedBrogdon merged commit c68165e into flutter:master Aug 14, 2019
3 checks passed
3 checks passed
WIP Ready for review
Details
cla/google All necessary CLAs are signed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@RedBrogdon RedBrogdon deleted the RedBrogdon:add2app branch Aug 14, 2019
@RedBrogdon
Copy link
Contributor Author

RedBrogdon commented Aug 14, 2019

@jmagman @xster

I went ahead and landed this, because a) it's huge, and b) we need to get the basic project structure in the repo, but the app occasionally segfaults. Would either of you be interested in taking a look with me? 😄

@xster
Copy link
Contributor

xster commented Aug 14, 2019

Yes. Please write down all outputs/stacks etc if you ever encounter any.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.