การคอมไพล์ของฉันล้มเหลวด้วยเหตุผลบางประการ แต่ก่อนหน้านี้มันทำงานได้ดี
นี่เป็นข้อผิดพลาดที่ฉันได้รับเมื่อพยายามรวบรวมโครงการ:
Program type already present: android.support.design.widget.CoordinatorLayout$Behavior
Message{kind=ERROR, text=Program type already present: android.support.design.widget.CoordinatorLayout$Behavior, sources=[Unknown source file], tool name=Optional.of(D8)}
(สร้าง) app.iml :
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "appjoe.wordpress.com.testdemo"
minSdkVersion 23
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:support-v4:26.1.0'
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.android.support:design:26.1.0'
// picasso and volley
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'eu.the4thfloor.volley:com.android.volley:2015.05.28'
// retrofit
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
// rxjava & rxandroid
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
implementation 'io.reactivex.rxjava2:rxjava:2.1.16'
// glide
implementation 'com.github.bumptech.glide:glide:4.7.1'
// android views
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'
}
ฉันยังได้รับข้อผิดพลาดสำหรับการขึ้นต่อกันครั้งที่สองในพื้นที่การขึ้นต่อกันโดยแจ้งว่า:
ไลบรารี com.android.support ทั้งหมดต้องใช้ข้อกำหนดเวอร์ชันเดียวกันทุกประการ (เวอร์ชันผสมกันอาจทำให้เกิดปัญหารันไทม์ได้) พบเวอร์ชัน 27.1.1, 27.1.0, 26.1.0 ตัวอย่าง ได้แก่ com.android.support:support-compat:27.1.1 และ com.android.support:exifinterface:27.1.0 น้อยกว่า... (Ctrl+1)
มีไลบรารีหรือเครื่องมือและไลบรารีบางอย่างรวมกันซึ่งเข้ากันไม่ได้หรืออาจทำให้เกิดข้อบกพร่องได้ ความเข้ากันไม่ได้ประการหนึ่งคือการคอมไพล์กับเวอร์ชันของไลบรารีสนับสนุน Android ที่ไม่ใช่เวอร์ชันล่าสุด (หรือโดยเฉพาะ เวอร์ชันที่ต่ำกว่า targetSdkVersion ของคุณ)