Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
896 views
in Technique[技术] by (71.8m points)

android - All the libraries must use the same versions

My depencies

dependencies {
compile 'me.dm7.barcodescanner:zxing:1.9'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'

implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'

compile 'com.theartofdev.edmodo:android-image-cropper:2.7.+'

}

I get an error in appcompat line when compiling that found version 27.1.1,26.1.0 examples include ..vectordrawable 27.1.1 nd supportdesign 26.1.0

My target SDK is 26.

I tried to switch versions to 27 but my SDK target is 26, I get an error.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Whenever you see this type of problem, explicitly declare the probelmatic libraries in your gradle file with the same version of your other support libs:

implementation "com.android.support:animated-vector-drawable:26.1.0"
implementation "com.android.support:design:26.1.0"
implementation 'com.android.support:support-vector-drawable:26.1.0'

This happens because some of your dependencies use a different version of it.

Also, use implementation not compile. Compile has been deprecated:

implementation 'me.dm7.barcodescanner:zxing:1.9'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...