每当尝试生成apk时都会出现以下错误
原因:com.android.tools.r8.utils.AbortException:错误:程序 类型已经存在: com.thoughtbot.expandablerecyclerview.BuildConfig
原因:com.android.tools.r8.CompilationFailedException: 编译无法完成
build.gradle(app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId 'com.schoolerp.kampuskonnekt'
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'io.apptik.widget:multiselectspinner:1.0.12'
implementation 'com.android.support.constraint:constraint-layout:1.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.jjoe64:graphview:4.2.2'
implementation 'im.dacer:AndroidCharts:1.0.4'
implementation 'com.github.florent37:materialtextfield:1.0.7'
implementation 'com.rengwuxian.materialedittext:library:2.1.4'
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
implementation 'com.roger.catloadinglibrary:catloadinglibrary:1.0.4'
implementation 'com.valdesekamdem.library:md-toast:0.9.0'
implementation 'com.jaredrummler:material-spinner:1.2.5'
implementation 'com.github.lzyzsd:circleprogress:1.2.1'
implementation 'com.android.volley:volley:1.1.0'
implementation 'com.github.PhilJay:MPAndroidChart:v2.2.4'
implementation 'com.jaychang:simplerecyclerview:2.0.4'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.5.+'
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'id.zelory:compressor:1.0.4'
implementation 'com.google.maps.android:android-maps-utils:0.5+'
implementation 'com.github.stfalcon:smsverifycatcher:0.3.1'
implementation 'com.thoughtbot:expandablerecyclerview:1.3'
implementation 'com.github.javiersantos:MaterialStyledDialogs:2.1'
implementation 'com.google.code.gson:gson:2.8.0'
implementation 'com.squareup.retrofit2:retrofit:2.0.2'
implementation 'com.squareup.retrofit2:converter-gson:2.0.2'
implementation 'com.loopj.android:android-async-http:1.4.9'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.github.d-max:spots-dialog:1.1@aar'
implementation 'com.akexorcist:googledirectionlibrary:1.0.4'
implementation 'com.github.clans:fab:1.6.4'
implementation 'com.github.PhilJay:MPAndroidChart:v2.2.4'
implementation 'com.github.pedromassango:doubleClick:v1.1'
implementation 'com.github.jd-alexander:library:1.1.0'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.melnykov:floatingactionbutton:1.3.0'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'pub.devrel:easypermissions:1.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.github.blackfizz:eazegraph:1.2.5l@aar'
implementation 'com.nineoldandroids:library:2.4.0'
implementation 'com.github.bumptech.glide:glide:4.7.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.bignerdranch.android:expandablerecyclerview:1.0.3'
implementation 'org.quanqi:android-holo-graph:0.1.0'
implementation 'com.yarolegovich:discrete-scrollview:1.4.7'
implementation 'devs.mulham.horizontalcalendar:horizontalcalendar:1.1.7'
implementation 'im.dacer:AndroidCharts:1.0.4'
implementation project(':librarysticky')
implementation project(':libraryexpandlist')
implementation project(':filepicker')
implementation project(':expandablerecyclerview')
implementation project(':drawroutemap')
}
build.gradle(Module.expandablerecyclerview)
apply plugin: 'com.android.library'
//ext {
// bintrayRepo = 'maven'
// bintrayName = 'expandablerecyclerview'
//
// publishedGroupId = 'com.thoughtbot'
// libraryName = 'expandablerecyclerview'
// artifact = 'expandablerecyclerview'
//
// libraryDescription = 'Custom Android RecyclerViewAdapters that collapse and expand'
//
// siteUrl = 'https://github.com/thoughtbot/expandable-recycler-view'
// gitUrl = 'https://github.com/thoughtbot/expandable-recycler-view.git'
//
// libraryVersion = '1.4'
//
// developerId = 'mandybess'
// developerName = 'Amanda Hill'
// developerEmail = 'amandabesshill@gmail.com'
//
// licenseName = 'The Apache Software License, Version 2.0'
// licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
// allLicenses = ["Apache-2.0"]
//}
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
minSdkVersion 16
targetSdkVersion 27
versionCode 2
versionName "1.4"
}
buildTypes {
release {
minifyEnabled false
}
}
}
dependencies {
//android
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
//unit tests
testImplementation 'junit:junit:4.12'
testImplementation 'org.robolectric:robolectric:3.2.1'
testImplementation 'org.mockito:mockito-core:1.10.5'
}
//apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle'
//apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle'
我们将不胜感激。谢谢:)
答案 0 :(得分:0)
错误:程序类型已存在:
首先,从 DUPLICATE
中删除 dependencies
条目。
仅供参考
无法解决错误:无法在单个dex中容纳请求的类 文件。尝试提供main-dex列表。 #方法:66104> 65536
Android 5.0(API级别21)之前的平台版本使用Dalvik运行时执行应用程序代码。默认情况下,Dalvik将应用程序限制为每个APK仅包含一个classes.dex字节码文件。为了解决此限制,您可以将multidex支持库添加到您的项目中:
您应该添加 multiDexEnabled
defaultConfig {
....
multiDexEnabled true
}
和
implementation 'com.android.support:multidex:1.0.3'
有关更多信息,请访问DexIndexOverflowException
。