• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
随—风
博客园    首页    新随笔    联系   管理    订阅  订阅

Android-SDK封装(jar,so,aar)

**集成aar库**

***aar库操作:***
1. 能正常封装成aar库;
2. 去掉manifest中application中的icon, roundIcon,label;

3. 异常部分抛出;


***引入aar项目:***
3. 把库manifest下的权限移到项目相同文件下;
4. buil.gradle文件版本要与库中版本一致,把库中引入的依赖和其他配置全部移到项目中;
5. 项目中文件命名最好不与库中文件名一致;
6. 如果要引入的aar项目中有多个库,都要封装成aar引入;
7. 添加 tools:replace="android:icon, android:theme, android:roundIcon"

```
<application
android:allowBackup="true"
android:icon="@mipmap/icon_security"
android:label="@string/app_name"
android:roundIcon="@mipmap/icon_security"
android:supportsRtl="true"
android:theme="@style/AppBaseTheme"
tools:replace="android:icon, android:theme, android:roundIcon">
<activity
android:name="com.csizg.andtest.MaintestActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>

<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
```

posted @ 2019-11-13 15:20  随—风  阅读(1180)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3