Unable to get provider androidx.lifecycle.ProcessLifecycleOwnerInitializr

Unable to get provider androidx.lifecycle.ProcessLifecycleOwnerInitializr

Getting error while running app which have dependencies 'androidx.lifecycle:lifecycle-extensions:2.1.0-alpha03' and 'androidx.lifecycle:lifecycle-viewmodel:2.1.0-alpha03' on device with Android 4.4.

Works fine in device with Android 6

App getting crashed with error

java.lang.RuntimeException: Unable to get provider androidx.lifecycle.ProcessLifecycleOwnerInitializer: java.lang.ClassNotFoundException: Didn't find class "androidx.lifecycle.ProcessLifecycleOwnerInitializer" on path: DexPathList[[zip file "/data/app/**********.apk"],nativeLibraryDirectories=[/data/app-lib/***********, /vendor/lib, /system/lib]]
    at android.app.ActivityThread.installProvider(ActivityThread.java:5052)
    at android.app.ActivityThread.installContentProviders(ActivityThread.java:4623)
    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4563)
    at android.app.ActivityThread.access$1500(ActivityThread.java:151)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1402)
    at android.os.Handler.dispatchMessage(Handler.java:110)
    at android.os.Looper.loop(Looper.java:193)
    at android.app.ActivityThread.main(ActivityThread.java:5333)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:824)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)
    at dalvik.system.NativeStart.main(Native Method)
 Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.lifecycle.ProcessLifecycleOwnerInitializer" on path: DexPathList[[zip file "/data/app/**********.apk"],nativeLibraryDirectories=[/data/app-lib/********, /vendor/lib, /system/lib]]

Thanks Andrews Alves

From post

It was a Dex problem. in android 4.4

1 - in app gradle, inside defaultConfig enable multidex

defaultConfig{
  ....
  multiDexEnabled true
}

2 - to support multidex in other versions, add this dependency to your app gradle

implementation 'com.android.support:multidex:1.0.3' 

3 - if you have a class that extends Application, make it extend

MultiDexApplication

if you don't, add this to your manifest file inside application tag

android:name="android.support.multidex.MultiDexApplication" 

Besides, if you created a new application, dont forget to add the following to your app/build.gradle

android {
    defaultConfig {
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

that's it. worked for me

Error: ProcessLifecycleOwnerInitializer on Android · Issue #13586 , Unable to get provider androidx.lifecycle.ProcessLifecycleOwnerInitializr. Getting error while running app which have dependencies  Unable to get provider com.crashlytics.android.CrashlyticsInitProvider java.lang.ClassNotFoundException 0 Didn't find class “com.google.firebase.provider.FirebaseInitProvider, While upgrading the apk from eclipse with studio build


In my case, Somehow android architecture lifecycle files getting omitted with Android bundle on Pie(Android9). So what I did was added keep statement for the same in proguard-rules.pro

For AndroidX :

-keep class androidx.lifecycle.** {*;}

For Support :

-keep class android.arch.lifecycle.** {*;}

Didnt find class androidx.lifecycle.ProcessLifecycleOwnerInitializer , androidx.lifecycle.ProcessLifecycleOwnerInitializr с ошибкой java.lang.​RuntimeException: Unable to get provider androidx.lifecycle. WARNING: Unable to download the list of available providers. Check your internet connection. PackageManagement\Install-PackageProvider : No match was found for the specified search criteria for the provider 'NuGet'. The package provider requires 'PackageManagement' and 'Provider' tags. Please check if the specified package. has the tags.


You can find the official docs about Multidex here. Use this link to check the latest multidex gradle dependency version.

if you're using AndroidX

dependencies {
    def multidex_version = "2.0.1" // Check this from the link
    implementation 'androidx.multidex:multidex:$multidex_version'
}

otherwise use

dependencies {
  implementation 'com.android.support:multidex:1.0.3'
}

Android Studio 2.3 not working with instant run: debug apk crash , Migrated to Jetpack via Android Studio, trying to run app but keep on getting the Unable to get provider androidx.lifecycle.ProcessLifecycleOwnerInitializr. Stack Overflow Public questions and answers; Teams Private questions and answers for your team; Enterprise Private self-hosted questions and answers for your enterprise; Jobs Programming and related technical career opportunities


For kotlin add this to your gradle :

kotlinOptions {
        jvmTarget = '1.8'
}
compileOptions {
        targetCompatibility = "8"
        sourceCompatibility = "8"
}

android: Невозможно получить поставщика androidx.lifecycle , The Get-PSProvider cmdlet gets the PowerShell providers in the current session. You can get a particular drive or all drives in the session. PowerShell providers let you access a variety of data stores as though they were file system drives. For information about PowerShell providers, see about_Providers.


Newest 'androidx' Questions - Page 30, Connect-MsolService : Unable to authenticate your credentials. Make sure that your user name is in the format: <username>@<domain>. If this issue persists,


WARNING: Unable to download the list of available providers. Check your internet connection. PackageManagement\Get-PackageProvider : Unable to find package provider ‘NuGet’.


Install-PackageProvider : No match was found for the specified search criteria for the provider 'ContainerImage'. The package provider requires 'PackageManagement' and 'Provider' tags. Please check if the specified package has the tags. I am behind a proxy.