0

I am getting an error related to Firebase.

java.lang.NoClassDefFoundError: com.google.android.gms.internal.zzno
 at com.google.android.gms.measurement.internal.zzx.zzj(Unknown Source)
 at com.google.android.gms.measurement.internal.zzt.<init>(Unknown Source)
 at com.google.android.gms.measurement.internal.zzx.zzBQ(Unknown Source)
 at com.google.android.gms.measurement.internal.zzt.zzaU(Unknown Source)
 at com.google.android.gms.measurement.AppMeasurementContentProvider.onCreate(Unknown Source)
 at android.content.ContentProvider.attachInfo(ContentProvider.java:1591)
 at android.content.ContentProvider.attachInfo(ContentProvider.java:1562)
 at android.app.ActivityThread.installProvider(ActivityThread.java:4825)
 at android.app.ActivityThread.installContentProviders(ActivityThread.java:4420)
 at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4360)
 at android.app.ActivityThread.access$1500(ActivityThread.java:141)
 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1272)
 at android.os.Handler.dispatchMessage(Handler.java:102)
 at android.os.Looper.loop(Looper.java:136)
 at android.app.ActivityThread.main(ActivityThread.java:5052)
 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:796)
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:612)
 at dalvik.system.NativeStart.main(Native Method)

I am not understanding what type of issue is this

Gradle

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"
    compileOptions.encoding = 'ISO-8859-1'
    useLibrary 'org.apache.http.legacy'

    defaultConfig {
        applicationId "com.xxxx.xxx"
        minSdkVersion 14
        targetSdkVersion 23
        multiDexEnabled true
    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles 'proguard.cfg'
        }
    }
    dexOptions {
        javaMaxHeapSize "4g"
    }
     }

    dependencies {
    compile project(':library')
    compile project(':wheel')
    compile project(':socialauthandroid')
    compile project(':ambilWarna')  
    compile 'com.google.android.gms:play-services:8.3.0'
    compile files('libs/acra-4.5.0.jar')
    compile files('libs/FlurryAgent.jar')
    compile files('libs/poi-3.9.jar')
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile files('libs/gcm.jar')
    compile 'com.android.support:multidex:1.0.0'
    }

How can I resolve this?

halfer
  • 19,824
  • 17
  • 99
  • 186
Binil Surendran
  • 2,524
  • 6
  • 35
  • 58
  • Crash is happening in devices below 5(api 21) ?In that case check this. http://stackoverflow.com/a/38887728/3111083 .You have to install the multidex. – Sunil Sunny Sep 08 '16 at 05:11
  • `compile 'com.google.android.gms:play-services:8.4.0'` – IntelliJ Amiya Sep 08 '16 at 05:16
  • 1
    okay .what is `compile files('libs/gcm.jar')` ?? related to `com.google.android.gms:play-services`??? – IntelliJ Amiya Sep 08 '16 at 05:17
  • @Binil Surendran, Check this SO [answer](http://stackoverflow.com/a/33162131/5180017). Using `compile 'com.google.android.gms:play-services:8.3.0'` might be the problem. – Shashanth Sep 08 '16 at 05:25
  • did you overcome from this problem ?? – IntelliJ Amiya Sep 09 '16 at 05:20
  • 1
    Yes, I just add compile 'com.google.firebase:firebase-ads:9.0.2' compile 'com.google.android.gms:play-services-analytics:9.0.2' instead of "compile 'com.google.android.gms:play-services:+'" in the gradle folder. Then the problem is solved @IntelliJ Amiya – Binil Surendran Sep 09 '16 at 06:44

1 Answers1

2

NoClassDefFoundError

NoClassDefFoundError comes when Java Virtual Machine is not able to find a particular class at runtime which was available at compile time.

Your Logcat throws

java.lang.NoClassDefFoundError: com.google.android.gms.internal.zzno

I guess, problem in your compile 'play-services:8.3.0' section

You can use

compile 'com.google.android.gms:play-services:8.4.0' /or 7.8.0 

Then Clean-Rebuild-Restart-Gradle your Project .

Confusion

What is compile files('libs/gcm.jar') ? It's related to com.google ?

You may visit Android: java.lang.NoClassDefFoundError for better answer .

Community
  • 1
  • 1
IntelliJ Amiya
  • 74,896
  • 15
  • 165
  • 198