react-native-app-info icon indicating copy to clipboard operation
react-native-app-info copied to clipboard

Cannot read property 'version' of undefined

Open aymericbouzy opened this issue 9 years ago • 7 comments

I'm getting this error in Android. It works fine in iOS

Cannot read property 'version' of undefined
Object.getInfoVersion
    index.js:8
<unknown>
    constants.js:17
loadModuleImplementation
    require.js:122
guardedLoadModule
    require.js:65
_require
    require.js:49
<unknown>
    icon.js:4
loadModuleImplementation
    require.js:122
guardedLoadModule
    require.js:65
_require
    require.js:49
<unknown>
    main_app.js:23

Maybe the package isn't linked in Android ? When I ran $ rnpm link react-native-app-info, I got

rnpm-link info Linking react-native-app-info ios dependency 
rnpm-link info iOS module react-native-app-info has been successfully linked 

but nothing about linking Android.

EDIT : I can see that the code has not been released to npm, any plans on doing so ?

aymericbouzy avatar Oct 13 '16 12:10 aymericbouzy

I edited my package.json file to fetch directly from github :

"dependencies": {
  "react-native-app-info": "Iragne/react-native-app-info",
  ...
}

ran npm i, and now it seems I have the master branch in my node_modules folder.

However i still get the same error.

aymericbouzy avatar Oct 13 '16 12:10 aymericbouzy

same here...

darrenchiu avatar Feb 08 '17 03:02 darrenchiu

It is now working for me, but it's such a long time ago that I don't really recall what solved it for me. My package.json file has the following line :

    "react-native-app-info": "github:iragne/react-native-app-info",

hope it helps.

aymericbouzy avatar Feb 08 '17 08:02 aymericbouzy

thanks @aymericbouzy, i did the similar thing but from a fork version of this repo. Believe it's because a new version haven't been release to npm yet...

"react-native-app-info": "github:ohmyguigs/react-native-app-info",

darrenchiu avatar Feb 09 '17 02:02 darrenchiu

Cannot read property 'version' of undefined my version: react-native-cli: 2.0.1 react-native: 0.48.3

longpq18 avatar Sep 28 '17 07:09 longpq18

Maybe have a look at Expo.io? I believe they have built in support for these.

aymericbouzy avatar Sep 28 '17 07:09 aymericbouzy

i use react-native-version-number for replace

longpq18 avatar Sep 28 '17 07:09 longpq18