Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Medium
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: Release 8.1.1
-
Component/s: Android
-
Labels:
-
Story Points:5
-
Sprint:2019 Sprint 17
Description
Summary:
The "AndroidManifest.xml" file's <uses-feature/> "android:required" attribute value can be set to true or false. When multiple manifests declare the same <uses-feature/>, the merge process must do a logical OR of these values. This means that if one of the manifest files sets it to true, it can be made false at the end of the XML merge. (The true setting wins.)
https://developer.android.com/studio/build/manifest-merge
When the Titanium build merges "timodule.xml" and "tiapp.xml" settings, it does not "OR" the "android:required" values. Instead the original "timodule.xml" value always wins. This means if the "timodule.xml" sets it false, the "tiapp.xml" is never able to set it true. (The reverse is not an issue though.)
Note:
The behavior of the XML merge has changed as of Titanium 8.0.2. Before 8.0.2, the "tiapp.xml" manifest settings used to blindly overwrite the "timodule.xml" manifest settings, which was not technically correct but did allow the "tiapp.xml" to override <uses-feature/> to true or false (it still wasn't {{OR}}ing the values though). Titanium 8.0.2 improved the merge to better follow Google's merging rules, but it is not {{OR}}ing the values which is what's needed.
Steps to reproduce:
- Create a Classic Titanium app project.
- Add modules "ti.barcode" to "tiapp.xml". (Can download from here.)
- Add the <uses-feature/> settings in "tiapp.xml" as shown below.
- Build for Android.
- Open Mac's "Finder" window. (Or "Windows Explorer" on Windows.)
- Go to project subdirectory: ./build/android
- Open file "AndroidManifest.xml".
- Observe its <uses-feature/> XML elements.
<?xml version="1.0" encoding="UTF-8"?> |
<ti:app xmlns:ti="http://ti.appcelerator.org"> |
<android xmlns:android="http://schemas.android.com/apk/res/android"> |
<manifest> |
<uses-feature android:name="android.hardware.camera" android:required="false"/> |
<uses-feature android:name="android.hardware.touchscreen" android:required="true"/> |
</manifest> |
</android> |
<modules> |
<module platform="android">ti.barcode</module> |
</modules> |
</ti:app> |
Result:
The merged "AndroidManifest.xml" file's <uses-feature/> for "android.hardware.touchscreen" is false when it should be true.
Expected Result:
The <uses-feature/> for "android.hardware.touchscreen" should be true, not false. The values need to be OR'ed together.
Attachments
Issue Links
- relates to
-
AC-6328 Cannot set required false to uses-feature in SDK 8
- Resolved