问题描述
我对 Parse 有疑问.我有 sdk(在 Parse.com 上下载并解压到我的项目中的/libs 文件夹中),当我构建时一切都很好.
I have an issue with Parse. I had the sdk (downloaded on Parse.com and unzip inside /libs folder in my project) and when I build everything is good.
但是当我运行该应用程序时,出现以下错误:
But when I run the app,I have this following error :
错误:任务:app:transformClassesWithDexForDebug"的执行失败.
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:Program FilesJavajdk1.8.0_66injava.exe'' 以非零退出值 2 结束
我不知道该怎么办,我搜索并尝试了我在 StackOverflow 和 Parse 的 github 存储库上找到的所有内容,但没有任何效果:/
I don't know what to do, I search and tried everything I found on StackOverflow and github repo of Parse but nothing works :/
有什么想法吗?
预先感谢您的回答.
推荐答案
简单地在你的 gradle 文件中添加这些...
Simple in your gradle file add these ...
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
// Enabling multidex support.
multiDexEnabled true
}
// add dexOptions
dexOptions {
incremental true
javaMaxHeapSize "4g"
}
}
dependencies {
provided fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.parse:parse-android:1.11.0'
// add multidex dependency
compile 'com.android.support:multidex:1.0.1'
}
参考:错误:执行在我添加新依赖项时,我的项目中的任务 ':app:dexDebug' 错误失败
这篇关于无法使用 Parse 运行应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!