230
Views
6
Comments
Solved
[Android Permissions Plugin] [Android Permissions Plugin] Permissions not defined
Question
android-permissions-plugin
Mobile icon
Forge asset by Miguel Antunes

I am having an issue, where android permissions plugin is never getting defined.

I am using the plugin with the IMEI Plugin, and before any code is launched, there are if statements that run the 'CheckAndroidPermissionsPlugin' function but it is always returning false.

I have tried manually checking if 

var permissions = cordova.plugins.permissions

is undefined and it always is.

I'm not sure what i have done wrong, as i am just using the basic functions within the plugin?

It is probably good to mention that i am using the native app to test this functionality, and other cordova plugins are working, so the issue isn't that cordova isn't defined, as it always passes that check.

Any help would be highly appreciated!


Here is the code within the IMEI plugin that is getting ran:

2020-02-28 09-46-54
Eduardo Jauch
Solution

Hi Brandon,

Yes. Every time you add a new plugin, as it will have native code and this is not handled by the automatic update, it must be generated again and installed again in the device.

But if you already did this, it may be another type of problem...

UserImage.jpg
Brandon Mills

Eduardo Jauch wrote:

Hi Brandon,

Yes. Every time you add a new plugin, as it will have native code and this is not handled by the automatic update, it must be generated again and installed again in the device.

But if you already did this, it may be another type of problem...

I'll quickly rebuild and reinstall the native app again on my phone, and see if it works...


UserImage.jpg
Brandon Mills

Eduardo Jauch wrote:

Hi Brandon,

Yes. Every time you add a new plugin, as it will have native code and this is not handled by the automatic update, it must be generated again and installed again in the device.

But if you already did this, it may be another type of problem...

Hi Eduardo,

I have rebuilt the native app and the plugins are now working. I must have built the app just before i installed the new plugins, my mistake.

Thank you very much for your swift help with this matter, you're a lifesaver!


2020-02-28 09-46-54
Eduardo Jauch

Hello Brandon,

Sorry for asking, but did you create a new package and install it in the device after including the Permissions Plugin?

Cheers.

UserImage.jpg
Brandon Mills

Eduardo Jauch wrote:

Hello Brandon,

Sorry for asking, but did you create a new package and install it in the device after including the Permissions Plugin?

Cheers.

Hi Eduardo, thanks for the quick reply!


When i installed the IMEI Plugin, the permissions plugin was installed as a dependency, so both the IMEI and the android permission plugins are in their own applications/modules.

Then i added the IMEI plugin in the references in the app i am using as seen below:



EDIT:

Also, I did try building the native app again, and installing the new native app on the device after installing the plugin, however i got the same issues as before. Is that required for any new cordova plugins, as i thought that outsystems updates the native apps automatically when any code changes are published?

2020-02-28 09-46-54
Eduardo Jauch
Solution

Hi Brandon,

Yes. Every time you add a new plugin, as it will have native code and this is not handled by the automatic update, it must be generated again and installed again in the device.

But if you already did this, it may be another type of problem...

UserImage.jpg
Brandon Mills

Eduardo Jauch wrote:

Hi Brandon,

Yes. Every time you add a new plugin, as it will have native code and this is not handled by the automatic update, it must be generated again and installed again in the device.

But if you already did this, it may be another type of problem...

I'll quickly rebuild and reinstall the native app again on my phone, and see if it works...


UserImage.jpg
Brandon Mills

Eduardo Jauch wrote:

Hi Brandon,

Yes. Every time you add a new plugin, as it will have native code and this is not handled by the automatic update, it must be generated again and installed again in the device.

But if you already did this, it may be another type of problem...

Hi Eduardo,

I have rebuilt the native app and the plugins are now working. I must have built the app just before i installed the new plugins, my mistake.

Thank you very much for your swift help with this matter, you're a lifesaver!


2020-02-28 09-46-54
Eduardo Jauch

You're welcome :)
Glad it is working.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.