我正在使用LiveQueryParse,但是当我同时使用两个gradle链接时,出现以下错误:
Error:Execution Failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
compile 'com.github.tgio:parse-livequery:1.0.3'
compile 'com.parse:parse-android:1.16.3'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.dcas.user"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
defaultConfig {
multiDexEnabled true
}
}
dependencies {
implementation filetree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:design:27.0.1'
compile 'com.android.support:exifinterface:27.0.1'
testImplementation 'junit:junit:4.12'
compile 'com.android.support:cardview-v7:27.0.1'
compile 'com.github.tgio:parse-livequery:1.0.3'
compile 'com.parse:parse-android:1.16.3'
compile 'com.android.support:multidex:1.0.1'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
}
我也已经清理了我的项目,删除了构建文件以及.gradle文件夹,但是仍然出现错误.我已经搜索了类似的问题和解决方案,但仍然无法正常工作.
解决方法:
>您应该使用实现而不是编译.
>设置所有更新的版本.
你应该设置
compileSdkVersion 27
buildToolsversion "27.0.3"
defaultConfig {
applicationId "//"
minSdkVersion 19
targetSdkVersion 27
然后使用
implementation 'com.parse:parse-android:1.17.3'