Android Studio 在run时报的异常 Failed to run command file not found FileNotFoundException
来源:互联网 发布:最优化理论与方法 目录 编辑:程序博客网 时间:2024/05/19 23:01
Android Studio 在run时报的异常 Failed to run command file not found FileNotFoundException
在github上下载项目,导入后 有时不注意,在build完后,run时会报现个FileNotFoundException,会提示如下的错误:
Error:Execution failed for task ‘:sample:dexDebug’.
com.android.ide.common.internal.LoggedErrorException: Failed to run command:
D:\Program Files\Android\sdk\build-tools\21.1.2\dx.bat –dex –no-optimize –output D:\需要的文档\学习资料\xxx\sample\build\intermediates\dex\debug –input-list=D:\需要的文档\学习资料\xxx\sample\build\intermediates\tmp\dex\debug\inputList.txt
Error Code:
1
Output:
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: D:\闇?瑕佺殑鏂囨。\瀛︿範璧勬枡\js涓巜eb瀹夊叏浜や簰\xxx\sample\build\intermediates\classes\debug: file not found
at com.android.dex.util.FileUtils.readFile(FileUtils.java:51)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:169)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
at com.android.dx.command.dexer.Main.processOne(Main.java:632)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:510)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:280)
at com.android.dx.command.dexer.Main.run(Main.java:246)
at com.android.dx.command.dexer.Main.main(Main.java:215)
at com.android.dx.command.Main.main(Main.java:106)
UNEXPECTED TOP-LEVEL EXCEPTION:
java.io.FileNotFoundException: D:\闇?瑕佺殑鏂囨。\瀛︿範璧勬枡\js涓巜eb瀹夊叏浜や簰\xxx\sample\build\intermediates\pre-dexed\debug\classes-6bafb5ea8fc86808334b6373daacdc92babdec8a.jar (系统找不到指定的路径。)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(ZipFile.java:220)
at java.util.zip.ZipFile.(ZipFile.java:150)
at java.util.zip.ZipFile.(ZipFile.java:164)
at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:244)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
at com.android.dx.command.dexer.Main.processOne(Main.java:632)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:510)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:280)
at com.android.dx.command.dexer.Main.run(Main.java:246)
at com.android.dx.command.dexer.Main.main(Main.java:215)
at com.android.dx.command.Main.main(Main.java:106)
UNEXPECTED TOP-LEVEL EXCEPTION:
java.io.FileNotFoundException: D:\闇?瑕佺殑鏂囨。\瀛︿範璧勬枡\js涓巜eb瀹夊叏浜や簰\xxx\sample\build\intermediates\pre-dexed\debug\gson-2.3-317f284ee257b9e36af74bb2d07d373f5b8009da.jar (系统找不到指定的路径。)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(ZipFile.java:220)
at java.util.zip.ZipFile.(ZipFile.java:150)
at java.util.zip.ZipFile.(ZipFile.java:164)
at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:244)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
at com.android.dx.command.dexer.Main.processOne(Main.java:632)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:510)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:280)
at com.android.dx.command.dexer.Main.run(Main.java:246)
at com.android.dx.command.dexer.Main.main(Main.java:215)
at com.android.dx.command.Main.main(Main.java:106)
3 errors; aborting
上面在run时报的异常 Failed to run command file not found,文件居然找不到(FileNotFoundException),,找不到啊。。。
而路径中有乱码了,应该可能是中文乱码的问题。
将project 空间路径转成 英文的,果然发现OK。。
结论:在Android studio中project 工作空间路径不要含有中文,否则很容易会报FileNotFoundException. 这点eclipse是支持中文的。
- Android Studio 在run时报的异常 Failed to run command file not found FileNotFoundException
- weex run android时报错:Environment variable $ANDROID_HOME not found !
- AS中一个报错解决:LoggedErrorException: Failed to run command初用Android Studio注意
- 关于小米4c 在使用Android Studio Run的时候 Installation failed with message Failed to establish session
- nohup failed to run command, permisson denied
- Android Studio ,Run Configuration Error:Default Activity not found
- nohup: failed to run command `java': No such file or directory
- 解决问题:Android Studio Run时,APP安装失败--Installation failed with message Failed to establish session.
- file not found: linker command failed with exit code 1 (use -v to see invocation)
- eclipse 里写c/c++,run的时候launch failed binary not found
- Android异常总结---Test run failed:Unable to find instrumentation target package
- Android单元测试异常总结---Test run failed:Unable to find instrumentation target package
- is not found. Have you run APT to generate them?
- 解决: is not found. Have you run APT to generate
- eclipse 运行Android程序时run as 时报Conversion to Dalvik format failed with error 1错误
- bash: use: command not found (error occurred this command run in Terminal: # use mysql )
- Web Service进阶(六)SOAPBinding绑定方式异常 is not found. Have you run APT to generate them
- react-native run-android Android project not found
- Linux下获取帮助
- Linux权限机制
- [IOS]CoreAnimation动画效果示例
- Linux网络基础配置
- Linux多命令协作:管道及重定向
- Android Studio 在run时报的异常 Failed to run command file not found FileNotFoundException
- Cookie机制详解
- 3)Win10-UWA开发 API参考 - 2
- Perl用CPAN安装模块时错误
- 读书笔记之计算机系统(10)
- Hibernate关系映射--双向一对多@OnToMany
- String与InputStream相互转换
- busybox文件系统制作
- 数据结构复习之二叉树:遍历、搜索节点&路径、查找、与单链表互转、逐层打印