-
Notifications
You must be signed in to change notification settings - Fork 140
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
Allow auto-deployment with react-native-pod #117
base: master
Are you sure you want to change the base?
Conversation
yeah, cool! I heard that in react-native 0.50 there is built-in support for podfiles. Do you use that? |
i will check it tomorrow and release it if it works properly |
As I understand it, the support extension is really for podspec files,
which are mutually exclusive (in RN link) with static libraries. The
react-native-pod add-in lets libraries like yours add pod dependencies via
package.json, and auto-installs them.
…On Tue, Nov 28, 2017 at 5:13 PM Marco Wettstein ***@***.***> wrote:
i will check it tomorrow and release it if it works properly
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#117 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALov_7DaPeWgs2CwjSf24B6g3arkITVKks5s7IWSgaJpZM4Qt-3P>
.
|
Hi @rhdeck this issue here rhdeck/react-native-pod#1 is blocking us from merging this pr. |
I published a fix to react-native-pod, but I'm not sure how you came across it. Can you share the workflow? you can give it another go, but I want the module to be useful, so understanding your situation would be worth a lot. |
FWIW, here is my workflow for a one-line command to build and run your sample app using my fork. Obv it assumes the demo App.js code is in cwd.
|
</View> | ||
); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you remove that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, will remove all the appsample stuff. I learned how to do a react-native template, and it is a better approach.
@rhdeck could you provide migration information? What needs to be changed in the xcode project? at the moment you need to add pocketsvg to libraries and to Embedded Binaries. Can this be removed? |
I’ll rebase and update my pr later today and send you an explanation.
Basically I am changing the way dependencies get installed so you never
have to open Xcode.
…On Thu, Dec 21, 2017 at 7:14 AM Marco Wettstein ***@***.***> wrote:
@rhdeck <https://github.com/rhdeck> could you provide migration
information? What needs to be changed in the xcode project? at the moment
you need to add pocketsvg to libraries or to Embedded Binaries ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#117 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALov__6IlDBWYddoUHz7LnG3m9FsdBlvks5tCkuvgaJpZM4Qt-3P>
.
|
I'm not going to get that rebase done today - aiming for tomorrow. Yes, the plan is to remove the manual steps related to pocketsvg entirely. Instead, we use a couple of peer dependencies so that you can just build on top of the RN "hello world" project (created by
Both will execute the necessary changes on the underlying project as of A few others will help too:
These too do their work as of That's why I recommended that "magic spell" extended command line approach a couple weeks ago - it just works - and you never touch xcode! Those are just notes tho. Code changes to follow. I love your project - I want to help make it more deployable! |
hi @rhdeck I tried to use it, but it does not work on a existing project. I typed react-native link in the project directory, but I receive this error on build:
I tried to debug that, with no luck. I already have a podfile in the project. So i deleted that, but no podfile is created on EDIT: I had to remove it first with Edit2: After going deep in the rabbit hole, i still get the same error as above:
Maybe some information: i am using a linked version of react-native-arkit (yarn link react-native-arkit), so that i can develop on it. Maybe this messes with the path resolution of xcode and that's why header files are not found. beeing able to link the library is a must though. |
npm stopped to allow unexisting dependencies in the package.json, so I thought this here would be a good solution. unfortunatly I could not manage to get it run. I tried 4 hours, but xcode and cocoapods is a big riddle for me. I now found a workaround by using a git-submodule for PocketSVG. This needs a small adjustment on existing projects (see release notes for 0.8.x beta). I would love to get this to work with cocoapods, but it's hard without a clear migration path. |
Sounds like there are a couple moving parts here 1. yarn linkYes, the When I am dev-ing using the link where I have a dependency on Pods I create an additional header path for my static library under "Build Settings" of Consumers of the module will not have to do the above. It just works! (See "magic spell" below) 2. react-native-pod
Deployment ExampleHere is a GUI-free "magic spell" that I tested on my macbook with XCode 9.2:
( Then select your device and press play! If you wanted to just run from the command line and deploy to your default device, you could:
Then add your code from the README to App.js - and away you go. (A little processcolor error will occur due to the green and white lights. Remove or wrap the strings with {processColor("[color]")} to get rid of your red screen! ) I have been doing quite a bit of deeply native development with iOS RN (e.g. I made most of those components I referenced in December, as well as modules like react-native-coreml) so feel free to chat me if I can help on that front. I think your project is really cool and I hope with this PR that I could help make it easier for others to deploy! |
Made a thing that could help with your development: react-native-fix-pod-links The key is that it makes that bridging reference work. Assuming you have an app you are developing from, you don't need this part, and can skip to the next one.
Great! Let's add the necessary tools to your app, from the cwd of your project root.
So what does this do? It will make sure that your library - whereever it is - maintains the link to your pods via an absolute path added to header search paths. You can remove that absolute path:
Its brand new, but I thought it might help bridge the gap between making this easy to distribute and easy to develop. Hope it helps you! |
Any more luck with this? There's another dependency that might be added to the project (https://github.com/magicien/GLTFSceneKit) and an auto install would simplify things a lot. |
I'll clone down the master branch and test/update. |
I updated my repo and the following works for live development in XCode and VS Code (fixing pod header search paths using
The following works for a deployment situation:
|
Thanks!! I just tried this out both for local development and regular consumption. With the one-liners above I ran into a problem as I have two version xcode installed (xcode-beta is or was required for ARKit 1.5 features). Otherwise it worked great, all I had to do was open workspace the file. For as long as this project is iOS only I don't see that as a huge problem. It's such a nice improvement over manually linking everything. @macrozone What do you think? |
Side note on |
Thanks for the tip! How does it look to add another pod into react-native-arkit itself? I've been trying with |
Ah - you want to add the pod to the info in react-native-arkit, like gitf? Since you don't want the dependency in your package.json, I recommend global install and running from there: yarn global add react-native-pod
cd ~/Documents/GitHub/react-native-arkit
react-native-pod --help # (to get list of commands)
react-native-pod addpod --help # (to get info on how to add a pod)
react-native-pod addpod PocketSVG #if you wanted to reinstall pocketsvg without regard to version
react-native-pod addpod PocketSVG --podversion 2.0.0 #if you wanted to reinstall pocketsvg specifically at 2.0.0 NB all this does is modify the "pods" entry in your Assuming that this local repo is still linked to your wrapper testing app, you do this to update the app: cd ~/Documents/testingapp
react-native link # watch your podfile update and the new dependency get installed
react-native xcode # happy coding Since this adds the pod to you That help? (I would have shown how to add gITF, but the cocoapods search engine is down right now) |
Thanks! I followed all the steps using the global react-native-pod and it seemed to work correctly to install the However |
Now that you've given me the name of the pod, I'll try it on my end too. |
I took this for a spin and got a few data points:
I kind of suspect that this is a Swift-OC interop issue. Getting Swift code to work in Objective-C usually takes explicit |
That makes sense about objc and Swift interop and shouldn't block this PR. I tried again with an objc specific pod (GLTFSCN from https://github.com/warrenm/GLTFKit) and got a little further, Am I missing a step with react-native-fix-pod-links? |
I managed to replicate your experience. And this time it was specific to using the import statement from the static library - from AppDelegate.m it works fine. I notice that PocketSVG (which continues to work fine) links internally using "myheader.h" internally while GLTF uses <GLTF/GLTFHeader.h>. This is the difference between global headers and local user headers, and is exactly the kind of detail that I got into Swift to get away from! But essentially the issue is going to be something about how the static library relates to the global search paths as used in the Pod. This is something that maybe could be fixed through editing the pbxproj file, but I don't have an immediate answer, and our use case (referencing a cocoapod from a static library) is odd enough that Google isn't delivering for me. All that said, I don't think this is driven by I'm running a couple tests in the background and will post a comment if they give more insight. |
Any luck ? |
The point of discussion six weeks ago was getting the SLs to talk with CocoaPods more broadly. This was not really a specific problem with the PR as I understood it, which has been tested to work properly with the PocketSVG pod dependency that react-native-arkit uses today. My tests that ran in April didn't really tell me anything more, except that the question of managing the dependency graph with SLs is a mess in XCode. This is an open area of development- really, learning - to make react-native-pod more useful. I'm open to having been wrong about @bnjm's take on this - don't mean to speak out of turn! |
By deploying PocketSVG as a CocoaPod via
react-native-pod
peer dependency (which also takes care of creating thePodfile
, you can allow automatic installation. No more opening Xcode!The
project.pbxproj
change tells the static library to use the parent app's Pod.