markzhai / markzhai/AndroidPerformanceMonitor

Log路径生成失败

Open
#119 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
6.7k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

设备:nexus 6
版本:Android 7.1.1
blockcanary版本:1.5.0

堆栈信息如下:
ava.io.FileNotFoundException: /data/storage/emulated/0/Android/data/com.test.testapm/cache/looper-2018-07-06_17-09-29.376.log (No such file or directory)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.(FileOutputStream.java:221)
at java.io.FileOutputStream.(FileOutputStream.java:140)
at com.github.moduth.blockcanary.LogWriter.save(LogWriter.java:108)
at com.github.moduth.blockcanary.LogWriter.save(LogWriter.java:56)
at com.github.moduth.blockcanary.BlockCanaryInternals$1.onBlockEvent(BlockCanaryInternals.java:63)
at com.github.moduth.blockcanary.LooperMonitor$1.run(LooperMonitor.java:80)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.os.HandlerThread.run(HandlerThread.java:61)

发现BlockCanaryInternals#getPath方法中,最后在目录前面加上了Data目录,导致目录生成失败。

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with BlockCanaryInternals#getPath and compare the generated directory with the path used by LogWriter.save at LogWriter.java:108. Reproduce the failure on the reported Android configuration if available, then verify that log creation no longer raises FileNotFoundException and that the generated path is valid.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile, performance
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.