quickstart-android: App crashing in 4.4.4 and Working fine in 6.0.1

Step 2: Describe your environment

  • Android device: Moto
  • Android OS version: 4.4.4
  • Google Play Services version: _____
  • Firebase/Play Services SDK version:
    compile 'com.google.firebase:firebase-messaging:9.4.0'
    compile 'com.google.android.gms:play-services:9.4.0'
    compile 'com.google.firebase:firebase-core:9.4.0'
    compile 'com.google.firebase:firebase-crash:9.4.0'

Step 3: Describe the problem:

App working fine in 6.0.1 but app crashing in 4.4.4

Steps to reproduce:

While open the app it crashing




Observed Results:

java.lang.NoClassDefFoundError: com.google.firebase.FirebaseOptions at com.google.firebase.FirebaseApp.zzek(Unknown Source) at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source) at android.content.ContentProvider.attachInfo(ContentProvider.java:1591) at android.content.ContentProvider.attachInfo(ContentProvider.java:1562) at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source) at android.app.ActivityThread.installProvider(ActivityThread.java:4855) at android.app.ActivityThread.installContentProviders(ActivityThread.java:4450) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4390) at android.app.ActivityThread.access$1500(ActivityThread.java:139) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1270) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5086) 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:785) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) at dalvik.system.NativeStart.main(Native Method)

Expected Results:

  • What did you expect to happen?

It should not crash the app

Relevant Code:

Google play store link:

  https://play.google.com/store/apps/details?id=com.app.bfonics.smartcity&hl=en

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 22 (4 by maintainers)

Most upvoted comments

here is solution for kitkat

1: Go to the gradle enable multiDexEnabled and add multidex library in the dependencies.

android { … defaultConfig { multiDexEnabled true … } }

dependencies { // add dependency compile ‘com.android.support:multidex:1.0.1’ }

2: Go to the Manifest file and write android:name=“.MyApplication” (Class name(MyApplication) is optional you can write whatever you want ).

<application
    android:name=".MyApplication"
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    .
    .
    .
    .
    .
</application>

3: As you wrote android:name=“.MyApplication” Inside Application at Manifest file. it will give you an error because you didn’t create MyApplication class. Create MyApplication Class extend it by “application” class or Simply click on.MyApplication, a small red balloon appear on the left side of a syntax click on it, you will see (create MyApplication class) in the menu, click on it and Include below Method Inside that class.

public class MyApplication extends Application {

@Override 
protected void attachBaseContext(Context base) {
    super.attachBaseContext(base);
    MultiDex.install(this);
} 

Anyone found a solution? I’m getting the same issue with android 4.2.2

E/AndroidRuntime: FATAL EXCEPTION: main java.lang.NoClassDefFoundError: com.google.android.gms.common.internal.zzbq at com.google.firebase.perf.provider.FirebasePerfProvider.attachInfo(Unknown Source) at android.app.ActivityThread.installProvider(ActivityThread.java:5097) at android.app.ActivityThread.installContentProviders(ActivityThread.java:4680) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4613) at android.app.ActivityThread.access$1300(ActivityThread.java:162) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1424) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:194) at android.app.ActivityThread.main(ActivityThread.java:5371) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600) at dalvik.system.NativeStart.main(Native Method)

Thanks mudi256. It works.great!