3

I added LeakCanary in My Application. Here is my Application Class

public class GlobalClass extends Application{

    private RefWatcher refWatcher;
    @Override public void onCreate() {
        super.onCreate();
        Log.w("Trendy", "LeakCanary Installation");
        refWatcher = LeakCanary.install(this);
    }

    public static RefWatcher getRefWatcher(Context context) {
        GlobalClass application = (GlobalClass) context.getApplicationContext();
        return application.refWatcher;
    }
}

But at startup it says

D/LeakCanary: Could not attempt cleanup, leak storage not writable.

I have already give External Read/Write rights to my application

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

Please help me to understand what I am doing wrong here.

Alex
  • 1,406
  • 2
  • 18
  • 33
  • If you're on Android 6+ you have to request the permission: https://developers.google.com/android/guides/permissions – Tom Sabel Apr 07 '16 at 12:24
  • @Exaqt Which permission, I have already requested permission for READ_EXTERNAL_STORAGE/WRITE_EXTERNAL_STORAGE – Alex Apr 07 '16 at 12:26
  • Did you request the permission on runtime? See http://stackoverflow.com/questions/31351236/stuck-at-dumping-memory-app-will-freeze-brrr-message – Tom Sabel Apr 07 '16 at 12:27
  • @Alex did u fix this issue? – Tirolel Apr 27 '16 at 08:25
  • if any one still having same issue check this link https://github.com/square/leakcanary/issues/489 – Irfan Feb 28 '18 at 05:57

0 Answers0