概述
由於最近通過SDK-Manager更新了build-tools,當要用到dx.jar這個包時,自動調用最新版本Android SDK build-tools中dx.jar,但是運行android項目時Console卻提示:
解決方案
解決辦法就是:確保dx.jar這個文件在build-tools\lib和選擇的Andriod SDK Tools版本一致就可以。
我用的 Android SDk build-tools 最新版本是 28.0.3,安裝的Andriod SDK Tools版本是25.2.5,兩個版本要一致,所以我用Android SDk build-tools 25.0.3版本的dx.jar文件覆蓋最新版本28.0.3中的dx.jar文件,然后重啟Eclipse就可以了。
備注:dx.jar文件所在目錄:{sdk安裝目錄}\build-tools\{版本號}\lib
比如:
參考資料
Unable to build: the file dx.jar was not loaded from the SDK folder
Unable to build: the file dx.jar was not loaded from the SDK folder!
關於解決Eclipse報錯顯示Unable to build: the file dx.jar was not loaded from the SDK folder