Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

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

build.gradle - implementation 'com.android.support:appcompat-v7:28.0.0'

I am moving my first steps with app programming.

I searched the other topics that relate to this matter and tried all the solutions but still it's driving me mad:

building on Android Studio I cannot make it through this error about

implementation 'com.android.support:appcompat-v7:28.0.0' :

All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes).

Found versions 28.0.0, 26.1.0.

Examples include

com.android.support:animated-vector-drawable:28.0.0

and

com.android.support:support-v4:26.1.0

There are some combinations of libraries, or tools and libraries, that are incompatible, or can lead to bugs. One such incompatibility is compiling with a version of the Android support libraries that is not the latest version (or in particular, a version lower than your targetSdkVersion).

if i ignore it with the command "noinspection" then the apk does not run on my phone. I tried to add some dependencies like in the example line but it doesn't work at this point i show above, because if add "support version 4:26.1.0 it tells me it's not the latest and if i upgrade it writing 7:28.0.0 it doesn't work either.

Can anyone help me please? Thank you for your time!

Edit: this is my build.gradle https://www.dropbox.com/sh/1vjmrh196bdy5gn/AADW-DG1YB10s-Csw_UrZtuYa?dl=0

I applied suggestions below (THANKS!!) and the error is not showing anymore, BUT my app still crashes both in emulator and in my device (galaxy a6+).

See Question&Answers more detail:os

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

1 Reply

0 votes
by (71.8m points)

add implementation 'com.android.support:support-v4:28.0.0' in your gradle

as an old version of com.android.support:support-v4:26.1.0 is there imported by some other library which is causing the issue with com.android.support:appcompat-v7:28.0.0, similarly add the other implementations that occur after this one. so final would be like

implementation 'com.android.support:appcompat-v7:28.0.0' 
implementation 'com.android.support:support-v4:28.0.0'

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...