ADB PUSH 文件异常 - input is not valid Modified UTF-8: illegal continuation byte 0

场景: 笔者在使用ADB命令推送docx文件到手机指定文件夹下,点开手机查看无异常,但使用简单的代码,程序直接闪退,起初笔者怀疑是中文路径的问题,但不是,真正的原因ADB环境不支持中文造成的。

File file = new File("文件路径");
if(file.Directory()){}//异常行
// ADB命令行操作
C:\Users\Administrator>adb push C:\Users\Administrator\Desktop\library\功能设计描述20171226.docx /storage/emulated/0/piopic/docx/功能设计描述20171226.
docx
C:\Users\Administrator\Desktop\library\功能设计描述20171226.docx: 1 file pushed. 10.0 MB/s (911508 bytes in 0.087s)


//手机异常堆栈
JNI DETECTED ERROR IN APPLICATION: input is not valid Modified UTF-8: illegal continuation byte 0
01-09 17:33:16.498 16673-16673/com.example.readpoi A/art: art/runtime/runtime.cc:431]     string: '功能设�'
01-09 17:33:16.498 16673-16673/com.example.readpoi A/art: art/runtime/runtime.cc:431]     input: '0xe5 0x8a 0x9f 0xe8 0x83 0xbd 0xe8 0xae 0xbe 0xe8'
01-09 17:33:16.498 16673-16673/com.example.readpoi A/art: art/runtime/runtime.cc:431]     in call to NewStringUTF
01-09 17:33:16.498 16673-16673/com.example.readpoi A/art: art/runtime/runtime.cc:431]     from java.lang.String[] java.io.UnixFileSystem.list0(java.io.File)

原因:
ADB push 之后出现该BUG   

解决:
https://blog.csdn.net/lixiaodaoaaa/article/details/9770405

临时解决:
电脑打开手机指定目录 直接复制粘贴文件过去
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值