Code Monkey home page Code Monkey logo

react-native-meteor-boilerplate's Introduction

React Native Meteor Boilerplate

This is a simple way to get started building an app with React Native and Meteor. It is opinionated to make it easy for people to start but if you have your own way of doing things it's very easy to swap things out and move them around however you see fit.

As it currently stands this project is only focused on configuring the React Native project. The Meteor side is up to you. For thoughts on how to structure your Meteor App I would suggest you read the Meteor Guide and the Mantra spec.

You can checkout a very quick walkthrough of the project here.

Getting Started

  • Install Meteor
  • Install React Native
  • Clone Repo: git clone https://github.com/spencercarli/react-native-meteor-boilerplate.git
  • From the MeteorApp directory run meteor npm install
  • From the RNApp directory run npm install

Running on iOS Simulator

Note: You must be on a Mac for this.

  • Be sure your Meteor app is running: In the MeteorApp directory, type meteor

You've got a few ways you can run the app for iOS:

  • From the RNApp directory run react-native run-ios

Running on iOS Device

Note: You must be on a Mac for this.

  • Be sure your Meteor app is running: In the MeteorApp directory, type meteor
  • Get the IP address of your machine (you can run ipconfig getifaddr en1 to do so)
  • In RNApp/app/config/settings.js change localhost to your machine's IP address
  • Plug your device into your computer (make sure it's on the same network)
  • Open the project in Xcode
  • Select your device in Xcode and press "Build and run"

For further information please reference the official docs.

Running on Android Simulator

  • Be sure your Meteor app is running: In the MeteorApp directory, type meteor
  • Get the IP address of your machine
  • In RNApp/app/config/settings.js change localhost to your machine's IP address
  • Make sure you have an emulator configured and running.
  • From the RNApp directory run react-native run-android

On OSX you can get your IP address by running ipconfig getifaddr en1 in a terminal window.

On linux running ifconfig will get you a list of your network interfaces along with their IP addresses. For the stock Google simulator you will want to use the IP of your active network connection (probably eth0 or wlan0). If you are using the Genymotion simulator, it runs in a Virtual Box VM with a Host-only network interface. You will want to use the IP address of this network which may look like vboxnet0 under ifconfig.

Running on Android Device

  • Be sure your Meteor app is running: In the MeteorApp directory, type meteor
  • Make sure USB Debugging is enabled
  • Plug your device into your computer
  • Run adb devices to make sure your device shows up
  • Run adb reverse tcp:8081 tcp:8081
  • In RNApp/app/config/settings.js change localhost in METEOR_URL to your computer's IP address (see note in "Running on Android" section on how to get your IP Address)
  • Run react-native run-android

For further information please reference the official docs.

Linux Setup for Android Dev

Configure how the device will connect to the meteor server. See running android on a device to pick from the options.

Plug in your device and use lusb to find the first 4 digits of your device ID.

lsusb Bus 001 Device 003: ID 04e8:2e76 Motorola PCS

Enter this in udev rules. In the example we are copying over 04e8

echo SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666", GROUP="plugdev" | sudo tee /etc/udev/rules.d/51-android-usb.rules

Check that your device is properly connecting to ADB, the Android Debug Bridge, by using:

adb devices

Note: You should have only one active ADB connection. If you have a simulator running you should close it before proceeding.

These steps are abstracted from the pages running on device selecting the Linux Tab.

Questions?

If you have any questions please open an issue. Thanks!

react-native-meteor-boilerplate's People

Contributors

andersr avatar elie222 avatar funkyeah avatar josephdburdick avatar luchux avatar polguixe avatar sabativi avatar spencercarli 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

react-native-meteor-boilerplate's Issues

Mantra: API Integration

This is an awesome boilerplate and a great starting point for someone looking to integrate RN and Meteor. Have you thought of or considered the new Mantra architecture for any connections with file structure, components or modules against what you have started?

https://kadirahq.github.io/mantra/

Request for contribution

Hi Spencer!
i like your project please tell me how can i contribute in it?
Thanks
Kind regards

Need help with the ddp.subscribe

Hi,
First thank you for your awesome boilerplate :)
I am trying to subscribe to my meteor mongo collection, but I keep getting this error:

Warning: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op. Please check the code for the undefined component.

In signin.js I have this code:

handleSignIn() {
if (this.validInput()) {
ddpClient.loginWithUsername(this.state.username, this.state.password, (error, res) => {
if (error) {
this.setState({error: error.reason})
} else {
this.props.changedSignedIn(true);
this.subscribeToItems();
}
});
}
}
subscribeToItems() {
let itemsPromise = false;
let self = this;
itemsPromise = ddpClient.subscribePromise('items');
itemsPromise.then(function(result){
if (result === true) {
self.setState({items: ddpClient.collections.items});
} else {
console.log(result);
}
}, function(reason) {
console.log(reason);
});
}

Am I doing something wrong?
I would really appreciate it if you could point me in the right direction.

Application RNApp has not been registered

I cloned the repo and I tried to run the Android RNApp on my device and I got the following error:

Application RNApp has not been registered.
This is either due to a require() error during initialization or failure to call AppRegistry.registerComponent.

Not understanding this, because I can see

AppRegistry.registerComponent('RNApp', () => App);

in index.android.js.

Edit: Actually getting another error now, can't seem to replicate the first one:

undefined is not a function (evaluating 'EventPluginHub.injection.injectInstanceHandle(ReactInstanceHandles)')

Also as a side note, I followed your tutorials 1-3 listed here http://blog.differential.com/react-native-meteor-boilerplate/, and I didn't run into any problems there. I did notice the tutorials used ddp-client and the boilerplate uses node-ddp-client. Not sure if that's the issue.

Fetching data from database

Could someone explain how I fetch data from meteor?
In Details.js data is fetched but presented using the MeteorListView. I'd like to just print the fetched data in the console but I can't figure out how to do that. The handle doesn't contain any objects.

export default createContainer(() => {
  const handle = Meteor.subscribe('details-list');
  return {
    detailsReady: handle.ready(),
  };
}, DetailsContainer);

Calling external meteor packages from react native

Sorry, this should not be an issue for this awesome repo. But I dont know where to ask.

Im adding a package in meteor app as below:
meteor add typ:accounts-ldap

So now, how can I make a call to client method from react native. In plain meteor project, I can simply call the method from client code as below:

Meteor.loginWithLDAP(loginId, password, {
    dn: domain + '\\' + loginId,
    search: '(sAMAccountName=' + loginId + ')'
}, function(err) {
        if (err) console.log(err);
});

Tried using the same code in react native, but there's an error loginWithLDAP method is undefined.

pls help. thanks

Unable to get app to run using simulator

Hi - I followed the instructions and attempted to run the app locally using the command react-native run-ios

The result was:

  1. The simulator opens, briefly displays the "RN App" message, and then displays a loading spinner.
  2. The terminal displays a build log concluding with the following message:
** BUILD SUCCEEDED **


The following commands produced analyzer issues:
    Analyze Modules/RCTUIManager.m
(1 command with analyzer issues)
Installing build/Build/Products/Debug-iphonesimulator/RNApp.app
Launching org.reactjs.native.example.RNApp
org.reactjs.native.example.RNApp: 37986
  1. The "packager log" is displaying the following message:
~/dev/learning/react/native/react-native-meteor-boilerplate/RNApp/node_modules/react-native/packager ~
 โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” 
 โ”‚  Running packager on port 8081.                                            โ”‚ 
 โ”‚                                                                            โ”‚ 
 โ”‚  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                                  โ”‚ 
 โ”‚                                                                            โ”‚ 
 โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ 
Looking for JS files in
   /Users/Anders/dev/learning/react/native/react-native-meteor-boilerplate/RNApp 

[11:17:27 AM] <START> Building Dependency Graph
[11:17:27 AM] <START> Crawling File System
[Hot Module Replacement] Server listening on /hot

React packager ready.

[11:17:28 AM] <END>   Crawling File System (1241ms)
[11:17:28 AM] <START> Building in-memory fs for JavaScript
[11:17:29 AM] <END>   Building in-memory fs for JavaScript (296ms)
[11:17:29 AM] <START> Building in-memory fs for Assets
[11:17:29 AM] <END>   Building in-memory fs for Assets (142ms)
[11:17:29 AM] <START> Building Haste Map
[11:17:29 AM] <START> Building (deprecated) Asset Map
[11:17:29 AM] <END>   Building (deprecated) Asset Map (72ms)
[11:17:29 AM] <END>   Building Haste Map (398ms)
[11:17:29 AM] <END>   Building Dependency Graph (2111ms)
[11:18:19 AM] <START> request:/index.ios.bundle?platform=ios&dev=true
[11:18:19 AM] <START> find dependencies
transformed 743/743 (100%)
[11:18:20 AM] <END>   find dependencies (1081ms)
[11:18:20 AM] <END>   request:/index.ios.bundle?platform=ios&dev=true (1219ms)

I then attempted to run the app using the command npm run ios but this had the same result.

Pls let me know if I can provide any additional log information to help debug this.

Cannot login when runing on iOS

I cloned the repo
followed the steps and I reach to the login page.
I can create a user, and I can see the user has been inserted into meteor mongo
however, after create user, it doesn't go to the profile page due to meteor.user() returns null.

Anyone has the same issue?

Thanks

Get list data from meteor collection and pass it to dataSource

Hi,
I wanted to subscribe to a collection in my meteor app called "items", then pass it's data to a < ListView / >.
Can you please tell me the way to do so. I did a Meteor.subscribe('items'); and the ready() function returns false.

Also if you could update the todoApp with your updated boilerplate. It would be a great example on how to use the boilerplate.

Please update deprecated packages.

Hi,
When running npm install in RNApp folder, I'll get 2 warning messages which can be resolved by updating their packages in this project.

*_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]: cross-spawn no longer requires a build toolchain, use it instead!

npm WARN prefer global [email protected] should be installed with -g

Send error after wrong sign in

If i am trying to sign in with wrong login and password, Meteor send error, this is the handler

handleSignIn() {
    if (this.validInput(true)) {
      const { username, password } = this.state;
      Meteor.loginWithPassword(username, password, (err) => {
        if (err) {
          this.setState({ error: err.reason });
        }
      });
    }
  }

This code trying to this.setState, but after loginWithPassword the loggingIn status was changed, new <LoggedOut /> component was created, so this context specifies to old component and this.setState as a result working with unmounted component.
Can you advice some elegant method to avoid it, please?)

How to handle state?

One of the biggest challenges when integrating react with Meteor seems to be how to handle state. With react in the browser we already have mini mongo, but with react native we don't have that luxury. Should we try to make mini mongo for react native? Or should we use redux?

How to run on Android

This used to work for me in the past, but I'm now I'm struggling to get it going.

The error I get after running react-native run-android is:

Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html

I don't have an emulator running, but I'm not sure how to either. In the past, just running this command would load up the emulator.

RNApp has not been registered, possibly due to require()

Hi, I installed the boilerplate project as per your instructions and when I try to run in an iOS simulator I get a red screen with errors below:

Application RNApp has not been registered. This is either due to a require() error during initialization or failure to call AppRegistry.registerComponent.

runApplication
AppRegistry.js:92

__callFunction
MessageQueue.js:204

<unknown>
MessageQueue.js:95

guard
MessageQueue.js:41

callDFunctionReturnFlushedQueue
MessageQueue.js:94

I also created the AwesomeProject from the React-Native site and that seems to work fine.

I then tried to replace the contents of index.ios.js with those from AwesomeProject (so it doesn't try to import anything from ./app), but still the same error.

NOTE: When I was installing with NPM I was getting errors about eslint, so I took all that out of the package.json.

I have node 4.4.7 installed. I did start Meteor first and its running on :3000. As this is my first foray into React Native I'm at a loss for how to debug. I will now try on Android and update this issue. In the meantime your help would be most welcome.

Many thanks!

Below is the current state of package.json

{
  "name": "RNApp",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "ios": "open ios/RNApp.xcodeproj",
    "shake": "$ANDROID_HOME/platform-tools/adb devices | grep '\\t' | awk '{print $1}' | sed 's/\\s//g' | xargs -I {} $ANDROID_HOME/platform-tools/adb -s {} shell input keyevent 82"
  },
  "dependencies": {
    "@exponent/react-native-navigator": "^0.4.7",
    "gravatar-api": "^1.3.4",
    "react": "~15.2.1",
    "react-native": "^0.30.0",
    "react-native-keyboard-spacer": "^0.3.0",
    "react-native-meteor": "1.0.0-rc14",
    "react-native-tab-navigator": "^0.3.0"
  },
  "devDependencies": {
  }
}

re render MeteorComplexListView based on a change in state.

I have a MeteorComplexListView and I want to give dynamic styling to it's list items.
for example when a list item got touched, I want to give that specific list item a background color to show it is active.

I thought in renderRow I could do this:
const style = this.state.itemId == item._id ? { color: 'red' } : {};

return (
  <TouchableHighlight style={[styles.buttons, style]} onPress={() => {
    this.setState({ itemId: item._id })
    this.setState({ subitem: {} })
  }}>
    <Text>{item.text}</Text>
  </TouchableHighlight>
);

but this won't re render the listView and nothing happens.

Any ideas?

Connect to iphone and get a white screen with the loading spinner

I keep getting a white screen with the loading spinner when I connect to an iphone. I could not figure out how to change from localhost to my machine's IP address in AppDelegate.m.

"In RNApp/ios/RNApp/AppDelegate.m change localhost to your machine's IP address"

Method "userCreate" undefined.

I'm running the example app and I'm getting this message from the start. Do I need to create addition server side code.

Only see Loading screen in Android emulator on Windows

Can anyone help with some more details on how to get this running on Windows using an Android Emulator? I have followed the installation, cloned, npm install. When I run react-native run-android I get the extra bash window with the packager running and the emulator loads the app fine, but it's as if the meteor server is not running or connected and I just get the spinner.

I have tried starting the app with 192.168.1.22:3000 and localhost:3000 in the settings
I then tried updating meteor, hit the meteor-tools install error so I created a new app and then copied over the files and packages, meteor app runs fine in a browser. React app runs without errors. If I change the index.js to show Login instead of Loading I get to enter details but tapping Create Account does nothing.

I have tried running the react app with the meteor app running separately, or not running at all.

I then installed the react-native-meteor node module with npm -i --save react-native-meteor, same problem.

Am I missing a step here? Is there a way to test the connection between react and meteor? or is something else going on that I haven't considered?

Thank you in advance for any help, hints or suggestions.

running on android device (with linux)

You asked about running on an Android device in the README. I have done that and recorded my steps that I would be happy to submit to the README. One catch though is that I did all this on a linux machine. In linux the steps for setting up your phone, installing the app on the device, and running the react native server are all a bit different than with XCODE on a mac.

Wondering if you want to keep the instructions mac only or how you want to handle mixing linux and mac instructions.

Here's the steps I wrote down. Let me know how you would change it or feel free to modify and add to the README as you see fit.

For Linux

Enable USB Debugging

Enable USB Debugging on your phone. If already connected to your computer unplug and replug the USB connection afterwards. Android 5 steps below:

Settings > About Phone > Build number > Tap it 7 times to become developer;
Settings > Developer Options > USB Debugging.

Setup Device on Linux

Configure how the device will connect to the meteor server. See running android on a device to pick from the options.

Plug in your device and use lusb to find the first 4 digits of your device ID.

lsusb
Bus 001 Device 003: ID 04e8:2e76 Motorola PCS

Enter this in udev rules. In the example we are copying over 04e8

echo SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666", GROUP="plugdev" | sudo tee /etc/udev/rules.d/51-android-usb.rules

Check that your device is properly connecting to ADB, the Android Debug Bridge, by using:

adb devices

These steps are abstracted from the pages running on device and getting started on linux.

Install App and Run on Device for Linux

Build and install on your device, launch the react server, and then launch the app on your phone:

react-native android
react-native run-android

Meteor Login Logic creates a weird issue for me

The condition at react-native-meteor-boilerplate/RNApp/app/index.js

if (status.connected === false || loggingIn) {
    return <Loading />;
  } else if (user !== null) {
    return <LoggedIn />;
  }
  return <LoggedOut />;
};

I get a weird issue where the user is authenticated, but the user object is null for a split second and the login screen flashes. Any idea how to fix this?

Can not start on android

I have an emulator running via:
emulator -avd Nexus_5_API_23 -use-system-libs

react-native run-android, or gradlew installDebug fails with the error

Starting JS server...
Running /home/sudhanshu/Android/Sdk/platform-tools/adb reverse tcp:8081 tcp:8081
Building and installing the app on the device (cd android && ./gradlew installDebug...
Downloading https://services.gradle.org/distributions/gradle-2.4-all.zip

Exception in thread "main" java.lang.ExceptionInInitializerError
at javax.crypto.JceSecurityManager.(java.base@9-Ubuntu/JceSecurityManager.java:65)
at javax.crypto.Cipher.getConfiguredPermission(java.base@9-Ubuntu/Cipher.java:2595)
at javax.crypto.Cipher.getMaxAllowedKeyLength(java.base@9-Ubuntu/Cipher.java:2619)
at sun.security.ssl.CipherSuite$BulkCipher.isUnlimited(java.base@9-Ubuntu/CipherSuite.java:602)
at sun.security.ssl.CipherSuite$BulkCipher.(java.base@9-Ubuntu/CipherSuite.java:574)
at sun.security.ssl.CipherSuite$BulkCipher.(java.base@9-Ubuntu/CipherSuite.java:460)
at sun.security.ssl.CipherSuite.(java.base@9-Ubuntu/CipherSuite.java:1074)
at sun.security.ssl.SSLContextImpl.getApplicableSupportedCipherSuiteList(java.base@9-Ubuntu/SSLContextImpl.java:353)
at sun.security.ssl.SSLContextImpl.access$100(java.base@9-Ubuntu/SSLContextImpl.java:41)
at sun.security.ssl.SSLContextImpl$AbstractTLSContext.(java.base@9-Ubuntu/SSLContextImpl.java:582)
at java.lang.Class.forName0(java.base@9-Ubuntu/Native Method)
at java.lang.Class.forName(java.base@9-Ubuntu/Class.java:291)
at java.security.Provider$Service.getImplClass(java.base@9-Ubuntu/Provider.java:1844)
at java.security.Provider$Service.newInstance(java.base@9-Ubuntu/Provider.java:1820)
at sun.security.jca.GetInstance.getInstance(java.base@9-Ubuntu/GetInstance.java:236)
at sun.security.jca.GetInstance.getInstance(java.base@9-Ubuntu/GetInstance.java:164)
at javax.net.ssl.SSLContext.getInstance(java.base@9-Ubuntu/SSLContext.java:166)
at javax.net.ssl.SSLContext.getDefault(java.base@9-Ubuntu/SSLContext.java:98)
at javax.net.ssl.SSLSocketFactory.getDefault(java.base@9-Ubuntu/SSLSocketFactory.java:123)
at javax.net.ssl.HttpsURLConnection.getDefaultSSLSocketFactory(java.base@9-Ubuntu/HttpsURLConnection.java:332)
at javax.net.ssl.HttpsURLConnection.(java.base@9-Ubuntu/HttpsURLConnection.java:289)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.(java.base@9-Ubuntu/HttpsURLConnectionImpl.java:85)
at sun.net.www.protocol.https.Handler.openConnection(java.base@9-Ubuntu/Handler.java:62)
at sun.net.www.protocol.https.Handler.openConnection(java.base@9-Ubuntu/Handler.java:57)
at java.net.URL.openConnection(java.base@9-Ubuntu/URL.java:1049)
at org.gradle.wrapper.Download.downloadInternal(Download.java:55)
at org.gradle.wrapper.Download.download(Download.java:44)
at org.gradle.wrapper.Install$1.call(Install.java:59)
at org.gradle.wrapper.Install$1.call(Install.java:46)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:46)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:126)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Caused by: java.lang.SecurityException: Can not initialize cryptographic mechanism
at javax.crypto.JceSecurity.(java.base@9-Ubuntu/JceSecurity.java:91)
... 33 more
Caused by: java.lang.NullPointerException
at sun.nio.fs.UnixPath.normalizeAndCheck(java.base@9-Ubuntu/UnixPath.java:75)
at sun.nio.fs.UnixPath.(java.base@9-Ubuntu/UnixPath.java:69)
at sun.nio.fs.UnixFileSystem.getPath(java.base@9-Ubuntu/UnixFileSystem.java:280)
at java.nio.file.Paths.get(java.base@9-Ubuntu/Paths.java:84)
at javax.crypto.JceSecurity.setupJurisdictionPolicies(java.base@9-Ubuntu/JceSecurity.java:254)
at javax.crypto.JceSecurity.access$000(java.base@9-Ubuntu/JceSecurity.java:49)
at javax.crypto.JceSecurity$1.run(java.base@9-Ubuntu/JceSecurity.java:82)
at javax.crypto.JceSecurity$1.run(java.base@9-Ubuntu/JceSecurity.java:79)
at java.security.AccessController.doPrivileged(java.base@9-Ubuntu/Native Method)
at javax.crypto.JceSecurity.(java.base@9-Ubuntu/JceSecurity.java:78)
... 33 more
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html

~/android-studio/gradle/gradle-2.14.1/bin/gradle installDebug also fails with a different error

A problem occurred configuring root project 'RNApp'.

Could not resolve all dependencies for configuration ':classpath'.
Could not resolve com.android.tools.build:gradle:1.3.1.
Required by:
:RNApp:unspecified
> Could not resolve com.android.tools.build:gradle:1.3.1.
> java.lang.ExceptionInInitializerError

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Any help?

react-native run-ios build fail

Installing build/Build/Products/Debug-iphonesimulator/RNApp.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
RNApp/node_modules/react-native/node_modules/promise/lib/done.js:10
throw err;
^

Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/RNApp.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

Invalid State Error after bundling

Hi,

I finished my React Native app very quickly, thanks to your awesome boilerplate! Now, I want to try it in production, so I uncommented jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; and loaded the app on my Iphone. I can see the SignIn screen but when I actually try to signin or signup, I got an error INVALID_STATE_ERR.

I got the ddp package you advised (https://www.npmjs.com/package/ddp), even tried to downgrade to 0.1.1, and use react native 0.24.1.

Meteor 1.3 DDP login

Any ideas how to make the boilerplate work with Meteor 1.3 and the new directory structure? It seems the ddp login methods doesn't work anymore...

App crashing when run on Android Simulator & Device

I must apologise for the lack of detailed info. Here are my steps to reproduce the issue

macOS Sierra v 10.12 beta

  1. Ran npm install in the RNApp folder.
    I still get npm warnings but I've ignored them as suggested in other threads
npm WARN [email protected] requires a peer of eslint@^2.9.0 but none was installed.
npm WARN [email protected] requires a peer of eslint-plugin-jsx-a11y@^1.2.0 but none was installed.
npm WARN [email protected] requires a peer of eslint@^2.9.0 but none was installed.
  1. Ran the same npm install in the MeteorApp folder
    I also ran meteor update to update the Meteor patch to 1.14.01
    Meteor runs successfully. I can access the webpage via http://MY-MACS-IP:3000.

  2. Updated the METEOR_URL in config/settings to reflect the IP as suggested in the docs.

I keep getting a:

Unfortunately, RNApp has stopped

dialog when I run on both the simulator and the device. It crashes and I don't know where to begin debugging (Most tutorials assume the App is running)

Error on clicking 'Details' button

I just cloned bolierplate and ran the RNapp and metor apps, but after clicking on 'Details' button, I am getting this error below. Hope you will fix it soon.

image

image

-Naveen.

Unable to resolve module mobx

I tried to react-native run-ios or run-android in RNApp and I get this error:
screen shot 2016-07-09 at 5 39 22 am
screen shot 2016-07-09 at 5 39 17 am

Please help me to resolve this issue.

Sign in error state wiped out

From #21 (comment)

I just realised there's still a problem here. Sometimes it shows the error, and sometimes the screen just flashes and the email/password field just go blank with no error message shown.

Seems like the issue is due to what you wrote above:

What's happening is that when you press sign in/up with incorrect values the callback is being handled and setting the error state. The problem here is that when you press login/createAccount you set Meteor.loggingIn() to true, thus showing the Loading component.

The screen loads, the component gets unmounted, and all state is wiped.

Consider different DDP client

One of the top confusions I've seen lately has been surrounding ddp-client. There also may be some issues related to reconnection in the package.

Need to look for alternatives and/or rebuild ddp-client.

ddpClient is undefined after hot module replacement

I'm wondering if you've come across this and what you recommend to fix it? I'm pretty sure it has to do with the fact ddpClient is instantiated via new DDPClient.

I'm thinking of doing something similar I did with a redux store:

  module.hot.accept(() => {
      const nextRootReducer = combineReducers(require('./reducers'));
      store.replaceReducer(nextRootReducer);
      store = store; //for some reason the original store becomes null after the reducer is replaced.
    });

Basically you need to clean up the mess in module.hot.accept.

Element type is invalid: expected a string (for built-in components)

Hi I know I should post this on react-native-meteor repository for inProgress team. But no one responded there. Any help would be much appreciated.

I have 3 files. an index.js an Items.js and an ItemsContainer.js.
I keep getting this error:
Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. Check the render method of Items
The problem is with "< MeteorListView / >" in Items.js if I remove it the error goes away :(

Please help me resolve this issue.

index.js:

`import Items from './Items';
import ItemsContainer from './ItemsContainer';

export {Items};
export default ItemsContainer;`

ItemsContainer.js:

`import React, { Component } from 'react';
import Meteor, { createContainer } from 'react-native-meteor';
import { StyleSheet, View, Text } from 'react-native';
import Items from './Items';

class ItemsContainer extends Component {

constructor(props) {
super(props);
}

render() {
const { itemsReady } = this.props;

const styles = StyleSheet.create({
  container: {
    flex: 1,
  },
});

return (!itemsReady
  ? <Text>Loading...</Text>
  :<View style={styles.container}>
      <Items />
  </View>
);

}
}

// ItemsContainer.propTypes = {
// user: React.PropTypes.object,
// };

export default createContainer(() => {
const handle1 = Meteor.subscribe('items');
return {
itemsReady: handle1.ready(),
};
}, ItemsContainer);

And Items.js:

`import React, {Component} from 'react';
import { StyleSheet, Text, View, TouchableHighlight } from 'react-native';
import Meteor, {MeteorListView, MeteorComplexListView} from 'react-native-meteor';
import {COLORS, GRID_SETTINGS} from '../../styles';

class Items extends Component {
constructor(props) {
super(props);
this.state = {
itemId: '',
subitem: {}
};
}
render() {
return (
< View style={styles.container} >
< View style={styles.items} >
< MeteorListView collection="items" renderRow={() => this.renderItem(item)} / >
< /View >
< View style={styles.subitems} >
< /View >
< View style={styles.itemView} >
< /View >
< /View >
);
}
renderItem(item) {
return (
{item.text}
);
}
renderSubitem(subitem) {
return (
< Text>{subitem.text}< /Text>
);
}
}

const styles = StyleSheet.create({
container: {
flex: 1,
flexDirection: 'row'
},
items: {
flex: 2,
backgroundColor: 'gray'
},
content: {
flexDirection: 'row',
flex: 10
},
subitems: {
flex: 2,
backgroundColor: 'red'
},
itemView: {
flex: 8,
backgroundColor: 'green'
}
});

export default Items;`

Warning: You are manually calling a React.PropTypes validation function

Hey,

I'm getting several hundred PropTypes warnings that look like this:

ExceptionsManager.js:76 Warning: You are manually calling a React.PropTypes validation function for the `width` prop on `StyleSheet hidden`. This is deprecated and will not work in the next major version. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.
reactConsoleError   @   ExceptionsManager.js:76
warning @   warning.js:44
checkType   @   ReactPropTypes.js:120
validateStyleProp   @   StyleSheetValidation.js:32
validateStyle   @   StyleSheetValidation.js:48
create  @   StyleSheet.js:166
(anonymous function)    @   FSCollectionImagesPreloader.js:64
loadModuleImplementation    @   require.js:122
guardedLoadModule   @   require.js:65
_require    @   require.js:49
(anonymous function)    @   Meteor.js:21
loadModuleImplementation    @   require.js:122
guardedLoadModule   @   require.js:65
_require    @   require.js:49
(anonymous function)    @   index.js:2
loadModuleImplementation    @   require.js:122
guardedLoadModule   @   require.js:65
_require    @   require.js:49
(anonymous function)    @   index.ios.js:2
loadModuleImplementation    @   require.js:122
guardedLoadModule   @   require.js:58
_require    @   require.js:49
(anonymous function)    @   require-0.js:1
executeApplicationScript    @   debuggerWorker.js:18
onmessage   @   debuggerWorker.js:33

The code still works at the moment, but following the link ([https://fb.me/react-warning-dont-call-proptypes]) I see that the code will break with the next major version of React. I'm not sure how to solve this.

Any help you could provide would be great

Thanks,
-Casey

Android stuck in loading screen

I am running the app in the Android Emulator and it got stuck on the loading screen, like if it is unable to find the meteor server.

Any idea how to start debugging?

Unexpected token '<'

When running the code on an iOS device without any change in the code I get the following error:

 2016-08-22 17:21:16.243 [fatal][tid:main] 
Unhandled JS Exception: SyntaxError: Unexpected token '<'

any suggestions?

Can not start app on simulation

I got this error message when start react native

ERROR watch null EMFILE {"code":"EMFILE","errno":"EMFILE","syscall":"watch null","filename":null} Error: watch null EMFILE at exports._errnoException (util.js:855:11) at FSEvent.FSWatcher._handle.onchange (fs.js:1296:21

I installed watchman and already running server, but still got the problem. Please help.

Note: Seem it's error when using Mac OS Sierra. Please closed it =)

facebook/react-native#9309

For who got problem with it:

  • Update Xcode 8
  • brew install/update watchman

Auto-reload? (Windows 10, Genymotion)

First off: Hi! great starter kit!
... but :)

Can you tell me how I can get Genymotion to automatically show the changes I made ?
At the moment I have to stop the React Packager and restart it (via react-native start)

My system:
Windows 10, Genymotion 2.7.2
"this" boilerplate from about 10. july 2016

Greetings from Germany,
Max

Connecting to production server

How would you connect an app to a production server?

I changed this line:
let METEOR_URL = 'ws://localhost:3000/websocket';
to:
let METEOR_URL = 'ws://example.com/websocket';
But it didn't work for me.

Feel like I'm missing something small here.

App doesn't get past loading spinner

I'm able to launch the app both in a simulator on my Nexus 5, but all I see is a white screen with the loading spinner, I can leave it for a long time and it never passes it. Any ideas?

What license?

Hi @spencercarli , I want to use this for a client project, but I couldn't find a license anywhere?
Thanks for being a react-native/meteor trailblazer!

error with NPM install - installing ddp-client

I've been reading through the blog posts and just did a fresh install of this repo hopefully following the instructions correctly. I ran into an issue with the npm install step after going into the RNApp folder.

I get the error:

Error: No compatible version found: ddp-client@'spencercarli/node-ddp-client'
npm ERR! Valid install targets:
npm ERR! ["0.1.0","0.1.1-beta1","0.1.1-beta2","0.1.1-beta3","0.1.1","0.1.2"]

Changing the version on this line to 0.1.2 seems to have worked for the moment:
https://github.com/spencercarli/react-native-meteor-boilerplate/blob/master/RNApp/package.json#L10

Is this a step that should be part of the instructions? is 0.1.2 OK?

app errors

Hi, thanks very much for sharing this boilerplate. I followed your directions to install, but haven't been able to get the app working on the iOS simulator.

When the simulator opens up, it is all red with a note at the top:
this._nativeModule.addListener is not a function. (In 'this._nativeModule.addListener(eventType)','this._nativeModule.addListener' is undefined)

I have been using meteor successfully for a while now and it is still working in my other projects. Also, following the react-native installation guide, I was able to get the 'AwesomeProject' working from the Testing Installation section.

When I did npm install from RNApp I also got this:
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]: cross-spawn no longer requires a build toolchain, use it instead!
npm WARN prefer global [email protected] should be installed with -g

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.