question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

not working on android - undefined is not an object

See original GitHub issue

I followed the example in the readme (tried both manual installation and automatic) and no matter what I do, when I press the share button Share.open always fails with: undefined is not an object (evaluating '_reactNativeShare2.default.open')

building on Ubuntu 14.04 64-bit and running on Android 5.0.1

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8

github_iconTop GitHub Comments

5reactions
EstebanFuentealbacommented, Jul 24, 2016

Yes, rnpm link doesn’t work. In React Native >= 0.29 you need:

Android

  1. npm install react-native-share --save

  2. Open up android/app/src/main/java/[...]/MainApplication.java

    • Add import cl.json.RNSharePackage; to the imports at the top of the file
    • Add new RNSharePackage() to the list returned by the getPackages() method
  3. Append the following lines to android/settings.gradle: include ':react-native-share' project(':react-native-share').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-share/android')

  4. Insert the following lines inside the dependencies block in android/app/build.gradle:

    ```
    compile project(':react-native-share')
    ```
    
0reactions
logileifscommented, Jul 24, 2016

@EstebanFuentealba it works with these instructions, thanks 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

undefined is not an object (evaluating 'data.map')
Best guess from the code snippet is that you are rendering before data is populated. I would try something like this;
Read more >
undefined is not an object (evaluating 'l.default.manifest ...
React native maps not working on Android standalone app. App is crashing and not rendering any maps on screen. Environment. System: OS: WINDOWS ......
Read more >
undefined is not an object (evaluating 'process.version.split ...
Description. After installing packages and running metro bundler, I get a 100% successful build but this error in the android emulator. · React...
Read more >
Problem with IOS in Mac. TypeError undefined is not an object ...
Problem with IOS in Mac. TypeError undefined is not an object (evaluating'self.view.tpLoginSignUp.tfIdentify.text'). How can i fix this?
Read more >
undefined - JavaScript - MDN Web Docs - Mozilla
A function returns undefined if a value was not returned . Note: While you can use undefined as an identifier (variable name) in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found