How to Fix Exception java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider

Hey,
If you’re using Firebase Cloud Messaging (FCM) and your minimum API level is 19, you will face this exception in 4.4.2 +.

Step 1 : Dependencies

First of all, we need to add to our build. Gradle file
// Multidex
compile 'com.android.support:multidex:1.0.1'

Step 2: MultiDexEnabled

Add multiDexEnabled true in our build.gradle’s android part
defaultConfig {
    multiDexEnabled true
}

Step 3: BaseApplication Part

Override attachBaseContext function and install our MultiDex
public class BaseApplication extends Application {
    
    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this);
    }

}
Important Note: DO NOT forget to install MultiDex in attachBaseContext!
After all these parts are done, you’re good to go!
If you have any question, ask me :)

How to extract filename from Uri?

Now, we can extract filename with and without extension :) You will convert your bitmap to uri and get the real path of your file. Now w...