6. Error opening trace file: Permission denied ;No such file or directory
今天运行demo时,出来一大串有关于这个的提示
<code class="hljs vhdl has-numbering"><span class="hljs-number">07</span>-<span class="hljs-number">23</span> <span class="hljs-number">03</span>:<span class="hljs-number">27</span>:<span class="hljs-number">36.102</span> <span class="hljs-number">3718</span>-<span class="hljs-number">3718</span>/? E/cutils-trace: Error opening trace <span class="hljs-keyword">file</span>: Permission denied (<span class="hljs-number">13</span>) <span class="hljs-number">07</span>-<span class="hljs-number">23</span> <span class="hljs-number">03</span>:<span class="hljs-number">27</span>:<span class="hljs-number">36.194</span> <span class="hljs-number">3727</span>-<span class="hljs-number">3727</span>/? E/cutils-trace: Error opening trace <span class="hljs-keyword">file</span>: Permission denied (<span class="hljs-number">13</span>) <span class="hljs-number">07</span>-<span class="hljs-number">23</span> <span class="hljs-number">03</span>:<span class="hljs-number">27</span>:<span class="hljs-number">36.281</span> <span class="hljs-number">3727</span>-<span class="hljs-number">3727</span>/? E/memtrack: Couldn<span class="hljs-attribute">'t</span> load memtrack module (No such <span class="hljs-keyword">file</span> <span class="hljs-keyword">or</span> directory) <span class="hljs-number">07</span>-<span class="hljs-number">23</span> <span class="hljs-number">03</span>:<span class="hljs-number">27</span>:<span class="hljs-number">36.281</span> <span class="hljs-number">3727</span>-<span class="hljs-number">3727</span>/? E/android.os.Debug: failed <span class="hljs-keyword">to</span> load memtrack module: -<span class="hljs-number">2</span> <span class="hljs-number">07</span>-<span class="hljs-number">23</span> <span class="hljs-number">03</span>:<span class="hljs-number">27</span>:<span class="hljs-number">36.281</span> <span class="hljs-number">3718</span>-<span class="hljs-number">3718</span>/? E/memtrack: Couldn<span class="hljs-attribute">'t</span> load memtrack module (No such <span class="hljs-keyword">file</span> <span class="hljs-keyword">or</span> directory) <span class="hljs-number">07</span>-<span class="hljs-number">23</span> <span class="hljs-number">03</span>:<span class="hljs-number">27</span>:<span class="hljs-number">36.281</span> <span class="hljs-number">3718</span>-<span class="hljs-number">3718</span>/? E/android.os.Debug: failed <span class="hljs-keyword">to</span> load memtrack module: -<span class="hljs-number">2</span> <span class="hljs-number">07</span>-<span class="hljs-number">23</span> <span class="hljs-number">03</span>:<span class="hljs-number">27</span>:<span class="hljs-number">37.058</span> <span class="hljs-number">2395</span>-<span class="hljs-number">3745</span>/? E/ActivityThread: Failed <span class="hljs-keyword">to</span> find provider info <span class="hljs-keyword">for</span> com.google.android.wearable.settings</code><ul style="" class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li></ul>
类似于这样,谷歌后发现了我的错误,主要先看看这句话:
1.
Error opening trace file: Permission denied
对于它的解释是:”错误打开跟踪文件“是一个在错误报告系统中的一个琐碎的配置问题,但错误报告系统只试图运行时,一些其他故障导致程序崩溃。解决的办法是确定从线跟随这个消息在LogCat中真正的问题,并纠正。而后半句“权限拒绝”从这里找到突破口。我肯定是缺少了某些权限。我加了这个之后就好了
<code class="hljs xml has-numbering">(有关于SD卡读写的权限) <span class="hljs-tag"><<span class="hljs-title">uses-permission</span> <span class="hljs-attribute">android:name</span>=<span class="hljs-value">"android.permission.WRITE_EXTERNAL_STORAGE"</span> /></span></code><ul style="" class="pre-numbering"><li>1</li><li>2</li></ul>
另一个博客主关于 Error opening trace file: Permission denied的分析
2.
再介绍一个错误
error opening trace file: No such file or directory (2)
这是因为你没有在你的计算机上安装相应的minSdkVersion或targetSdkVersion。比如你在你的 Manifest.xml有:
<code class="hljs avrasm has-numbering"><uses-sdk <span class="hljs-label">android:</span>minSdkVersion=<span class="hljs-string">"8"</span> <span class="hljs-label">android:</span>targetSdkVersion=<span class="hljs-string">"17"</span> /></code><ul style="" class="pre-numbering"><li>1</li><li>2</li><li>3</li></ul>