在新项目中已开始迁移到Androidx遇到Unable to get provider androidx.lifecycle.ProcessLifecycleOwnerInitializer错误,APP在安卓4.4上面启动奔溃,记录解决办法。参考原文
在安卓4.4中,这是一个dex问题。解决办法是

1、在app.gradle中,defaultconfig内启用multidex

defaultConfig{

multiDexEnabled true
}

2、在gradle中添加 multidex依赖

implementation ‘com.android.support:multidex:1.0.3’

3、如你创建了Application类,不能继承自Application 需要继承MultiDexApplication。相反,在清单文件中添加标记

<application        android:name="android.support.multidex.MultiDexApplication"         android:allowBackup="true"        android:icon="@mipmap/ic_launcher"        android:label="@string/app_name"        android:roundIcon="@mipmap/ic_launcher_round"        android:theme="@style/AppTheme.Launcher"        android:supportsRtl="true">

更多相关文章

  1. Android(安卓)Studio 点击按钮跳转新界面
  2. Android(安卓)添加动画的标签栏
  3. android 4.4 沉浸式状态栏实现
  4. 【Java】从内部类中访问变量,需要声明为final
  5. Android(安卓)Studio 3.0+添加ButterKnife依赖报错的解决办法
  6. android 关于使用retrofit2.0的一些问题
  7. Android(安卓)Studio配置AspectJ(使用jar包的方法)
  8. GridView添加网格线
  9. Android上使用camera拍照,把获取的照片上传到远程服务器

随机推荐

  1. android 工具类2
  2. Android(安卓)JSON 解析
  3. Android轻量级JSON操作类
  4. Android(安卓)图片转成String保存
  5. android 入门demo 解析xml
  6. Android脑图
  7. Android之SQLLite
  8. android targetSdkVersion / alertdialog
  9. android 上中文排序
  10. 【有图】android通过jdbc连接mysql(附文件