Android Studio v1.0 项目无法运行
16lz
2021-01-23
运行项目时出现如下错误:
Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
D:\WorkBook\iflytek\android\Android\sdk\build-tools\21.1.1\dx.bat --dex --no-optimize --output D:\Androidspace\Helloworld\app\build\intermediates\dex\debug --input-list=D:\Androidspace\Helloworld\app\build\intermediates\tmp\dex\debug\inputList.txt
Error Code:
1
Output:
系统找不到指定的路径。
解决方案如下:
找到安装根目录下find_java.bat文件
D:\WorkBook\iflytek\android\Android\sdk\tools\lib\find_java.bat
编辑文件27行处的代码:
In line 27 of tools/lib/find_java.bat has a problem:
find /i "x86" > NUL && set arch_ext=32 || set arch_ext=64
删除||符号前的空格,程序执行通过:
You must remove space after "arch_ext=32". Correct code is:
find /i "x86" > NUL && set arch_ext=32|| set arch_ext=64
解决方案原因不明,当前项目虽不报错,但无法通过模拟器运行,真机调试正常,如果有知道如何在模拟器上成功运行的朋友,请指点一下。
Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
D:\WorkBook\iflytek\android\Android\sdk\build-tools\21.1.1\dx.bat --dex --no-optimize --output D:\Androidspace\Helloworld\app\build\intermediates\dex\debug --input-list=D:\Androidspace\Helloworld\app\build\intermediates\tmp\dex\debug\inputList.txt
Error Code:
1
Output:
系统找不到指定的路径。
解决方案如下:
找到安装根目录下find_java.bat文件
D:\WorkBook\iflytek\android\Android\sdk\tools\lib\find_java.bat
编辑文件27行处的代码:
In line 27 of tools/lib/find_java.bat has a problem:
find /i "x86" > NUL && set arch_ext=32 || set arch_ext=64
删除||符号前的空格,程序执行通过:
You must remove space after "arch_ext=32". Correct code is:
find /i "x86" > NUL && set arch_ext=32|| set arch_ext=64
解决方案原因不明,当前项目虽不报错,但无法通过模拟器运行,真机调试正常,如果有知道如何在模拟器上成功运行的朋友,请指点一下。
更多相关文章
- 在sd卡存储文件
- Received status code 400 from server: Bad Request解决方案
- Android横竖屏切换解决方案
- 读取raw文件下文件内容
- 关于Android启动页全屏的解决方案
- 安卓Android大量项目源码实例
- 基于Android的音乐播放器项目
- android intent.setType指定浏览本地多种类型的文件