Titanium JIRA Archive
Appcelerator Community (AC)

[AC-6328] Cannot set required false to uses-feature in SDK 8

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionDone
Resolution Date2019-08-23T16:43:38.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsandroid, manifest, permissions
ReporterPietro Granati
AssigneeShak Hossain
Created2019-08-01T07:37:48.000+0000
Updated2019-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…

Comments

  1. Rene Pot 2019-08-01

    Hi! Have you checked all timodule.xml files in all modules to verify there isn't a required="true" setting there? I tried to reproduce and I can only reproduce if I don't touch timodule. All timodule.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)
  2. Pietro Granati 2019-08-01

    No, because in SDK 7.5.1 all works fine so it makes no sense to me
  3. Rene Pot 2019-08-01

    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.
  4. Joshua Quick 2019-08-02

    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 the and elements use an OR merge, such that if there is a conflict, "true" is applied and the feature or library required by one manifest is always included. The issue is that the "ti.nfc" module set "required" to true, 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...
       ~/Library/Application Support/Titanium/modules/android/ti.nfc
       
    I hope this helps.
  5. Pietro Granati 2019-08-02

    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: but it didn't work
  6. Joshua Quick 2019-08-02

    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.
  7. Joshua Quick 2019-08-03

    I think the <uses-feature/> merge can be further improved. Setting it to true in "tiapp.xml" is not overriding a library's false setting, which is not good. And I agree that having tools: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.
  8. Pietro Granati 2019-08-05

    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

JSON Source