Android Studio library error: mixing versions can lead to runtime crashes and @android:style/ missing resources name

Android Studio library error: mixing versions can lead to runtime crashes and @android:style/ missing resources name

请原谅我的英语不好。我收到这个错误

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 less... (Strg+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). Issue id: GradleCompatible

如您所见:

Build.gradle(app) screenshot

我的图书馆:

dependencies {
implementation 'com.cepheuen.elegant-number-button:lib:1.0.2'
implementation('com.github.jd-alexander:android-flat-button:v1.1')
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.0.0'
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:design:28.0.0'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-database:16.0.5'
implementation 'com.rengwuxian.materialedittext:library:2.1.4'
implementation 'com.android.support:mediarouter-v7:28.0.0'
annotationProcessor("org.projectlombok:lombok:1.16.20")
compileOnly("org.projectlombok:lombok:1.16.20")
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.firebaseui:firebase-ui-database:1.2.0'
implementation 'com.android.support:design:28.0.0'

当我转到 styles.xml 并在 @android: 后输入 style 时,我收到以下错误消息:

Missing resource name less... (Strg+F1) Validates resource references inside Android XML files.

如您所见:

styles.xml

我想添加这段代码:

<style name="ExpandedAppbar" parent="@android:style/TextAppearance.Material.Title" />

我使用 Android Studio 3.2.1 compileSdk版本28 minSdkVersion 17 targetSdkVersion 28

AndroidManifest.xml:

`

<uses-permission android:name="android.permission.INTERNET" />

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity android:name=".MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name=".SignIn" />
    <activity android:name=".SignUp" />
    <activity
        android:name=".Home"
        android:label="@string/title_activity_home"
        android:theme="@style/AppTheme" />
    <activity android:name=".FoodList" />
    <activity android:name=".FoodDetail"></activity>
</application>

`

我认为这两个错误是相关的。我希望我的信息足够,有人可以帮助我。

如果有用:我正在学习本教程:YouTube Android Food Order App Part 3

谢谢!!:)

希望这对你有用。

第一期:

出现此问题是因为您将某处 26.1.0 设置为库版本并且 compileSdkVersion 26.

如果您使用 28.0.0 作为您的库版本,请在适用的地方使用此库版本。

在项目的每个 gradle 文件中检查一次,并制作 compileSdkVersion 28targetSdkVersion 28

第二期:

minSdkVersion 17 更改为 minSdkVersion 21