[AC-6328] Cannot set required false to uses-feature in SDK 8
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Resolved |
Resolution | Done |
Resolution Date | 2019-08-23T16:43:38.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | android, manifest, permissions |
Reporter | Pietro Granati |
Assignee | Shak Hossain |
Created | 2019-08-01T07:37:48.000+0000 |
Updated | 2019-08-23T16:43:38.000+0000 |
Description
Hi guys, I have setted " " in the manifest but after uptate to SDK 8.0.2 (again this madness) Google Play store return that is required anyone have experienced the same problem?
Another guy on slack got the same problem:
I’m having the same problem since 8.0.2.GA as well - with quite a few hardware features (including android.hardware.touchscreen, android.hardware.bluetooth, android.hardware.nfc, android.hardware.screen.portrait, …). I’ve forced all to false in TiApp.xml, I’ve tried creating a custom AndroidMainfest.xml, I’ve tried several things but they all are forced to required=“true” which eliminates about 95% of devices from compatibility when I try to upload to the Play store. If I go back to a pre-8.0 SDK then all is fine again…
Hi! Have you checked all
timodule.xml
files in all modules to verify there isn't arequired="true"
setting there? I tried to reproduce and I can only reproduce if I don't touch timodule. Alltimodule.xml
files override any setting in tiapp.xml. I've used SDK 8.0.2.GA and the latest RC release of the CLI (7.1.0-24)No, because in SDK 7.5.1 all works fine so it makes no sense to me
Can you check them? The ti.nfc module overrides it on its own for certain (I just confirmed that) so perhaps logic changed or the file was reset somehow.
How Titanium was merging the module's and your app's
<uses-feature/>
XML setting before was wrong and what it is doing now is correct. (One man's bug is another man's feature apparently.) Have a look at Google's docs on how the "AndroidManifest.xml" file are supposed to be merged below. https://developer.android.com/studio/build/manifest-merge Here is a quick copy-and-paste from the above link for your convenience... bq. The android:required attribute in thetrue
, which means its setting wins. https://github.com/appcelerator-modules/ti.nfc/blob/master/android/timodule.xml Personally, I don't think the "ti.nfc" module should be setting this<uses-feature/>
at all and its the module that needs to be changed. In your case, I recommend that you change the installed "ti.nfc" module's "timodule.xml" mentioned above and remove its<uses-feature/>
. On Mac, this module will be installed under the following directory by default...I hope this helps.
Thank you all and yeah "One man's bug is another man's feature apparently". I'm finishing another project now but next week I'll give it a try, but on google forums I read another thing that with a string you can override the uses-feature:
Unfortunately, Titanium's build tool does not support the "tools:*" attributes in "tiapp.xml" or "timodule.xml" since we generate the "AndroidManifest.xml" ourselves from those files. But that is definitely something we should consider supporting in the future. Thanks for bringing this up.
I think the
<uses-feature/>
merge can be further improved. Setting it totrue
in "tiapp.xml" is not overriding a library'sfalse
setting, which is not good. And I agree that havingtools:replace="android:require"
support would be helpful. I've written up new ticket [TIMOB-27304] to do the above. You may want to keep watch on it. We'll see about doing this in Titanium 8.1.1. In the meantime, deleting the "timodule.xml" file's<uses-feature/>
is the way to go for now. Doing that means your "tiapp.xml" settings will always win.Hi guys, I've tested what Joshua said and it works. Now I've lost only 200 devices but it's for the API version not supported and it's normal Thank you