Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does an Android Library need a manifest ,app_name,Icon?

I have an android Library that outputs an aar library. This library will be built into different projectFlavors of Mobile, TV and Wear apps. I think that each of these platforms' should be the ones that set variables like the app name, icon, and permissions through the manifest and productflavors.

Is there any way to build an AAR without requiring an AndroidManifest.xml and therefore drawables(for the icon)?

More information about what I'm doing can be found at my last question on the subject: Android Studio Java Library Module vs. Android Library Module

like image 364
BillHaggerty Avatar asked Jan 26 '15 20:01

BillHaggerty


People also ask

What is Android manifest file Why do you need this?

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.

What is uses Library in Android manifest?

<uses-library> Note: Google Play uses the <uses-library> elements declared in your app manifest to filter your app from devices that don't meet its library requirements.

What is manifest folder in Android Studio?

Manifests folder contains AndroidManifest. xml for our creating the android application. This file contains information about our application such as the Android version, metadata, states package for Kotlin file, and other application components. It acts as an intermediator between android OS and our application.

What is manifest example in Android?

The AndroidManifest. xml file contains information of your package, including components of the application such as activities, services, broadcast receivers, content providers etc.


1 Answers

Any android library needs to have an AndroidManifest.xml file, but a name or an icon is not required. It's only needed when there is an activity that is MAIN and LAUNCHER.

You simply could use this manifest and your library will work like a charm.

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"     package="[your package]"     android:versionCode="1"     android:versionName="1.0" >      <uses-sdk android:minSdkVersion="[min supported version]" />      <application/>  </manifest> 
like image 200
Proverbio Avatar answered Sep 17 '22 23:09

Proverbio