Skip to content

ExceptionInInitializerError when not using proguard #1189

Description

@yoppynelwanto

Hello, i'm new in using picasso, i got some error when implement picasso, the app crash when run without proguard and fine when with proguard

error in Log

E/AndroidRuntime: FATAL EXCEPTION: main
E/AndroidRuntime: java.lang.ExceptionInInitializerError
E/AndroidRuntime: at xx.xxx.gcm.MyGcmListenerService$1.run(MyGcmListenerService.java:249)
E/AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:725)
E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime: at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5039)
E/AndroidRuntime: at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
E/AndroidRuntime: at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime: Caused by: java.lang.NoClassDefFoundError: com.squareup.picasso.Picasso$1
E/AndroidRuntime: at com.squareup.picasso.Picasso.(Picasso.java:109)
E/AndroidRuntime: at ixxx.xxx.gcm.MyGcmListenerService$1.run(MyGcmListenerService.java:249) 
E/AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:725) 
E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:92) 
E/AndroidRuntime: at android.os.Looper.loop(Looper.java:137) 
E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5039) 
E/AndroidRuntime: at java.lang.reflect.Method.invokeNative(Native Method) 
E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:511) 
E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) 
E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 
E/AndroidRuntime: at dalvik.system.NativeStart.main(Native Method) 

code
the code calling picasso

Picasso.with(context).load(image_url).memoryPolicy(MemoryPolicy.NO_CACHE).into(new Target() {...

others library using in apps

compile project(':ViewPagerIndicator')
compile project(':library-android-times-square-master')
compile('io.socket:socket.io-client:0.6.1') {
exclude group: 'org.json', module: 'json'
}
compile 'com.android.support:support-v4:23.0.1'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.facebook.android:facebook-android-sdk:4.0.0'
compile 'com.google.android.gms:play-services:8.1.0'
compile 'com.google.android.gms:play-services-analytics:8.1.0'
compile 'com.android.support:cardview-v7:23.0.1'
compile 'com.android.support:recyclerview-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.google.code.gson:gson:2.3'
compile 'se.emilsjolander:stickylistheaders:2.1.5'
compile 'com.google.android.gms:play-services-ads:8.1.0'
compile 'com.google.android.gms:play-services-identity:8.1.0'
compile 'com.google.android.gms:play-services-gcm:8.1.0'

with using android default proguard plus own proguard
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-if-debug.pro'

-keepattributes Signature,SourceFile,LineNumberTable
-keepattributes Annotation
-keep class sun.misc.Unsafe { ; }
-dontwarn com.squareup.okhttp.
*
-dontwarn okio.**
-keep class com.facebook.* { ; }
-dontwarn com.viewpagerindicator.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions