Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-27325

Android: Adding <uses-library/> within "tiapp.xml" file's <manifest/> block creates invalid entry in "AndroidManifest.xml"

    Details

    • Story Points:
      3
    • Sprint:
      2019 Sprint 26

      Description

      Summary:
      Adding a <uses-library/> element within the "tiapp.xml" file's <manifest/> block will create an invalid entry within the generated "AndroidManifest.xml" when doing a build.

      Note:
      The <uses-library/> entry is supposed to go within the <application/> block, not the <manifest/> block. So, doing this would have been invalid anyways. This makes this bug a very minor issue.
      https://developer.android.com/guide/topics/manifest/uses-library-element

      Steps to reproduce:

      1. Setting a project's "tiapp.xml" with the <uses-library/> entry below.
      2. Build the project.
      3. Open Finder or Window Explorer.
      4. Go to project's subdirectory: ./build/android
      5. Open the "AndroidManifest.xml" file.

      <?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-library android:name="com.google.android.maps"/>
      		</manifest>
      	</android>
      </ti:app>
      

      Result:
      The following invalid XML element can be found within the "AndroidManifest.xml" file. This doesn't prevent the app from running, but it's still not good that this is there.

      <uses-library>[object Object]</uses-library>
      

      Expected Result:
      Build system should either omit the <uses-library/> entry or add it as-is.

      Solution:
      As noted above, the <uses-library/> is supposed to go within the <application/> block. So, all Titanium app devs should be doing the following instead. The build system will correctly inject this into the "AndroidManifest.xml" file.

      <?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>
      			<application>
      				<uses-library android:name="com.google.android.maps"/>
      			</application>
      		</manifest>
      	</android>
      </ti:app>
      

        Attachments

          Activity

            People

            • Assignee:
              jquick Joshua Quick
              Reporter:
              jquick Joshua Quick
              Reviewer:
              Gary Mathews
            • Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Integration