when we add a permission to the xml file we get build error, the permission we add is the fallowing
<config-file parent="/manifest" target="AndroidManifest.xml" xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
</config-file>
the error we get is :
Failed UserError: FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ‘:app:generateDebugBuildConfig’. > Failed to calculate the value of task ‘:app:generateDebugBuildConfig’ property ‘buildConfigPackageName’. See log for full details.
how to solve this?
ghenne
September 16, 2021, 9:01pm
2
This looks like a problem with the plugin. Do you know which one it is?
Check the GitHub repo issues for it and see if there are any similar reports - otherwise, you’ll need to ask the maintainer for help.
Hello Sir
This isn’t a plugin, this is a line to request permission from user. isn’t related to any plugin.
ghenne
September 17, 2021, 12:44am
4
Yes, I understand.
What plug-in uses this permission?
as i know is cordova-plugin-device
ghenne
September 18, 2021, 2:59pm
6
I did find a related issue. You might want to contact the maintainers of the plugin to see if they have suggestions. It doesn’t look like it’s something that is caused by VoltBuilder.
apache:master
← selmo47:android-26-get-serial
opened 08:45PM - 16 Jul 20 UTC
* get the serial according to the Api_level:
+ if Api_level < 26:
… => android.os.Build.SERIAL (deprecated in Api_level 26)
+ else:
=> serial = android.os.Build.getSerial(); (introduced in 26)
* add the appropriate permissions:
+ READ_PHONE_STATE
+ READ_PRIVILEGED_PHONE_STATE
<!--
Please make sure the checklist boxes are all checked before submitting the PR. The checklist is intended as a quick reference, for complete details please see our Contributor Guidelines:
http://cordova.apache.org/contribute/contribute_guidelines.html
Thanks!
-->
### Platforms affected
* Android (only)
### Motivation and Context
The android 9 introduced some changes in reading crucial device info (https://developer.android.com/about/versions/pie/android-9.0-changes-28), so to get the serial number of a device, you must use getSeial method instead of the 'SERIAL' constante (whoch is depricated), you need also the following permissions
* READ_PHONE_STATE
* READ_PRIVILEGED_PHONE_STATE
### Description
### Testing
### Checklist
- [ ] I've run the tests to see all new and existing tests pass
- [ ] I added automated test coverage as appropriate for this change
- [x] Commit is prefixed with `(platform)` if this change only applies to one platform (e.g. `(android)`)
- [x] If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct [keyword to close issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/))
- [ ] I've updated the documentation if necessary