安装delphi xe10 Seattle 后,安卓开发环境总是配置不好,运行安卓空项目,出现如下错误提示:
错误详细内容如下:===========================================================================================
[Exec Error] The command "PATH C:/PRogram Files/java/jdk1.7.0_71/bin;C:/Users/Public/Documents/Embarcadero/InterBase/redist/InterBaseXE7/IDE_spoof;d:/Program Files (x86)/Embarcadero/Studio/17.0/bin;C:/Users/Public/Documents/Embarcadero/Studio/17.0/Bpl;d:/Program Files (x86)/Embarcadero/Studio/17.0/bin64;C:/Users/Public/Documents/Embarcadero/Studio/17.0/Bpl/Win64;C:/Inprise/vbroker/bin;C:/Windows/system32;C:/Windows;C:/Windows/System32/Wbem;C:/Windows/System32/WindowsPowerShell/v1.0/;C:/Program Files/Intel/WiFi/bin/;C:/Program Files/Common Files/Intel/WirelessCommon/;C:/Program Files (x86)/AMD/ATI.ACE/Core-Static;C:/Program Files (x86)/Borland/Delphi6/Bin;C:/Program Files (x86)/Borland/Delphi6/Projects/Bpl;D:/Program Files (x86)/Microsoft SQL Server/100/Tools/Binn/;D:/Program Files/Microsoft SQL Server/100/Tools/Binn/;D:/Program Files/Microsoft SQL Server/100/DTS/Binn/;D:/Program Files (x86)/Microsoft SQL Server/100/Tools/Binn/VSShell/Common7/IDE/;D:/Program Files (x86)/Microsoft SQL Server/100/DTS/Binn/;C:/Program Files (x86)/Windows Kits/8.1/Windows Performance Toolkit/;C:/Program Files/Microsoft SQL Server/110/Tools/Binn/;C:/Program Files/Microsoft/Web Platform Installer/;C:/Program Files (x86)/Microsoft SDKs/TypeScript/1.0/;C:/Program Files/Microsoft SQL Server/120/Tools/Binn/;C:/Program Files/TortoiseSVN/bin;C:/Program Files/Intel/WiFi/bin/;C:/Program Files/Common Files/Intel/WirelessCommon/;C:/Program Files (x86)/Microsoft VS Code/bin & "D:/Program Files (x86)/Embarcadero/Studio/17.0/PlatformSDKs/android-sdk-windows/build-tools/24.0.3/dx.bat" --dex --output="C:/Users/Administrator/Documents/Embarcadero/Studio/Projects/Android/Debug/classes.dex" "d:/program files (x86)/embarcadero/studio/17.0/lib/Android/Debug/android-support-v4.dex.jar" "d:/program files (x86)/embarcadero/studio/17.0/lib/Android/Debug/apk-expansion.dex.jar" "d:/program files (x86)/embarcadero/studio/17.0/lib/Android/Debug/cloud-messaging.dex.jar" "d:/program files (x86)/embarcadero/studio/17.0/lib/Android/Debug/fmx.dex.jar" "d:/program files (x86)/embarcadero/studio/17.0/lib/Android/Debug/google-analytics-v2.dex.jar" "d:/program files (x86)/embarcadero/studio/17.0/lib/Android/Debug/google-play-billing.dex.jar" "d:/program files (x86)/embarcadero/studio/17.0/lib/Android/Debug/google-play-licensing.dex.jar" "d:/program files (x86)/embarcadero/studio/17.0/lib/Android/Debug/google-play-services.dex.jar" " exited with code 1.
============================================================================================
解决方法:
1、在 系统环境变量里设置 jdk变量;
a.进入环境变量的配置界面,点击新建系统变量,变量名为JAVA_HOME,变量值是java的安装路径jdk的路;
b. 添加完JAVA_HOME系统变量后,需要添加两个包文件,在系统变量中,选中classpath,点击编辑,在classpath后边添加
.;%JAVA_HOME%/lib/dt.jar;%JAVA_HOME%/lib/tools.jar;(.;一定不能少,因为它代表当前路径)
c.添加path,如果没有path,则需要新建path , path=%JAVA_HOME%/bin
2、进入delphi xe10 , 菜单 tools->options....->SDK manage
保证 SDK 、NDK、java 页面都没有黄色感叹号;(有时需要重新删除安卓版本,再重新添加,会自动匹配各项路径)
===============================================
重启系统,测试可以正常编译,生成apk.
新闻热点
疑难解答
图片精选