【发布时间】:2018-06-29 15:42:03
【问题描述】:
下面是我的 gradle 文件 安卓工作室正在显示此消息
所有 com.android.support 库必须使用完全相同的版本规范(混合版本可能导致运行时崩溃)。找到版本 27.0.2、26.1.0。示例包括 com.android.support:support-compat:27.0.2 和 com.android.support:animated-vector-drawable:26.1。
应用插件:'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.t.t"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:customtabs:26.1.0'
implementation 'com.github.bumptech.glide:glide:4.5.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.google.firebase:firebase-database:11.8.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'
}
apply plugin: 'com.google.gms.google-services'
当我运行应用程序时,应用程序在运行时崩溃并显示以下错误 java.lang.NoSuchMethodError: 没有静态方法 getFont(Landroid/content/Context;ILandroid/util/TypedValue;ILandroid/widget/TextView;)Landroid/graphics/Typeface;在 Landroid/support/v4/content/res/ResourcesCompat 类中;或其超类(“android.support.v4.content.res.ResourcesCompat”的声明出现在 /data/app/com.example.tapesh.tapu_chat-2/base.apk)
【问题讨论】:
-
构建工具版本是多少?
-
实际上我已经删除了 buildtoolsversion,因为我已经将我的 android studio 更新为 3.0.1 ,所以没有要求,因为 android studio 建议我