关于安卓一些报错的解决方法(随时更新)

1.Program type already present

依赖包冲突

All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 27.1.1, 25.3.0. Examples include com.android.support:animated-vector-drawable:27.1.1 and com.android.support:design:25.3.0 less... (Ctrl+F1) 
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.)

若按提示加入

//noinspection GradleCompatible

  编译不会出现问题但在调试的时候就会报错

看提示应该是com.android.support:design版本和com.android.support:appcompat中显示的版本冲突,这时候把design版本置换即可,在dependencies中加入:

implementation 'com.android.support:design:27.1.1'

猜你喜欢

转载自www.cnblogs.com/yang12318/p/9027999.html