Closed jeremypele closed 5 years ago
Yep, the reason it is happening is because android
isn't defined under NS 6. This actually should be a pretty simple fix to support it properly...
@jeremypele - Try version 1.3.7 and see if that fixes it for you.
@NathanaelA Yes it did!
I succeeded to build with the same modification (put global
before any android
accessor) but only into hasSupportVersion4
, so builded but issues during runtime. Guess all instances needed to be prefixed :)
Many thanks 🙏 🎉
Edit: Just a missing guard clause to test global.android
is defined before trying to access support
=> https://github.com/NathanaelA/nativescript-permissions/pull/41
@jeremypele - global.android
should be defined, android
technically should also be defined -- but I suspect the issue is that the script that creates the snapshot has a bug in it that thinks android
is no longer defined.
Typescript Example-Code based on @jeremypele's solution:
permissions.requestPermission(
(global as any).android.Manifest.permission.READ_EXTERNAL_STORAGE,
'I need these permissions because I\'m cool')
.then...
Hi,
on the latest version, I'm facing the issue
android is not defined
when I want to bundle a release version that I've trailed down to this specific linehttps://github.com/NathanaelA/nativescript-permissions/blob/8cb1507a7bfb3dcf1e9b735b7b9bd444d765744e/src/permissions.android.js#L165
Tried to add guard clause on
android
property, but not working eitherif (!android || !android.support || !android.support.v4
I've search for a couple of days to fix that, any idea why it's happening?