当前位置:网站首页>库项目和App项目中清单文件的包名不要相同
库项目和App项目中清单文件的包名不要相同
2022-06-25 22:02:00 【android_cai_niao】
在清单文件中有一个包名,如下:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="a.b.c">
。。。
</manifest>
这个包名的作用是用于IDE生成资源文件的包名,比如:
a.b.c.R.id
a.b.c.R.string
a.b.c.R.layout
a.b.c.BuildConfig
在BuildConfig中有一个属性:DEBUG,可用于判断当前App是Debug版本还是Release版本,如果一个库项目清单文件中的包名和app项目清单文件中的包名是一样的,则在App运行时,访问的a.b.c.BuildConfig是库项目中生成的,如果库项目是使用release版本的,则在App中访问到的BuildConfig.DEBUG属性为ture,而我们在App项目中,使用这个属性是为了要判断App是Debug版本还是Release版本,而不是要判断库项目是什么版本,所以,为了预防这种情况,要把库项目和App项目的清单文件中的包名设置为各不一样的。
边栏推荐
- Leetcode (605) -- flower planting
- 电路模块分析练习5(电源)
- Baidu: in 2022, the top ten hot spots will rise and the profession will be released. There is no suspense about the first place!
- Pycharm student's qualification expires, prompting no suitable licenses associated with account solution
- What is Unified Extensible Firmware Interface (UEFI)?
- Pointer strengthening and improvement
- 信息学奥赛一本通 1353:表达式括号匹配(stack) | 洛谷 P1739 表达式括号匹配
- Why is the frame rate calculated by opencv wrong?
- 自定义QComboBox下拉框,右对齐显示,下拉列表滑动操作
- Circuit module analysis exercise 6 (switch)
猜你喜欢

【AXI】解读AXI协议原子化访问

Beacon realizes asset management and indoor positioning based on 5.2 ultra-low power Bluetooth module efr32 (bg22ax)

提取系统apk

Idea auto generator generates constructor get/set methods, etc

LeetCode-1528-重新排列字符串-哈希表-字符串

漏刻有时API接口实战开发系列(13):小鹅通云服务PHP-API二维数组传参解决方案

【opencv450-samples】inpaint 使用区域邻域恢复图像中的选定区域

konva系列教程2:绘制图形

How to use drawing comparison function in CAD

ACM. Hj16 shopping list ●●
随机推荐
The software test interview has been suspended. The interviewer always says that the logical thinking is chaotic. What should I do?
How to add cartoon characters to the blog park?
Pycharm student's qualification expires, prompting no suitable licenses associated with account solution
信息学奥赛一本通 1353:表达式括号匹配(stack) | 洛谷 P1739 表达式括号匹配
漏刻有时API接口实战开发系列(13):小鹅通云服务PHP-API二维数组传参解决方案
Typora writing DOS commands
统计字符串中不同回文子序列的个数
Xampp重启后,MySQL服务就启动不了。
Xinchida nd04 nd04c nrf52832 (52810) ble module (low power Bluetooth communication module) at command test
Multithreaded learning 1
分享一个OSGeo4W64下载好的库,基于qgis3.10的
Meta universe standard forum established
NLP text summary: use the pre training model to perform text summary tasks [transformers:pipeline, T5, Bart, Pegasus]
hiberate核心API/配置文件/一级缓存详解
Live800在线客服系统:跨越时空做生意,从每次互动开始
cookie、session、token
[opencv450 samples] read the image path list and maintain the proportional display
Qt Utf8 与 Unicode 编码的互相转换, Unicode编码输出为格式为 &#xXXXX
Baidu: in 2022, the top ten hot spots will rise and the profession will be released. There is no suspense about the first place!
Paper notes: multi tag learning MSWl