Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is versionCode/versionName required in library manifest?

Below is a manifest of one of my library projects. Currently I increase the versionCode and versionName with every change. Is that required?

<?xml version="1.0" encoding="utf-8"?>

<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:installLocation="preferExternal" 
    android:versionCode="14"
    android:versionName="1.1.7"
    package="com.tubala.android" >

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <uses-sdk
        android:minSdkVersion="7"
        android:targetSdkVersion="11" />
</manifest> 

Thanks in advance.

like image 216
Harald Wilhelm Avatar asked Sep 11 '11 08:09

Harald Wilhelm


People also ask

What is versionCode and versionName?

The version code is an incremental integer value that represents the version of the application code. The version name is a string value that represents the “friendly” version name displayed to the users.

What is the use of AndroidManifest XML file?

Every app project must have an AndroidManifest. xml file (with precisely that name) at the root of the project source set. The manifest file describes essential information about your app to the Android build tools, the Android operating system, and Google Play.

Which of the following is used to a manifest about application modules packages?

The main component of the AndroidManifest. xml file is known as manifest. Additionally, the package field describes the activity class's package name. It must contain an <application> element with the xmlns:android and package attribute specified.

How can we add activity in manifest?

To declare your activity, open your manifest file and add an <activity> element as a child of the <application> element. For example: <manifest ... > The only required attribute for this element is android:name, which specifies the class name of the activity.


1 Answers

Currently AndroidManifest.xml of Android Library is completely ignored when building application that uses this library. The only thing that is used by aapt tool is package attribute (to generate R class into correct package).

This might be changed in next releases. But I'd say you should keep your versioning anyway. This is a good practice (even if build tools are ignoring it).

like image 138
inazaruk Avatar answered Oct 26 '22 12:10

inazaruk