Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/234.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 无法将文件/dbfdata/database/com.test.myapp/shared_prefs/cpShared.xml重命名为cpChared.bak_Android - Fatal编程技术网

Android 无法将文件/dbfdata/database/com.test.myapp/shared_prefs/cpShared.xml重命名为cpChared.bak

Android 无法将文件/dbfdata/database/com.test.myapp/shared_prefs/cpShared.xml重命名为cpChared.bak,android,Android,此错误的原因是什么?如何修复 Could not rename file /dbfdata/database/com.test.myapp/shared_prefs/cpShared.xml to cpChared.bak 我怀疑您使用了java.io.File.renameTo 如果是,它将失败,因为您试图写入当前目录,但您没有写入权限。为了避免这种情况,必须指定完整的目标路径:/dbfdata/database/com.test.myapp/shared_prefs/cpChared.ba

此错误的原因是什么?如何修复

Could not rename file /dbfdata/database/com.test.myapp/shared_prefs/cpShared.xml to cpChared.bak
我怀疑您使用了java.io.File.renameTo

如果是,它将失败,因为您试图写入当前目录,但您没有写入权限。为了避免这种情况,必须指定完整的目标路径:/dbfdata/database/com.test.myapp/shared_prefs/cpChared.bak