我正在使用BugSense,它运行得几乎很好,包括报告错误。问题是,每当应用程序启动时,它都会抛出一些异常(看起来应用程序要崩溃(黑屏),但它没有…)
这是堆栈跟踪:
07-28 11:21:48.373: I/BugSense(16173): java.io.FileNotFoundException: /mnt/sdcard/.bugsense: open failed: ENOENT (No such file or directory)
07-28 11:21:48.373: I/BugSense(16173): at libcore.io.IoBridge.open(IoBridge.java:406)
07-28 11:21:48.373: I/BugSense(16173): at java.io.FileInputStream.<init>(FileInputStream.java:78)
07-28 11:21:48.373: I/BugSense(16173): at java.io.FileInputStream.<init>(FileInputStream.java:105)
07-28 11:21:48.373: I/BugSense(16173): at java.io.FileReader.<init>(FileReader.java:66)
07-28 11:21:48.373: I/BugSense(16173): at com.bugsense.trace.UidUtils.getCurrentUid(Unknown Source)
07-28 11:21:48.373: I/BugSense(16173): at com.bugsense.trace.UidUtils.getUid(Unknown Source)
07-28 11:21:48.373: I/BugSense(16173): at com.bugsense.trace.BugSense.sendTick(Unknown Source)
07-28 11:21:48.373: I/BugSense(16173): at com.bugsense.trace.BugSense.access$100(Unknown Source)
07-28 11:21:48.373: I/BugSense(16173): at com.bugsense.trace.BugSense$4.doInBackground(Unknown Source)
07-28 11:21:48.373: I/BugSense(16173): at android.os.AsyncTask$2.call(AsyncTask.java:264)
07-28 11:21:48.373: I/BugSense(16173): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
07-28 11:21:48.373: I/BugSense(16173): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
07-28 11:21:48.373: I/BugSense(16173): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
07-28 11:21:48.373: I/BugSense(16173): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
07-28 11:21:48.373: I/BugSense(16173): at java.lang.Thread.run(Thread.java:856)
07-28 11:21:48.373: I/BugSense(16173): Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
07-28 11:21:48.373: I/BugSense(16173): at libcore.io.Posix.open(Native Method)
07-28 11:21:48.373: I/BugSense(16173): at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
07-28 11:21:48.373: I/BugSense(16173): at libcore.io.IoBridge.open(IoBridge.java:390)
07-28 11:21:48.373: I/BugSense(16173): ... 14 more
07-28 11:21:49.718: I/BugSense(16173): Cannot write file
07-28 11:21:49.718: I/BugSense(16173): java.io.FileNotFoundException: /mnt/sdcard/.bugsense: open failed: EACCES (Permission denied)
07-28 11:21:49.718: I/BugSense(16173): at libcore.io.IoBridge.open(IoBridge.java:406)
07-28 11:21:49.718: I/BugSense(16173): at java.io.FileOutputStream.<init>(FileOutputStream.java:88)
07-28 11:21:49.718: I/BugSense(16173): at java.io.FileOutputStream.<init>(FileOutputStream.java:128)
07-28 11:21:49.718: I/BugSense(16173): at java.io.FileOutputStream.<init>(FileOutputStream.java:117)
07-28 11:21:49.718: I/BugSense(16173): at java.io.PrintWriter.<init>(PrintWriter.java:168)
07-28 11:21:49.718: I/BugSense(16173): at com.bugsense.trace.UidUtils.saveUid(Unknown Source)
07-28 11:21:49.718: I/BugSense(16173): at com.bugsense.trace.UidUtils.getUid(Unknown Source)
07-28 11:21:49.718: I/BugSense(16173): at com.bugsense.trace.BugSense.sendTick(Unknown Source)
07-28 11:21:49.718: I/BugSense(16173): at com.bugsense.trace.BugSense.access$100(Unknown Source)
07-28 11:21:49.718: I/BugSense(16173): at com.bugsense.trace.BugSense$4.doInBackground(Unknown Source)
07-28 11:21:49.718: I/BugSense(16173): at android.os.AsyncTask$2.call(AsyncTask.java:264)
07-28 11:21:49.718: I/BugSense(16173): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
07-28 11:21:49.718: I/BugSense(16173): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
07-28 11:21:49.718: I/BugSense(16173): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
07-28 11:21:49.718: I/BugSense(16173): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
07-28 11:21:49.718: I/BugSense(16173): at java.lang.Thread.run(Thread.java:856)
07-28 11:21:49.718: I/BugSense(16173): Caused by: libcore.io.ErrnoException: open failed: EACCES (Permission denied)
07-28 11:21:49.718: I/BugSense(16173): at libcore.io.Posix.open(Native Method)
07-28 11:21:49.718: I/BugSense(16173): at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
07-28 11:21:49.718: I/BugSense(16173): at libcore.io.IoBridge.open(IoBridge.java:390)
07-28 11:21:49.718: I/BugSense(16173): ... 15 more
07-28 11:21:49.773: D/BugSenseHandler(16173): Ready to send tick
07-28 11:21:50.078: D/BugSenseHandler(16173): Looking for exceptions in: /data/data/com.ronEven.blich/files
07-28 11:21:50.078: D/BugSenseHandler(16173): Found 0 stacktrace(s)
07-28 11:21:50.148: D/dalvikvm(16173): GC_FOR_ALLOC freed 187K, 4% free 8849K/9159K, paused 40ms
07-28 11:21:50.148: I/dalvikvm-heap(16173): Grow heap (frag case) to 10.113MB for 1463056-byte allocation
07-28 11:21:50.178: D/dalvikvm(16173): GC_FOR_ALLOC freed 0K, 4% free 10278K/10631K, paused 11ms
07-28 11:21:50.218: D/dalvikvm(16173): GC_CONCURRENT freed 1K, 4% free 10277K/10631K, paused 1ms+2ms
07-28 11:21:50.343: D/CLIPBOARD(16173): Hide Clipboard dialog at Starting input: finished by someone else... !
07-28 11:21:51.308: E/BugSenseHandler(16173): Transmitting analytics tick
07-28 11:21:51.308: E/BugSenseHandler(16173): javax.net.ssl.SSLPeerUnverifiedException: No peer certificate
07-28 11:21:51.308: E/BugSenseHandler(16173): at org.apache.harmony.xnet.provider.jsse.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:137)
07-28 11:21:51.308: E/BugSenseHandler(16173): at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:93)
07-28 11:21:51.308: E/BugSenseHandler(16173): at org.apache.http.conn.ssl.SSLSocketFactory.createSocket(SSLSocketFactory.java:381)
07-28 11:21:51.308: E/BugSenseHandler(16173): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:165)
07-28 11:21:51.308: E/BugSenseHandler(16173): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
07-28 11:21:51.308: E/BugSenseHandler(16173): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
07-28 11:21:51.308: E/BugSenseHandler(16173): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:360)
07-28 11:21:51.308: E/BugSenseHandler(16173): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
07-28 11:21:51.308: E/BugSenseHandler(16173): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
07-28 11:21:51.308: E/BugSenseHandler(16173): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
07-28 11:21:51.308: E/BugSenseHandler(16173): at com.bugsense.trace.BugSense.sendTick(Unknown Source)
07-28 11:21:51.308: E/BugSenseHandler(16173): at com.bugsense.trace.BugSense.access$100(Unknown Source)
07-28 11:21:51.308: E/BugSenseHandler(16173): at com.bugsense.trace.BugSense$4.doInBackground(Unknown Source)
07-28 11:21:51.308: E/BugSenseHandler(16173): at android.os.AsyncTask$2.call(AsyncTask.java:264)
07-28 11:21:51.308: E/BugSenseHandler(16173): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
07-28 11:21:51.308: E/BugSenseHandler(16173): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
07-28 11:21:51.308: E/BugSenseHandler(16173): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
07-28 11:21:51.308: E/BugSenseHandler(16173): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
07-28 11:21:51.308: E/BugSenseHandler(16173): at java.lang.Thread.run(Thread.java:856)
谢谢!
重新下载并添加jar就完成了任务。也许有时最基本、最愚蠢的解决方案效果最好。。。