java.lang.NoSuchMethodError: No static method getFont(Landroid/content/Context;ILandroid/util/Typ...

weixin_34253539發表於2019-02-26

java.lang.NoSuchMethodError: No static method getFont(Landroid/content/Context;ILandroid/util/TypedValue;ILandroid/widget/TextView;)Landroid/graphics/Typeface; in class Landroid/support/v4/content/res/ResourcesCompat; or its super classes (declaration of 'android.support.v4.content.res.ResourcesCompat' appears in /data/app/com.m.testgoogle-2/base.apk:classes2.dex)
at android.support.v7.widget.TintTypedArray.getFont(TintTypedArray.java:119)
Android Studio升級3.0後 新建專案
開始:
compileSdkVersion 26
targetSdkVersion 26
compile 'com.android.support:support-v4:26.+'
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support:recyclerview-v7:26.+'
compile 'com.android.support:design:26.+'
修改為
compileSdkVersion 27
targetSdkVersion 27
compile 'com.android.support:support-v4:27.+'
compile 'com.android.support:appcompat-v7:27.+'
compile 'com.android.support:recyclerview-v7:27.+'
compile 'com.android.support:design:27.+'
就解決了

依賴包衝突 clean rebuild之後也解決了,完全不知道原理。

相關文章