Android 库是否需要清单、应用程序名称、图标? [英] Does an Android Library need a manifest ,app_name,Icon?

查看:26
本文介绍了Android 库是否需要清单、应用程序名称、图标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个输出 aar 库的 android 库.该库将内置到不同的 projectFlavors 移动、电视和穿戴应用程序中.我认为这些平台中的每一个都应该通过 manifest 和 productflavors 设置应用名称、图标和权限等变量.

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.

有什么方法可以在不需要 AndroidManifest.xml 和 drawables(用于图标)的情况下构建 AAR?

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

有关我在做什么的更多信息可以在我关于该主题的最后一个问题中找到:Android Studio Java 库模块与 Android 库模块

推荐答案

任何 android 库都需要有一个 AndroidManifest.xml 文件,但不需要名称或图标.只有在有 MAIN 和 LAUNCHER 的活动时才需要它.

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>

这篇关于Android 库是否需要清单、应用程序名称、图标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆