错误:无法打开跟踪文件'/mnt/sdcard/method.trace':android 3.0中的权限被拒绝

时间:2012-01-13 05:45:37

标签: android

使用

创建跟踪文件时遇到问题
Debug.startMethodTracing("traceFile");   

我还添加了

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
清单文件中的

但是当我试图运行应用程序时,我收到此错误

01-13 10:53:32.739: D/dalvikvm(1261): +++ active profiler count now 1
01-13 10:53:32.739: I/dalvikvm(1261): TRACE STARTED: '/mnt/sdcard/traceFile.trace' 8192KB
01-13 10:53:32.739: E/dalvikvm(1261): Unable to open trace file '/mnt/sdcard/traceFile.trace': Permission denied
01-13 10:53:32.739: D/dalvikvm(1261): +++ active profiler count now 0
01-13 10:53:32.950: D/AndroidRuntime(1261): Shutting down VM
01-13 10:53:32.950: W/dalvikvm(1261): threadid=1: thread exiting with uncaught exception (group=0x40014760)
01-13 10:53:33.070: E/AndroidRuntime(1261): FATAL EXCEPTION: main
01-13 10:53:33.070: E/AndroidRuntime(1261): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.sample.internetTV/com.sample.internetTV.Internet_TV4}: java.lang.RuntimeException: Unable to open trace file '/mnt/sdcard/traceFile.trace': Permission denied
01-13 10:53:33.070: E/AndroidRuntime(1261):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1736)
01-13 10:53:33.070: E/AndroidRuntime(1261):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1752)
01-13 10:53:33.070: E/AndroidRuntime(1261):     at android.app.ActivityThread.access$1500(ActivityThread.java:123)
01-13 10:53:33.070: E/AndroidRuntime(1261):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:993)
01-13 10:53:33.070: E/AndroidRuntime(1261):     at android.os.Handler.dispatchMessage(Handler.java:99)
01-13 10:53:33.070: E/AndroidRuntime(1261):     at android.os.Looper.loop(Looper.java:126)
01-13 10:53:33.070: E/AndroidRuntime(1261):     at android.app.ActivityThread.main(ActivityThread.java:3997)
01-13 10:53:33.070: E/AndroidRuntime(1261):     at java.lang.reflect.Method.invokeNative(Native Method)
01-13 10:53:33.070: E/AndroidRuntime(1261):     at java.lang.reflect.Method.invoke(Method.java:491)
01-13 10:53:33.070: E/AndroidRuntime(1261):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
01-13 10:53:33.070: E/AndroidRuntime(1261):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
01-13 10:53:33.070: E/AndroidRuntime(1261):     at dalvik.system.NativeStart.main(Native Method)
01-13 10:53:33.070: E/AndroidRuntime(1261): Caused by: java.lang.RuntimeException: Unable to open trace file '/mnt/sdcard/traceFile.trace': Permission denied
01-13 10:53:33.070: E/AndroidRuntime(1261):     at dalvik.system.VMDebug.startMethodTracingNative(Native Method)
01-13 10:53:33.070: E/AndroidRuntime(1261):     at dalvik.system.VMDebug.startMethodTracing(VMDebug.java:175)
01-13 10:53:33.070: E/AndroidRuntime(1261):     at android.os.Debug.startMethodTracing(Debug.java:458)
01-13 10:53:33.070: E/AndroidRuntime(1261):     at android.os.Debug.startMethodTracing(Debug.java:406)
01-13 10:53:33.070: E/AndroidRuntime(1261):     at com.sample.internetTV.Internet_TV4.onCreate(Internet_TV4.java:37)
01-13 10:53:33.070: E/AndroidRuntime(1261):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
01-13 10:53:33.070: E/AndroidRuntime(1261):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1700)
01-13 10:53:33.070: E/AndroidRuntime(1261):     ... 11 more

这在Android 2.2版本中运行良好。但在Android 3.0中,我收到了错误 所以有人可以帮我解决这个问题。

先谢谢

0 个答案:

没有答案