java.lang.NoSuchMethodError: No static method getFont

最近在Android Studio升级3.0后,在AlertDialog弹窗时报出了如下问题:


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.ik.githubbrowser-YvwoGrxR8QaUEZ3IEqFVLQ==/split_lib_dependencies_apk.apk)

最终解决方案:

compileSdkVersion 27
buildToolsVersion '27.0.0'

compile 'com.android.support:support-v4:27.0.0'
compile 'com.android.support:appcompat-v7:27.0.0'
compile 'com.android.support:recyclerview-v7:27.0.0'
compile 'com.android.support:design:27.0.0'












你可能感兴趣的:(Android-遇到的坑)