react-native-permissions icon indicating copy to clipboard operation
react-native-permissions copied to clipboard

'Permissions.check is not a function' Error

Open jessiemblack opened this issue 9 years ago • 43 comments

I upgraded from 1.0.1 to 1.0.3 and started receiving this error. It said,

Permissions.check is not a function. (In 'Permissions.check('contacts')', 'Permissions.check' is undefined)

To fix this, I was forced to downgrade to 1.0.1.

jessiemblack avatar Dec 01 '17 23:12 jessiemblack

@jessalbarian Are you using Android? iOS? Which OS version? TypeScript? JavaScript?

zoontek avatar Dec 02 '17 14:12 zoontek

Android and iOS, the same error on real devices and the emulators on Android Studio and Xcode. The code base is React Native. The attached image is from an Xcode emulator for iPhone 6.

screen shot 2017-11-30 at 4 13 11 pm

jessiemblack avatar Dec 02 '17 15:12 jessiemblack

I just release 1.0.4, can you give it a try? Don't forget to cleanup your cache by starting the packager with yarn start --reset-cache

zoontek avatar Dec 02 '17 18:12 zoontek

@zoontek Facing same issue on 1.0.4

ios on xcode emulator
iphone 7 plus

"react": "16.1.0",
"react-native": "0.50.3",
"react-native-permissions": "^1.0.4",

chinmayv avatar Dec 05 '17 15:12 chinmayv

Just to be sure, did you run react-native link react-native-permissions?

MoOx avatar Dec 06 '17 07:12 MoOx

Same issue here!

hazemhagrass avatar Dec 13 '17 09:12 hazemhagrass

Are you using react-native link react-native-permissions? Is a Podfile present in your project?

zoontek avatar Dec 13 '17 10:12 zoontek

@zoontek yes I'm using react-native link react-native-permissions I believe

screen shot 2017-12-13 at 5 14 17 pm

Uploading Screen Shot 2017-12-13 at 5.14.17 PM.png… screen shot 2017-12-13 at 5 14 27 pm

yes there is a POD file in my project.

hazemhagrass avatar Dec 13 '17 15:12 hazemhagrass

@hazemhagrass Can you do a console.log(ReactNativePermissions) and tell me what's the output?

zoontek avatar Dec 13 '17 15:12 zoontek

@zoontek here we go screen shot 2017-12-13 at 5 41 24 pm

hazemhagrass avatar Dec 13 '17 15:12 hazemhagrass

Do you use CommonJS or ESmodule? If you use the first one, don't forget to add the default: https://github.com/gaearon/redux-thunk#note-on-2x-update

Still, the module is not linked properly. Make sure the Library path is available in the Header Search paths (in build settings)

zoontek avatar Dec 13 '17 15:12 zoontek

@zoontek no diffrence. screen shot 2017-12-13 at 5 58 37 pm screen shot 2017-12-13 at 5 58 55 pm screen shot 2017-12-13 at 5 59 02 pm

hazemhagrass avatar Dec 13 '17 15:12 hazemhagrass

@zoontek FYI This is happening only with your plugin, all others are fine

hazemhagrass avatar Dec 13 '17 16:12 hazemhagrass

Remove it from recovered references and add it manually

zoontek avatar Dec 13 '17 16:12 zoontek

@zoontek which one I should remove and add manually? your plugin?

hazemhagrass avatar Dec 13 '17 17:12 hazemhagrass

I'm seeing the same issue

FrenchBully avatar Dec 13 '17 18:12 FrenchBully

Still having this issue.

jessiemblack avatar Dec 13 '17 18:12 jessiemblack

@hazemhagrass @jessalbarian This fixed it for me Permissions.default.check(key) instead of Permissions.check(key)

FrenchBully avatar Dec 13 '17 19:12 FrenchBully

@FrenchBully Thanks for help but still not working screen shot 2017-12-14 at 8 14 49 am

hazemhagrass avatar Dec 14 '17 06:12 hazemhagrass

@zoontek not working even after manual edits. screen shot 2017-12-14 at 8 18 04 am screen shot 2017-12-14 at 8 18 55 am

hazemhagrass avatar Dec 14 '17 06:12 hazemhagrass