Skip to content

Instantly share code, notes, and snippets.

@nitinstp23
Last active October 8, 2015 09:14
Show Gist options
  • Save nitinstp23/4c9ae8071e6c3f4844b9 to your computer and use it in GitHub Desktop.
Save nitinstp23/4c9ae8071e6c3f4844b9 to your computer and use it in GitHub Desktop.
Branch SDK error info

If we extend our MobMerryApplication Class to BranchApp, then we get this error.

Build works properly if we extend our MobMerryApplication Class to Application (or MultiDexApplication).

Build.gradle:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile 'com.android.support:recyclerview-v7:23.0.1'
    compile 'com.android.support:cardview-v7:23.0.1'
    compile 'com.facebook.android:facebook-android-sdk:4.1.0'
    compile 'com.android.support:design:23.0.1'
    compile 'com.google.android.gms:play-services:8.1.0'
    compile 'com.google.code.gson:gson:2.3'
    compile 'com.mcxiaoke.volley:library:1.0.15'
    compile('com.crashlytics.sdk.android:crashlytics:2.5.2@aar') {
        transitive = true;
    }
    compile 'com.jakewharton:butterknife:6.1.0'
    debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1'
    releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1'
    compile 'io.branch.sdk.android:library:1.8.11'
    compile 'com.kontakt.sdk.android:kontakt.io-android-sdk:2.0.0'
}

Application Class:

public class MobMerryApplication extends BranchApp {

    private static MobMerryApplication instance;

    @Override
    public void onCreate() {
        super.onCreate();
        instance = this;
        Fabric.with(this, new Crashlytics());
        FacebookSdk.sdkInitialize(getApplicationContext());
        initializeDependencies();
        Branch.getAutoInstance(this);
    }


    private void initializeDependencies() {
        if (BuildConfig.DEBUG) {
            LeakCanary.install(this);
        }
        KontaktSDK.initialize(this)
                .setDebugLoggingEnabled(BuildConfig.DEBUG)
                .setLogLevelEnabled(LogLevel.DEBUG, true)
                .setCrashlyticsLoggingEnabled(true);

        Logger.setDebugLoggingEnabled(false);
        ButterKnife.setDebug(BuildConfig.DEBUG);
    }
}

Error LogCat:

10-08 14:19:36.570 21374-21374/com.Mobmerry.Mobmerry.debug E/dalvikvm: Could not find class 'com.facebook.LoggingBehavior[]', referenced from method com.facebook.FacebookSdk.<clinit>
10-08 14:19:36.640 21374-21414/com.Mobmerry.Mobmerry.debug E/GooglePlayServicesUtil: The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
10-08 14:19:36.650 21374-21414/com.Mobmerry.Mobmerry.debug E/GooglePlayServicesUtil: The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
10-08 14:19:40.600 21374-21374/com.Mobmerry.Mobmerry.debug E/CrashlyticsCore: Failed to execute task.
10-08 14:19:40.600 21374-21374/com.Mobmerry.Mobmerry.debug E/CrashlyticsCore: java.util.concurrent.TimeoutException
10-08 14:19:40.600 21374-21374/com.Mobmerry.Mobmerry.debug E/CrashlyticsCore:     at java.util.concurrent.FutureTask.get(FutureTask.java:176)
10-08 14:19:40.600 21374-21374/com.Mobmerry.Mobmerry.debug E/CrashlyticsCore:     at com.crashlytics.android.core.CrashlyticsExecutorServiceWrapper.executeSyncLoggingException(CrashlyticsExecutorServiceWrapper.java:44)
10-08 14:19:40.600 21374-21374/com.Mobmerry.Mobmerry.debug E/CrashlyticsCore:     at com.crashlytics.android.core.CrashlyticsUncaughtExceptionHandler.uncaughtException(CrashlyticsUncaughtExceptionHandler.java:275)
10-08 14:19:40.600 21374-21374/com.Mobmerry.Mobmerry.debug E/CrashlyticsCore:     at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693)
10-08 14:19:40.600 21374-21374/com.Mobmerry.Mobmerry.debug E/CrashlyticsCore:     at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)
10-08 14:19:40.600 21374-21374/com.Mobmerry.Mobmerry.debug E/CrashlyticsCore:     at dalvik.system.NativeStart.main(Native Method)
10-08 14:19:40.600 21374-21374/com.Mobmerry.Mobmerry.debug E/AndroidRuntime: FATAL EXCEPTION: main
10-08 14:19:40.600 21374-21374/com.Mobmerry.Mobmerry.debug E/AndroidRuntime: Process: com.Mobmerry.Mobmerry.debug, PID: 21374
10-08 14:19:40.600 21374-21374/com.Mobmerry.Mobmerry.debug E/AndroidRuntime: java.lang.NoClassDefFoundError: com.facebook.LoggingBehavior[]
10-08 14:19:40.600 21374-21374/com.Mobmerry.Mobmerry.debug E/AndroidRuntime:     at com.facebook.FacebookSdk.<clinit>(FacebookSdk.java:64)
10-08 14:19:40.600 21374-21374/com.Mobmerry.Mobmerry.debug E/AndroidRuntime:     at com.Mobmerry.Mobmerry.MobMerryApplication.onCreate(MobMerryApplication.java:52)
10-08 14:19:40.600 21374-21374/com.Mobmerry.Mobmerry.debug E/AndroidRuntime:     at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1013)
10-08 14:19:40.600 21374-21374/com.Mobmerry.Mobmerry.debug E/AndroidRuntime:     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4889)
10-08 14:19:40.600 21374-21374/com.Mobmerry.Mobmerry.debug E/AndroidRuntime:     at android.app.ActivityThread.access$1600(ActivityThread.java:174)
10-08 14:19:40.600 21374-21374/com.Mobmerry.Mobmerry.debug E/AndroidRuntime:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1381)
10-08 14:19:40.600 21374-21374/com.Mobmerry.Mobmerry.debug E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:102)
10-08 14:19:40.600 21374-21374/com.Mobmerry.Mobmerry.debug E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:146)
10-08 14:19:40.600 21374-21374/com.Mobmerry.Mobmerry.debug E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5752)
10-08 14:19:40.600 21374-21374/com.Mobmerry.Mobmerry.debug E/AndroidRuntime:     at java.lang.reflect.Method.invokeNative(Native Method)
10-08 14:19:40.600 21374-21374/com.Mobmerry.Mobmerry.debug E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Method.java:515)
10-08 14:19:40.600 21374-21374/com.Mobmerry.Mobmerry.debug E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
10-08 14:19:40.600 21374-21374/com.Mobmerry.Mobmerry.debug E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
10-08 14:19:40.600 21374-21374/com.Mobmerry.Mobmerry.debug E/AndroidRuntime:     at dalvik.system.NativeStart.main(Native Method)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment