首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >多个dex文件定义Lcom/getkeepsafe/relinker/SystemLibraryLoader;

多个dex文件定义Lcom/getkeepsafe/relinker/SystemLibraryLoader;
EN

Stack Overflow用户
提问于 2019-08-06 18:59:36
回答 1查看 99关注 0票数 0

当我试图构建我的项目->多个dex文件定义Lcom/getkeepsafe/relinker/SystemLibraryLoader;时,我就遇到了这个问题

我试图清理.gradle,删除build文件夹并重新安装依赖项,但仍然不起作用。

这是我的build.gradle:moduleapp

代码语言:javascript
复制
apply plugin: 'com.android.application'
apply plugin: 'realm-android'

android {
compileSdkVersion 26
buildToolsVersion '26.0.3'
defaultConfig {
applicationId 'com.taxiapp.passenger'
minSdkVersion 17
targetSdkVersion 26
versionCode 13
versionName '1.0.3'
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
dexOptions {
javaMaxHeapSize '4g'
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}

allprojects {
repositories {
mavenCentral()
}
}
/* IMPORTANT :

Be careful when update dependencies, different version library may caused error /
dependencies {
compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.+'
}
dependencies {
compile fileTree(include: ['.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
exclude group: 'com.google.code.findbugs'
})
compile('com.mikepenz:fastadapter:2.0.0@aar') {
transitive = true
}
compile 'com.afollestad.material-dialogs:core:0.9.0.0'
compile 'com.mikepenz:iconics-core:2.8.1@aar'
compile 'com.mikepenz:fontawesome-typeface:4.6.0.2@aar'

compile('cn.trinea.android.view.autoscrollviewpager:android-auto-scroll-view-pager:1.1.2') {
exclude module: 'support-v4'
}

// compile('pl.droidsonroids.relinker:1.2.2'){
// exclude module: 'pl.droidsonroids.relinker:1.2.2'
// }

testCompile 'junit:junit:4.12'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:recyclerview-v7:26.1.0'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:support-v4:26.1.0'
compile 'com.android.support:support-vector-drawable:26.1.0'
compile 'com.android.support:multidex:1.0.3'
compile 'com.google.guava:guava:19.0'
compile 'com.dmitrymalkovich.android:material-design-dimens:1.4'
compile 'com.ogaclejapan.smarttablayout:library:1.6.1@aar'
compile 'com.ogaclejapan.smarttablayout:utils-v4:1.6.1@aar'
compile 'com.jakewharton:butterknife:8.4.0'
compile 'me.relex:circleindicator:1.2.2@aar'
compile 'com.squareup.okhttp3:okhttp:3.4.1'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'
compile 'com.google.firebase:firebase-core:12.0.1'
compile 'com.google.firebase:firebase-messaging:12.0.1'
compile 'com.mobsandgeeks:android-saripaar:2.0.3'
compile 'com.google.android.gms:play-services:12.0.1'
compile 'org.greenrobot:eventbus:3.1.0'
compile 'com.makeramen:roundedimageview:2.2.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
compile 'com.github.siyamed:android-shape-imageview:0.9.3'
compile 'de.hdodenhof:circleimageview:2.0.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'com.balysv:material-ripple:1.0.2'
}
dependencies {
compile 'com.android.support.constraint:constraint-layout:1.0.2'
}
apply plugin: 'com.google.gms.google-services'

这是我的build.gradle:projectmodule

代码语言:javascript
复制
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'com.google.gms:google-services:3.0.0'
classpath 'io.realm:realm-gradle-plugin:4.1.0'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}

allprojects {
repositories {
jcenter()
google()
// maven {
// url 'https://maven.google.com/'
// name 'Google'
// }
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

请告诉我我能做些什么来解决这个问题

EN

回答 1

Stack Overflow用户

发布于 2019-08-08 14:40:20

将此字符串添加到build.gradle:moduleapp中的依赖项{}中

代码语言:javascript
复制
dependencies { 
    compile 'com.getkeepsafe.relinker:relinker:1.3.1' //this string
}

看起来你在用一个很老的现成的脚本,我建议你自己做所有的事情。

我建议你使用'implement‘或'api’而不是'compile‘

也不要使用

代码语言:javascript
复制
compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.+'

例如,总是使用一个特定的版本来避免其他“多个索引文件定义”的问题。

代码语言:javascript
复制
compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.17'

不要忘记按照工具栏菜单中的步骤重建项目: Build -> rebuild Project。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57374527

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档