0

Hi in the below code I am facing the issue to build the app in tab .

below are the points I was followed to resolving the issue.

Still I am facing the same issue.

can any one explain me where I:

  • Created One class named as BaseApplication that extends to Application.

  • In build.gradle file added this

implementation 'com.android.support:multidex:1.0.1'
java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.provider.FirebaseInitProvider" on path: DexPathList[[zip file "/data/app/com.havells.geyser-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.havells.geyser-1, /vendor/lib, /system/lib]]
            at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
            at android.app.ActivityThread.installProvider(ActivityThread.java:5003)
            at android.app.ActivityThread.installContentProviders(ActivityThread.java:4589) 
            at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4522) 
            at android.app.ActivityThread.access$1500(ActivityThread.java:151) 
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1381) 
            at android.os.Handler.dispatchMessage(Handler.java:110) 
            at android.os.Looper.loop(Looper.java:193) 
            at android.app.ActivityThread.main(ActivityThread.java:5299) 
            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:825) 
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:641) 
            at dalvik.system.NativeStart.main(Native Method)

build.gradle:

defaultConfig {
        applicationId "com.abc.example"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 11
        multiDexEnabled true
        versionName "2.00"
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
            release {
                minifyEnabled false
                shrinkResources false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
                multiDexKeepFile file('multidex-config.txt')

            }
        }

Manifest:

<application xmlns:tools="http://schemas.android.com/tools"
        android:name="com.abc.example">
Wilson Sim
  • 513
  • 1
  • 5
  • 15

1 Answers1

0

In order to enable multidex in your app, your have to set multiDexEnabled to true in your main module's build.gradle:

android {
    defaultConfig {
        //...
        multiDexEnabled true
    }
}

And I suggest you use the lastest version of the multidex lib:

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

Also, your BaseApplication class should extend android.support.multidex.MultiDexApplication

public class BaseApplication extends MultiDexApplication {
   //...
}
matdev
  • 4,115
  • 6
  • 35
  • 56
  • Have you tried to "Declare classes required in the primary DEX file" as explained here: https://stackoverflow.com/a/39831657/2068732 – matdev Aug 08 '19 at 09:36