rollbar-java icon indicating copy to clipboard operation
rollbar-java copied to clipboard

Crash: Could not create folder .../cache/rollbar-items

Open malua opened this issue 2 years ago • 2 comments

Hey, do you maybe have an idea, why our apps are crashing?

Exception java.lang.RuntimeException: Unable to create application com.xxx.app.CustomApplicationClass: java.lang.RuntimeException: Could not create folder: /data/user/0/com.xxx.app/cache/rollbar-items
  at android.app.ActivityThread.handleBindApplication (ActivityThread.java:6810)
  at android.app.ActivityThread.-$$Nest$mhandleBindApplication
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2132)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loopOnce (Looper.java:201)
  at android.os.Looper.loop (Looper.java:288)
  at android.app.ActivityThread.main (ActivityThread.java:7918)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:548)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:936)
Caused by java.lang.RuntimeException: Could not create folder: /data/user/0/com.xxx.app/cache/rollbar-items
  at com.rollbar.notifier.sender.queue.DiskQueue.<init> (DiskQueue.java:46)
  at com.rollbar.notifier.sender.queue.DiskQueue.<init> (DiskQueue.java:24)
  at com.rollbar.notifier.sender.queue.DiskQueue$Builder.build (DiskQueue.java:213)
  at com.rollbar.android.Rollbar.<init> (Rollbar.java:357)
  at com.rollbar.android.Rollbar.init (Rollbar.java:162)
  at com.rollbar.android.Rollbar.init (Rollbar.java:138)
  at com.rollbar.android.Rollbar.init (Rollbar.java:123)
  at com.rollbar.android.Rollbar.init (Rollbar.java:109)
  at com.rollbar.android.Rollbar.init (Rollbar.java:82)
  at com.xxx.app.CustomApplicationClass.onCreate (CustomApplicationClass.java:18)
  at android.app.Instrumentation.callApplicationOnCreate (Instrumentation.java:1277)
  at android.app.ActivityThread.handleBindApplication (ActivityThread.java:6805)

It seems that it crashes when I initialize Rollbar in my CustomApplicationClass:

public class CustomApplicationClass extends MultiDexApplication {

  @Override
  public void onCreate() {
    // Rollbar initialization
    Rollbar.init(this, getResources().getString(R.string.rollbar_access_token), getResources().getString(R.string.rollbar_environment));

 
    super.onCreate();
  }

  @Override
  protected void attachBaseContext(Context base) {
    super.attachBaseContext(base);
    MultiDex.install(this);
  }
}

malua avatar Sep 04 '23 08:09 malua

hi @malua ! I was trying to reproduce the error but so far I couldn't, could you share more information with me? like, are you testing it on an emulator or a device? with what api? Did you try the example app and it also produced this error?

buongarzoni avatar Jun 10 '24 03:06 buongarzoni

This happened a lot in our production apps. I removed the rollbar sdk from android, when I created the issue. But I could not reproduce it locally. I thought you can maybe do more with the error message than me.

malua avatar Jun 11 '24 07:06 malua