Crashlytics回答用Android即时应用程序抛出错误

时间:2017-08-05 14:38:54

标签: android twitter-fabric android-instant-apps crashlytics-android

我在我的Android应用中使用Crashlytics版本2.6.8。我在回答here之后在基本功能中配置了Crashlytics。使用以下代码片段使用Fabric初始化Crashlystics

Fabric.with(context, crashlyticsKit);

Crashlytics Answers在启动Android即时应用程序时抛出此异常

E/Answers: Failed to enable events
java.io.IOException: ftruncate failed: EACCES (Permission denied)
    at java.io.RandomAccessFile.setLength(RandomAccessFile.java:630)
    at io.fabric.sdk.android.services.common.QueueFile.initialize(QueueFile.java:213)
    at io.fabric.sdk.android.services.common.QueueFile.<init>(QueueFile.java:130)
    at io.fabric.sdk.android.services.events.QueueFileEventStorage.<init>(QueueFileEventStorage.java:58)
    at io.fabric.sdk.android.services.events.GZIPQueueFileEventStorage.<init>(GZIPQueueFileEventStorage.java:32)
    at com.crashlytics.android.answers.AnswersFilesManagerProvider.getAnalyticsFilesManager(AnswersFilesManagerProvider.java:44)
    at com.crashlytics.android.answers.AnswersEventsHandler$4.run(AnswersEventsHandler.java:121)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:269)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
    at io.fabric.sdk.android.services.common.ExecutorUtils$1$1.onRun(ExecutorUtils.java:75)
    at io.fabric.sdk.android.services.common.BackgroundPriorityRunnable.run(BackgroundPriorityRunnable.java:30)
    at java.lang.Thread.run(Thread.java:818)
 Caused by: android.system.ErrnoException: ftruncate failed: EACCES (Permission denied)
    at libcore.io.Posix.ftruncate(Native Method)
    at libcore.io.BlockGuardOs.ftruncate(BlockGuardOs.java:148)
    at java.io.RandomAccessFile.setLength(RandomAccessFile.java:628)

是否是由于存储访问造成的?如果是这样,在Instant应用程序的情况下,是否可以配置Crashlytics访问存储?

1 个答案:

答案 0 :(得分:4)

您似乎没有初始化Answers本身,只有Crashlytics?

如果你想要来自Fabric的Crashlytics和Answers,请尝试这样的事情:

    final Fabric fabric = new Fabric.Builder(this)
            .kits(new Crashlytics(), new Answers())
            .debuggable(true)
            .build();
    Fabric.with(fabric);