我成功地使用最小20秒的最小sdks构建项目,但是当我尝试构建时:
minSdkVersion 21
targetSdkVersion 21
我收到错误:
:project:preDexDebug
no classfiles specified
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':project:preDexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
/Users/user/android-sdk-macosx/build-tools/21.1.1/dx -JXmx2g --dex --multi-dex --output /Users/user/Project-Android/project/build/intermediates/pre-dexed/debug/tween-engine-api-sources-a613effab3e9735b093029491b18c5c4872bdf88.jar /Users/user/Project-Android/project/build/intermediates/exploded-aar/android-ui-client.gdxlibrary/android/unspecified/libs/tween-engine-api-sources.jar
Error Code:
1
Output:
no classfiles specified
我在应用的某些地方使用了libgdx。
然后安装对话框出现,如果我选择了设备,我会收到另一个错误:
Target device: genymotion-google_nexus_6___5_0_0___api_21___1440x2560-192.168.56.103:5555
Uploading file
local path: /Users/user/Project-Android/project/build/outputs/apk/project-debug.apk
remote path: /data/local/tmp/com.ui.client.debug
I/O Error: /Users/user/Project-Android/project/build/outputs/apk/project-debug.apk (No such file or directory)
然后出现一个IDE对话框,显示错误消息:
Failed to complete Gradle execution.
Cause:
(原因之后只是空格)
答案 0 :(得分:1)
我有完全相同的问题。使用--debug选项运行gradle后,结果表明gradle无法处理没有类文件的jar文件(a * -javadoc.jar)。
从/ libs文件夹中删除文件修复了该问题。