开发者

Unable to cd do sdcard with adb after update to Froyo

开发者 https://www.devze.com 2023-01-14 19:46 出处:网络
My application takes a picture and saves to the sdcard.It worked fine on Android 2.1, but I just upgraded to Froyo and now I\'m getting:

My application takes a picture and saves to the sdcard. It worked fine on Android 2.1, but I just upgraded to Froyo and now I'm getting:

ERROR/CameraPreview(28216): Problem taking picture
WARN/System.err(28216): java.io.FileNotFoundException: /mnt/sdcard/silviaterra/temp.jpg (Permission denied)
WARN/System.err(28216):     at org.ap开发者_开发知识库ache.harmony.luni.platform.OSFileSystem.openImpl(Native Method)
WARN/System.err(28216):     at org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java:152)
WARN/System.err(28216):     at java.io.FileOutputStream.<init>(FileOutputStream.java:97)
WARN/System.err(28216):     at java.io.FileOutputStream.<init>(FileOutputStream.java:69)

When I open up adb shell (as root user), I get:

$ cd sdcard
cd: can't cd to sdcard
$ cd mnt/sdcard
cd: can't cd to mnt/sdcard

I've tried killing and restarting the adb server, but no luck. Any ideas on what's going on? Thanks!


Ok - this one was a bit tricky. Turns out that my "USB Connection Type" was "Disk drive", and so even though I had unmounted the sdcard from Ubuntu, I guess there was still a lock in place. The trick is to just switch back to "Charge Only"

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号