GithubHelp home page GithubHelp logo

taskrabbit / reactnativesampleapp Goto Github PK

View Code? Open in Web Editor NEW
930.0 930.0 320.0 458 KB

Example app in React Native: sort of like twitter/tumblr

License: MIT License

JavaScript 88.61% Ruby 0.09% Objective-C 3.02% Python 0.84% Java 7.44%

reactnativesampleapp's Introduction

React Native Sample App

At TaskRabbit, we are trying to understand the best way to build React Native apps. This app is a working app in which we implement new ideas or those that have worked for us so far. We'll write about it on our tech blog.

The app itself is vaguely like twitter/tumblr. There are users that make posts. They follow other users. You can look at follows and their posts. The features (or styling) isn't the main point. At this time, we're mostly demonstrating architectural concepts.

Sign up Create post Show post Followers

iOS

In the root directory

  • Install dependencies: npm install

In the ios directory

  • Install Pods: gem install cocoapods
  • Install Pods: pod install
  • Install xcpretty: gem install xcpretty
  • Launch: open Sample.xcworkspace

Android

  • You might need to do this to run it in Android Studio or on real device: adb reverse tcp:8081 tcp:8081
  • And for the sample server: adb reverse tcp:3000 tcp:3000
  • To run from command line try: react-native run-android

Server

There is a server that the app hits for data. The data is only stored in memory, but it should produce a more realistic environment.

In the server directory

  • Install nvm and node-4.2.3
  • Install dependencies: npm install
  • Run it: npm start

It has sample data in the models.js file. For example, there is a user bleonard (password: "sample") that you can log in as.

Tests

The integration tests are run using Appium.

There is also an example of how to run it on Travis CI: Build Status

To run tests:

  • Make sure you have the 9.0 simulators installed in XCode
  • Compile app for the test environment: npm run compile:test
  • Launch simulator and tests: npm test

Compiling

You can compile and put it on the phone with: npm run install:staging

Not that there's a staging server at this point, but it's an example of how to compile things via the command line.

Android

We'll get there, but we're still working on the iOS version.

Current Concepts

Navigation

The sole method of navigation (what's showing on the screen and where the back button goes) is via urls. We parse urls to determine the route stack. There is some stuff to make "related" url navigation look "right" (push and pop). Making everything addressable by URL is great for deep linking and forces each screen to be able to load all on it's own from simple data.

The Router handles parsing different routes depending if you are logged in or not. The urls must be able to represent the entire navigation stack, so that means they can be recursive like my friend's friend's friend's feed (sample://dashboard/follows/john/follows/sarah/follows/amy/posts).

Flux

The Components use Actions. Actions tend to use the API Services and dispatch an event. The Stores are listening to the events. The Components add and remove listeners to the Stores.

Environment

There is a model called Environment that gets bootstrapped from Objective-C. It knows things that are different per environment like what API server to talk to.

Data storage

Info is currently stored as json to the local file system.

Shared CSS

It uses the cssVar pattern from the sample Facebook apps.

API

It uses superagent to do HTTP requests and sets headers and other things like that.

Components

Some shared components that might be helpful

  • SegmentedControl: Non-iOS specific version of that control
  • SimpleList: make a list out of the props set
  • Button: Helper to make them all similiar

Mixins

We are currently sharing code through mixins. Some of them might be generally useful.

  • KeyboardListener: helps know the amount of space the keyboard is taking up
  • DispatcherListener: subscribes and ubsubscribes from the Dispatcher for a component
  • NavigationListener: react to navigation changes in a component

Extensions

We've been trying out ways to not use mixins. AddSpinnerLoader is an example of a higher-level component.

i18n

We've internationalized our app. Each component definies it's own keys. This provides a sample of how that works.

Android too

We shipped our Android app! We need to update this to work there too.

License

MIT

reactnativesampleapp's People

Contributors

alex-mcleod avatar bleonard avatar jeffreyleeon avatar jrichardlai avatar tlenclos avatar zetavg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

reactnativesampleapp's Issues

Login Alert: Server Error: 520

I found error when login : Login Alert: Server Error: 520

somebody knows how to fix that, I really don't know how to debug server

Add a LICENSE?

Hey,

This is exactly a problem I'm trying to solve but would love to have a license so I could use it, can you add one?

xcpretty required too

Looks like it needs to have:
sudo gem install xcpretty

for it to compile too. If you want to add that to the docs.

ERROR EMFILE: too many open files

on Mac OSX, npm install run succesfully, but when I run npm start I get the following:

 ERROR  EMFILE: too many open files, watch
{"errno":-24,"syscall":"watch","code":"EMFILE","filename":null}
Error: EMFILE: too many open files, watch
    at FSEvent.FSWatcher._handle.onchange (internal/fs/watchers.js:129:28)

Print: Entry, ":CFBundleIdentifier", Does Not Exist

The following build commands failed:
CompileC /Users/user/Documents/ReactNativeApps/SampleApp/ios/build/Build/Intermediates.noindex/RCTNetwork.build/Debug-iphonesimulator/RCTNetwork.build/Objects-normal/x86_64/RCTNetworkTask.o RCTNetworkTask.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

Installing build/Build/Products/Debug-iphonesimulator/Sample.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist

Image has no propType

Hi,
Trying to run your sample. When I build in xcode I get the following error in the simulator:
Image has no propType for native prop RCTImageView.defaultImageSrc of native UIImage.

Any idea what I may be missing?

a bunch of errors on `npm install`

I couldn't even run the app, here is what I got on npm install

MacBook-Air:ReactNativeSampleApp-master Arbor$ npm install

> [email protected] install /Users/Arbor/Desktop/ReactNativeSampleApp-master/node_modules/appium/node_modules/bufferutil
> node-gyp rebuild

  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
In file included from ../src/bufferutil.cc:16:
../../nan/nan.h:261:25: error: redefinition of '_NanEnsureLocal'
NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
                        ^
../../nan/nan.h:256:25: note: previous definition is here
NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Handle<T> val) {
                        ^
../../nan/nan.h:661:13: error: no member named 'smalloc' in namespace 'node'
    , node::smalloc::FreeCallback callback
      ~~~~~~^
../../nan/nan.h:672:12: error: no matching function for call to 'New'
    return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
           ^~~~~~~~~~~~~~~~~
/Users/Arbor/.node-gyp/5.7.0/include/node/node_buffer.h:31:40: note: candidate function not viable: no known conversion from 'uint32_t' (aka 'unsigned int') to 'enum encoding' for 3rd argument
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                       ^
/Users/Arbor/.node-gyp/5.7.0/include/node/node_buffer.h:43:40: note: candidate function not viable: 2nd argument ('const char *') would lose const qualifier
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                       ^
/Users/Arbor/.node-gyp/5.7.0/include/node/node_buffer.h:28:40: note: candidate function not viable: requires 2 arguments, but 3 were provided
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate, size_t length);
                                       ^
/Users/Arbor/.node-gyp/5.7.0/include/node/node_buffer.h:36:40: note: candidate function not viable: requires 5 arguments, but 3 were provided
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                       ^
In file included from ../src/bufferutil.cc:16:
../../nan/nan.h:676:12: error: no viable conversion from 'v8::MaybeLocal<v8::Object>' to 'v8::Local<v8::Object>'
    return node::Buffer::New(v8::Isolate::GetCurrent(), size);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/Arbor/.node-gyp/5.7.0/include/node/v8.h:210:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'v8::MaybeLocal<v8::Object>' to
      'const v8::Local<v8::Object> &' for 1st argument
class Local {
      ^
/Users/Arbor/.node-gyp/5.7.0/include/node/v8.h:210:7: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'v8::MaybeLocal<v8::Object>' to
      'v8::Local<v8::Object> &&' for 1st argument
class Local {
      ^
/Users/Arbor/.node-gyp/5.7.0/include/node/v8.h:214:13: note: candidate template ignored: could not match 'Local' against 'MaybeLocal'
  V8_INLINE Local(Local<S> that)
            ^
/Users/Arbor/.node-gyp/5.7.0/include/node/v8.h:326:13: note: candidate template ignored: could not match 'S *' against 'v8::MaybeLocal<v8::Object>'
  V8_INLINE Local(S* that)
            ^
In file included from ../src/bufferutil.cc:16:
../../nan/nan.h:683:26: error: no member named 'Use' in namespace 'node::Buffer'
    return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
           ~~~~~~~~~~~~~~^
In file included from ../src/bufferutil.cc:7:
/Users/Arbor/.node-gyp/5.7.0/include/node/v8.h:221:5: error: assigning to 'v8::Primitive *volatile' from incompatible type 'v8::Value *'
    TYPE_CHECK(T, S);
    ^~~~~~~~~~~~~~~~
/Users/Arbor/.node-gyp/5.7.0/include/node/v8.h:180:37: note: expanded from macro 'TYPE_CHECK'
    *(static_cast<T* volatile*>(0)) = static_cast<S*>(0);      \
                                    ^ ~~~~~~~~~~~~~~~~~~
../../nan/nan.h:414:12: note: in instantiation of function template specialization 'v8::Local<v8::Primitive>::Local<v8::Value>' requested here
    return NanEscapeScope(NanNew(v8::Undefined(v8::Isolate::GetCurrent())));
           ^
../../nan/nan.h:398:30: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))
                             ^
In file included from ../src/bufferutil.cc:7:
/Users/Arbor/.node-gyp/5.7.0/include/node/v8.h:221:5: error: assigning to 'v8::Boolean *volatile' from incompatible type 'v8::Value *'
    TYPE_CHECK(T, S);
    ^~~~~~~~~~~~~~~~
/Users/Arbor/.node-gyp/5.7.0/include/node/v8.h:180:37: note: expanded from macro 'TYPE_CHECK'
    *(static_cast<T* volatile*>(0)) = static_cast<S*>(0);      \
                                    ^ ~~~~~~~~~~~~~~~~~~
../../nan/nan.h:424:12: note: in instantiation of function template specialization 'v8::Local<v8::Boolean>::Local<v8::Value>' requested here
    return NanEscapeScope(NanNew(v8::True(v8::Isolate::GetCurrent())));
           ^
../../nan/nan.h:398:30: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))
                             ^
In file included from ../src/bufferutil.cc:7:
/Users/Arbor/.node-gyp/5.7.0/include/node/v8.h:221:5: error: assigning to 'v8::Function *volatile' from incompatible type 'v8::Value *'
    TYPE_CHECK(T, S);
    ^~~~~~~~~~~~~~~~
/Users/Arbor/.node-gyp/5.7.0/include/node/v8.h:180:37: note: expanded from macro 'TYPE_CHECK'
    *(static_cast<T* volatile*>(0)) = static_cast<S*>(0);      \
                                    ^ ~~~~~~~~~~~~~~~~~~
../../nan/nan.h:1514:12: note: in instantiation of function template specialization 'v8::Local<v8::Function>::Local<v8::Value>' requested here
    return NanEscapeScope(NanNew(handle)->Get(kCallbackIndex)
           ^
../../nan/nan.h:398:30: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))
                             ^
In file included from ../src/bufferutil.cc:7:
/Users/Arbor/.node-gyp/5.7.0/include/node/v8.h:221:5: error: assigning to 'v8::Object *volatile' from incompatible type 'v8::Value *'
    TYPE_CHECK(T, S);
    ^~~~~~~~~~~~~~~~
/Users/Arbor/.node-gyp/5.7.0/include/node/v8.h:180:37: note: expanded from macro 'TYPE_CHECK'
    *(static_cast<T* volatile*>(0)) = static_cast<S*>(0);      \
                                    ^ ~~~~~~~~~~~~~~~~~~
../../nan/nan.h:1632:12: note: in instantiation of function template specialization 'v8::Local<v8::Object>::Local<v8::Value>' requested here
    return NanEscapeScope(handle->Get(NanNew(key)).As<v8::Object>());
           ^
../../nan/nan.h:398:30: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))
                             ^
9 errors generated.
make: *** [Release/obj.target/bufferutil/src/bufferutil.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:100:13)
gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 15.3.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/Arbor/Desktop/ReactNativeSampleApp-master/node_modules/appium/node_modules/bufferutil
gyp ERR! node -v v5.7.0
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok 
npm WARN install:[email protected] [email protected] install: `node-gyp rebuild`
npm WARN install:[email protected] Exit status 1

> [email protected] install /Users/Arbor/Desktop/ReactNativeSampleApp-master/node_modules/appium/node_modules/utf-8-validate
> node-gyp rebuild

  CXX(target) Release/obj.target/validation/src/validation.o
In file included from ../src/validation.cc:15:
../../nan/nan.h:261:25: error: redefinition of '_NanEnsureLocal'
NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
                        ^
../../nan/nan.h:256:25: note: previous definition is here
NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Handle<T> val) {
                        ^
../../nan/nan.h:661:13: error: no member named 'smalloc' in namespace 'node'
    , node::smalloc::FreeCallback callback
      ~~~~~~^
../../nan/nan.h:672:12: error: no matching function for call to 'New'
    return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
           ^~~~~~~~~~~~~~~~~
/Users/Arbor/.node-gyp/5.7.0/include/node/node_buffer.h:31:40: note: candidate function not viable: no known conversion from 'uint32_t' (aka 'unsigned int') to 'enum encoding' for 3rd argument
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                       ^
/Users/Arbor/.node-gyp/5.7.0/include/node/node_buffer.h:43:40: note: candidate function not viable: 2nd argument ('const char *') would lose const qualifier
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                       ^
/Users/Arbor/.node-gyp/5.7.0/include/node/node_buffer.h:28:40: note: candidate function not viable: requires 2 arguments, but 3 were provided
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate, size_t length);
                                       ^
/Users/Arbor/.node-gyp/5.7.0/include/node/node_buffer.h:36:40: note: candidate function not viable: requires 5 arguments, but 3 were provided
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                       ^
In file included from ../src/validation.cc:15:
../../nan/nan.h:676:12: error: no viable conversion from 'v8::MaybeLocal<v8::Object>' to 'v8::Local<v8::Object>'
    return node::Buffer::New(v8::Isolate::GetCurrent(), size);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/Arbor/.node-gyp/5.7.0/include/node/v8.h:210:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'v8::MaybeLocal<v8::Object>' to
      'const v8::Local<v8::Object> &' for 1st argument
class Local {
      ^
/Users/Arbor/.node-gyp/5.7.0/include/node/v8.h:210:7: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'v8::MaybeLocal<v8::Object>' to
      'v8::Local<v8::Object> &&' for 1st argument
class Local {
      ^
/Users/Arbor/.node-gyp/5.7.0/include/node/v8.h:214:13: note: candidate template ignored: could not match 'Local' against 'MaybeLocal'
  V8_INLINE Local(Local<S> that)
            ^
/Users/Arbor/.node-gyp/5.7.0/include/node/v8.h:326:13: note: candidate template ignored: could not match 'S *' against 'v8::MaybeLocal<v8::Object>'
  V8_INLINE Local(S* that)
            ^
In file included from ../src/validation.cc:15:
../../nan/nan.h:683:26: error: no member named 'Use' in namespace 'node::Buffer'
    return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
           ~~~~~~~~~~~~~~^
In file included from ../src/validation.cc:7:
/Users/Arbor/.node-gyp/5.7.0/include/node/v8.h:221:5: error: assigning to 'v8::Primitive *volatile' from incompatible type 'v8::Value *'
    TYPE_CHECK(T, S);
    ^~~~~~~~~~~~~~~~
/Users/Arbor/.node-gyp/5.7.0/include/node/v8.h:180:37: note: expanded from macro 'TYPE_CHECK'
    *(static_cast<T* volatile*>(0)) = static_cast<S*>(0);      \
                                    ^ ~~~~~~~~~~~~~~~~~~
../../nan/nan.h:414:12: note: in instantiation of function template specialization 'v8::Local<v8::Primitive>::Local<v8::Value>' requested here
    return NanEscapeScope(NanNew(v8::Undefined(v8::Isolate::GetCurrent())));
           ^
../../nan/nan.h:398:30: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))
                             ^
In file included from ../src/validation.cc:7:
/Users/Arbor/.node-gyp/5.7.0/include/node/v8.h:221:5: error: assigning to 'v8::Boolean *volatile' from incompatible type 'v8::Value *'
    TYPE_CHECK(T, S);
    ^~~~~~~~~~~~~~~~
/Users/Arbor/.node-gyp/5.7.0/include/node/v8.h:180:37: note: expanded from macro 'TYPE_CHECK'
    *(static_cast<T* volatile*>(0)) = static_cast<S*>(0);      \
                                    ^ ~~~~~~~~~~~~~~~~~~
../../nan/nan.h:424:12: note: in instantiation of function template specialization 'v8::Local<v8::Boolean>::Local<v8::Value>' requested here
    return NanEscapeScope(NanNew(v8::True(v8::Isolate::GetCurrent())));
           ^
../../nan/nan.h:398:30: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))
                             ^
In file included from ../src/validation.cc:7:
/Users/Arbor/.node-gyp/5.7.0/include/node/v8.h:221:5: error: assigning to 'v8::Function *volatile' from incompatible type 'v8::Value *'
    TYPE_CHECK(T, S);
    ^~~~~~~~~~~~~~~~
/Users/Arbor/.node-gyp/5.7.0/include/node/v8.h:180:37: note: expanded from macro 'TYPE_CHECK'
    *(static_cast<T* volatile*>(0)) = static_cast<S*>(0);      \
                                    ^ ~~~~~~~~~~~~~~~~~~
../../nan/nan.h:1514:12: note: in instantiation of function template specialization 'v8::Local<v8::Function>::Local<v8::Value>' requested here
    return NanEscapeScope(NanNew(handle)->Get(kCallbackIndex)
           ^
../../nan/nan.h:398:30: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))
                             ^
In file included from ../src/validation.cc:7:
/Users/Arbor/.node-gyp/5.7.0/include/node/v8.h:221:5: error: assigning to 'v8::Object *volatile' from incompatible type 'v8::Value *'
    TYPE_CHECK(T, S);
    ^~~~~~~~~~~~~~~~
/Users/Arbor/.node-gyp/5.7.0/include/node/v8.h:180:37: note: expanded from macro 'TYPE_CHECK'
    *(static_cast<T* volatile*>(0)) = static_cast<S*>(0);      \
                                    ^ ~~~~~~~~~~~~~~~~~~
../../nan/nan.h:1632:12: note: in instantiation of function template specialization 'v8::Local<v8::Object>::Local<v8::Value>' requested here
    return NanEscapeScope(handle->Get(NanNew(key)).As<v8::Object>());
           ^
../../nan/nan.h:398:30: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))
                             ^
9 errors generated.
make: *** [Release/obj.target/validation/src/validation.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:100:13)
gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 15.3.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/Arbor/Desktop/ReactNativeSampleApp-master/node_modules/appium/node_modules/utf-8-validate
gyp ERR! node -v v5.7.0
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok 
npm WARN install:[email protected] [email protected] install: `node-gyp rebuild`
npm WARN install:[email protected] Exit status 1

Thanks.

Cocoapods issue

ld: library not found for -lSimulatorRemoteNotifications
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I'm running into this issue when compiling the project. Probably some simple Cocoapods issue but unfortunately I'm new to pods.

react-native run-ios failing after recent updates?

This used to work like a charm. Not anymore though:
react-native run-ios

returns:

Scanning 557 folders for symlinks in /home/michal/WebstormProjects/ReactNativeSampleApp/sampleapp/node_modules (2ms)
Found Xcode project sampleapp.xcodeproj

spawnSync xcrun ENOENT

Error Cannot find module 'koa-passport' when npm start

got error messages like this

[email protected] start E:\React Native Testing\ReactNativeSampleApp\server
node --harmony server.js

module.js:557
throw err;
^

Error: Cannot find module 'koa-passport'
at Function.Module._resolveFilename (module.js:555:15)
at Function.Module._load (module.js:482:25)
at Module.require (module.js:604:17)
at require (internal/module.js:11:18)
at Object. (E:\React Native Testing\ReactNativeSampleApp\server\server.js:4:18)
at Module._compile (module.js:660:30)
at Object.Module._extensions..js (module.js:671:10)
at Module.load (module.js:573:32)
at tryModuleLoad (module.js:513:12)
at Function.Module._load (module.js:505:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: node --harmony server.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

Errors with Xcode 8

Thanks for this great sample app! I was able to run it with Xcode 7, but when I switch to Xcode 8, I experienced the following errors. Has any one experienced similar issues? thx

2016-10-09 20:33:17.452 xcodebuild[31470:603747] Failed to locate a valid instance of CoreSimulatorService in the bootstrap.  Adding it now.
2016-10-09 20:33:17.461 xcodebuild[31470:603747] *** Assertion failure in -[SimServiceContext reloadServiceIfMovedOrAbortIfWeAreInvalid], /BuildRoot/Library/Caches/com.apple.xbs/Sources/CoreSimulator/CoreSimulator-209.19/CoreSimulator/SimServiceContext.m:536
** INTERNAL ERROR: Uncaught exception **
Uncaught Exception: The loaded com.apple.CoreSimulator.CoreSimulatorService job does not match our expectations: pathOfLoadedJob: /Applications/Xcode 8.app/Contents/Developer/Library/PrivateFrameworks/CoreSimulator.framework/Versions/A/XPCServices/com.apple.CoreSimulator.CoreSimulatorService.xpc/Contents/MacOS/com.apple.CoreSimulator.CoreSimulatorService, our frameworkPath: /Applications/Xcode.app/Contents/Developer/Library/PrivateFrameworks/CoreSimulator.framework
Stack:
  0   __exceptionPreprocess (in CoreFoundation)
  1   objc_exception_throw (in libobjc.A.dylib)
  2   +[NSException raise:format:arguments:] (in CoreFoundation)
  3   -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] (in Foundation)
  4   -[SimServiceContext reloadServiceIfMovedOrAbortIfWeAreInvalid] (in CoreSimulator)
  5   -[SimServiceContext connect] (in CoreSimulator)
  6   -[SimServiceContext initWithDeveloperDir:connectionType:] (in CoreSimulator)
  7   __63+[SimServiceContext sharedServiceContextForDeveloperDir:error:]_block_invoke_2 (in CoreSimulator)
  8   _dispatch_client_callout (in libdispatch.dylib)
  9   _dispatch_barrier_sync_f_invoke (in libdispatch.dylib)
 10   +[SimServiceContext sharedServiceContextForDeveloperDir:error:] (in CoreSimulator)
 11   __60+[SimServiceContext(DVTAdditions) dvt_sharedServiceContext:]_block_invoke (in DVTiPhoneSimulatorRemoteClient)
 12   _dispatch_client_callout (in libdispatch.dylib)
 13   dispatch_once_f (in libdispatch.dylib)
 14   +[SimServiceContext(DVTAdditions) dvt_sharedServiceContext:] (in DVTiPhoneSimulatorRemoteClient)
 15   __42-[DVTiPhoneSimulatorLocator startLocating]_block_invoke (in IDEiOSSupportCore)
 16   __DVTDispatchAsync_block_invoke (in DVTFoundation)
 17   _dispatch_call_block_and_release (in libdispatch.dylib)
 18   _dispatch_client_callout (in libdispatch.dylib)
 19   _dispatch_root_queue_drain (in libdispatch.dylib)
 20   _dispatch_worker_thread3 (in libdispatch.dylib)
 21   _pthread_wqthread (in libsystem_pthread.dylib)
 22   start_wqthread (in libsystem_pthread.dylib)

child_process.js:508
    throw err;
    ^

Error: Command failed: xcodebuild  GCC_PREPROCESSOR_DEFINITIONS='$GCC_PREPROCESSOR_DEFINITIONS TEST_ENVIRONMENT=1' -workspace /Users/ericchang/Documents/work/ReactNativeSampleApp/ios/Sample.xcworkspace -scheme "Sample Test" -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6s,OS=latest' -configuration Debug OBJROOT=/Users/ericchang/Documents/work/ReactNativeSampleApp/testbuild/test_ios/build SYMROOT=/Users/ericchang/Documents/work/ReactNativeSampleApp/testbuild/test_ios/build ONLY_ACTIVE_ARCH=NO | xcpretty -c && exit ${PIPESTATUS[0]}
2016-10-09 20:33:17.194 xcodebuild[31470:603747] CoreSimulator is attempting to unload a stale CoreSimulatorService job.  Detected Xcode.app relocation or CoreSimulatorService version change.  Framework path (/Applications/Xcode.app/Contents/Developer/Library/PrivateFrameworks/CoreSimulator.framework) and version (209.19) does not match existing job path (/Applications/Xcode 8.app/Contents/Developer/Library/PrivateFrameworks/CoreSimulator.framework/Versions/A/XPCServices/com.apple.CoreSimulator.CoreSimulatorService.xpc/Contents/MacOS/com.apple.CoreSimulator.CoreSimulatorService) and version (303.8).
2016-10-09 20:33:17.452 xcodebuild[31470:603747] Failed to locate a valid instance of CoreSimulatorService in the bootstrap.  Adding it now.
2016-10-09 20:33:17.461 xcodebuild[31470:603747] *** Assertion failure in -[SimServiceContext reloadServiceIfMovedOrAbortIfWeAreInvalid], /BuildRoot/Library/Caches/com.apple.xbs/Sources/CoreSimulator/CoreSimulator-209.19/CoreSimulator/SimServiceContext.m:536
** INTERNAL ERROR: Uncaught exception **
Uncaught Exception: The loaded com.apple.CoreSimulator.CoreSimulatorService job does not match our expectations: pathOfLoadedJob: /Applications/Xcode 8.app/Contents/Developer/Library/PrivateFrameworks/CoreSimulator.framework/Versions/A/XPCServices/com.apple.CoreSimulator.CoreSimulatorService.xpc/Contents/MacOS/com.apple.CoreSimulator.CoreSimulatorService, our frameworkPath: /Applications/Xcode.app/Contents/Developer/Library/PrivateFrameworks/CoreSimulator.framework
Stack:
  0   __exceptionPreprocess (in CoreFoundation)
  1   objc_exception_throw (in libobjc.A.dylib)
  2   +[NSException raise:format:arguments:] (in CoreFoundation)
  3   -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] (in Foundation)
  4   -[SimServiceContext reloadServiceIfMovedOrAbortIfWeAreInvalid] (in CoreSimulator)
  5   -[SimServiceContext connect] (in CoreSimulator)
  6   -[SimServiceContext initWithDeveloperDir:connectionType:] (in CoreSimulator)
  7   __63+[SimServiceContext sharedServiceContextForDeveloperDir:error:]_block_invoke_2 (in CoreSimulator)
  8   _dispatch_client_callout (in libdispatch.dylib)
  9   _dispatch_barrier_sync_f_invoke (in libdispatch.dylib)
 10   +[SimServiceContext sharedServiceContextForDeveloperDir:error:] (in CoreSimulator)
 11   __60+[SimServiceContext(DVTAdditions) dvt_sharedServiceContext:]_block_invoke (in DVTiPhoneSimulatorRemoteClient)
 12   _dispatch_client_callout (in libdispatch.dylib)
 13   dispatch_once_f (in libdispatch.dylib)
 14   +[SimServiceContext(DVTAdditions) dvt_sharedServiceContext:] (in DVTiPhoneSimulatorRemoteClient)
 15   __42-[DVTiPhoneSimulatorLocator startLocating]_block_invoke (in IDEiOSSupportCore)
 16   __DVTDispatchAsync_block_invoke (in DVTFoundation)
 17   _dispatch_call_block_and_release (in libdispatch.dylib)
 18   _dispatch_client_callout (in libdispatch.dylib)
 19   _dispatch_root_queue_drain (in libdispatch.dylib)
 20   _dispatch_worker_thread3 (in libdispatch.dylib)
 21   _pthread_wqthread (in libsystem_pthread.dylib)
 22   start_wqthread (in libsystem_pthread.dylib)


    at checkExecSyncError (child_process.js:465:13)
    at Object.execSync (child_process.js:505:13)
    at Compiler.run (/Users/ericchang/Documents/work/ReactNativeSampleApp/tasks/compiler.js:21:27)
    at Compiler.buildIos (/Users/ericchang/Documents/work/ReactNativeSampleApp/tasks/compiler.js:103:8)
    at Compiler.build (/Users/ericchang/Documents/work/ReactNativeSampleApp/tasks/compiler.js:112:8)
    at Object.<anonymous> (/Users/ericchang/Documents/work/ReactNativeSampleApp/tasks/compile.js:5:10)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)

error with 'npm install'

I get these errors when I try to run npm install. I'm not terribly familiar with the node environment, hoping someone can give me some pointers?

npm WARN deprecated [email protected]: ๐Ÿ™Œ  Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
npm WARN deprecated [email protected]: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated [email protected]: connect 2.x series is deprecated
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: This package has been migrated into the 'appium-base-driver' package
npm WARN deprecated [email protected]: Moved into appium-support
npm WARN deprecated [email protected]: This package has been migrated into the 'appium-base-driver' package
npm WARN deprecated [email protected]: Use uuid module instead
npm WARN deprecated [email protected]: Use uuid module instead
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: Babel 5 is no longer being maintained. Upgrade to Babel 6.
npm WARN deprecated [email protected]: module has been merged into crc32-stream
npm WARN deprecated [email protected]: Copy its ~20 LOC directly into your code instead.
npm WARN deprecated [email protected]: This package has been migrated into the 'appium-base-driver' package
npm WARN deprecated [email protected]: This package has been migrated into the 'appium-base-driver' package
npm ERR! code ETARGET
npm ERR! notarget No matching version found for [email protected]
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget
npm ERR! notarget It was specified as a dependency of 'ReactNativeSampleApp'
npm ERR! notarget

npm ERR! A complete log of this run can be found in:

Simulator timeout after npm test

How to fix it?

PACKAGER:  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” 
 โ”‚  Running packager on port 9091.                                            โ”‚ 
 โ”‚                                                                            โ”‚ 
 โ”‚  Keep this packager running while developing on any JS projects. Feel      โ”‚ 
 โ”‚  free to close this tab and run your own packager instance if you          โ”‚ 
 โ”‚  prefer.                                                                   โ”‚ 
 โ”‚                                                                            โ”‚ 
 โ”‚  https://github.com/facebook/react-native                                  โ”‚ 
 โ”‚                                                                            โ”‚ 
 โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ 

PACKAGER: Looking for JS files in
   /Users/aksonov/Documents/ReactNativeSampleApp 


PACKAGER: [19:37:48] <START> Building Dependency Graph

PACKAGER: [19:37:48] <START> Crawling File System

PACKAGER: [19:37:48] <START> Loading bundles layout

PACKAGER: [19:37:48] <END>   Loading bundles layout (0ms)

PACKAGER: 
React packager ready.


APPIUM: info: Welcome to Appium v1.4.16 (REV ae6877eff263066b26328d457bd285c0cc62430d)

APPIUM: info: Appium REST http interface listener started on 0.0.0.0:4724

DRIVER: will init
 > CALL init({"browserName":"","appium-version":"1.4.16","platformName":"iOS","platformVersion":"9.2","deviceName":"iPhone 6s","autoLaunch":"true","newCommandTimeout":100000,"app":"/Users/aksonov/Documents/ReactNativeSampleApp/testbuild/test_ios/sample_ios.zip"}) 
APPIUM err: error: Could not reset simulator. Leaving as is. Error: Command 'xcrun simctl erase 6E538141-BF59-4769-9468-365F9CB1D484' timed out after 2000ms

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.