qiscus / qiscus-sdk-android

Qiscus provide everything you need to power up your app with chats. And it's now made simple.
https://www.qiscus.com
Apache License 2.0
201 stars 84 forks source link

java.lang.ExceptionInInitializerError #14

Closed EdwardQuixote closed 7 years ago

EdwardQuixote commented 7 years ago

Error is encountered in built and generated signed APKs (Issue doesn't occur on debug mode or when running App from Android Studio without generating an APK) on: Qiscus.init(this, "MY_APP_ID"); Encountered problem in releases:

There's not so much documentation on this error relating to Qiscus. When above initialization line of code is commented out, issue isn't encountered. Error: 08-14 16:06:11.808 29922-29922/? E/AndroidRuntime: FATAL EXCEPTION: main Process: com.smartapplications.smartapp, PID: 29922 java.lang.ExceptionInInitializerError at com.qiscus.sdk.o.<init>(Unknown Source) at com.qiscus.sdk.a.b(Unknown Source) at com.qiscus.sdk.a.a(Unknown Source) at com.smartapplications.smartapp.SmartApp.onCreate(Unknown Source) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1018) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4994) at android.app.ActivityThread.-wrap1(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1549) at android.os.Handler.dispatchMessage(Handler.java:111) at android.os.Looper.loop(Looper.java:207) at android.app.ActivityThread.main(ActivityThread.java:5763) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679) Caused by: java.lang.RuntimeException: Missing type parameter. at com.google.a.c.a.a(Unknown Source) at com.google.a.c.a.<init>(Unknown Source) at com.google.a.l.<init>(Unknown Source) at com.google.a.k.<clinit>(Unknown Source) at com.qiscus.sdk.o.<init>(Unknown Source)  at com.qiscus.sdk.a.b(Unknown Source)  at com.qiscus.sdk.a.a(Unknown Source)  at com.smartapplications.smartapp.SmartApp.onCreate(Unknown Source)  at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1018)  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4994)  at android.app.ActivityThread.-wrap1(ActivityThread.java)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1549)  at android.os.Handler.dispatchMessage(Handler.java:111)  at android.os.Looper.loop(Looper.java:207)  at android.app.ActivityThread.main(ActivityThread.java:5763)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679) 

Attached is a text file with the log: ExceptionInInitializerError.txt

My Application Class onCreate() code:


public class SmartApp extends Application {

    public static final String TAG = SmartApp.class.getSimpleName();

    private RequestQueue mRequestQueue;
    private ImageLoader mImageLoader;

    private static SmartApp mInstance;

    @Override
    public void onCreate() {
        super.onCreate();

        Qiscus.init(this, "********"); //  APP_ID hidden

        mInstance = this;

        AppLocker.getInstance().enableAppLock(this);

        codeToEnableBootCompleteReceiver();
    }
. . . . . .
}
zetbaitsu commented 7 years ago

Are you using proguard for release version? Please add this rules https://github.com/qiscus/qiscus-sdk-android/blob/master/app/proguard-rules.pro to your proguard-rules.pro file.

EdwardQuixote commented 7 years ago

Worked. Thank you.