我知道,有成千上万的这样的问题,但我尝试了所有解决方案,但它们对我不起作用。那么,问题是什么?问题是以下错误:
其中一个解决方案是使用相同的版本规范。我也使用26.0.0版本和所有库。但无论如何都会发生错误。此外,appcompat
错误也不会消失。它显示all support libraries must use same version
并且有一个红色下划线。以下是我的应用级build.gradle文件:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.apps.root.exampleapp"
minSdkVersion 17
targetSdkVersion 26
versionCode 24
versionName "2.1"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
// Optional: Specify the language(s) your app supports.
resConfigs "ru", "kz", "en"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
compile 'com.google.firebase:firebase-database:11.0.2'
compile files('libs/aspectjrt-1.7.3.jar')
compile files('libs/isoparser-1.0.6.jar')
compile 'com.google.firebase:firebase-database:11.0.2'
compile 'pub.devrel:easypermissions:1.0.0'
compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.code.gson:gson:2.8.1'
compile 'com.google.firebase:firebase-auth:11.0.2'
compile 'com.google.firebase:firebase-messaging:11.0.2'
compile 'com.google.firebase:firebase-storage:11.0.2'
compile 'com.android.support:design:26.0.+'
compile 'com.squareup.retrofit2:retrofit:2.2.0'
compile 'com.squareup.retrofit2:converter-gson:2.2.0'
compile 'com.firebaseui:firebase-ui-database:2.1.0'
compile 'com.firebaseui:firebase-ui-storage:2.1.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.ncapdevi:frag-nav:2.1.0'
compile 'com.roughike:bottom-bar:2.3.1'
compile 'com.google.android.gms:play-services:11.0.2'
//compile 'com.android.support:support-v4:26.+'
compile 'com.android.support:multidex:1.0.0'
compile 'com.github.chrisbanes:PhotoView:1.2.6'
compile 'com.facebook.android:account-kit-sdk:4.+'
compile 'com.krossovochkin.bottomsheetmenu:bottomsheetmenu:1.1'
compile 'com.pixplicity.easyprefs:library:1.9.0'
compile 'com.github.d-max:spots-dialog:0.7@aar'
compile 'com.google.android.exoplayer:exoplayer:r2.5.2'
testCompile 'junit:junit:4.12'
}
repositories {
mavenCentral()
}
apply plugin: 'com.google.gms.google-services'
/*
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '25.3.0'
}
}
}
}
*/
在这次试验之后,我去了清单文件。我尝试将tools:replace="android:value"
添加到应用程序代码中。但它没有帮助。我点击了Merged Manifest
,它显示如下:
以下是我的清单:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.zerotoonelabs.root.qamqor">
<uses-feature android:name="android.hardware.camera" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.MEDIA_CONTENT_CONTROL"></uses-permission>
<application
android:name=".PrefsApplication"
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/Theme.AppCompat.Light.NoActionBar"
tools:replace="android:value">
<meta-data
android:name="com.facebook.accountkit.ApplicationName"
android:value="@string/app_name" />
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="@string/FACEBOOK_APP_ID" />
<meta-data
android:name="com.facebook.accountkit.ClientToken"
android:value="@string/ACCOUNT_KIT_CLIENT_TOKEN" />
<meta-data
android:name="firebase_crash_collection_enabled"
android:value="false" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable/ic_kazakhstan" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_color"
android:resource="@color/colorAccent" />
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key" />
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@style/AppTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".login.LoginActivity" />
<activity android:name=".LetterDetailActivity" />
<activity android:name=".activities.RulesActivity" />
<activity android:name=".login.EditProfileActivity" />
<activity android:name=".login.SignUpActivity" />
<activity android:name=".login.SignUpActivity2" />
<activity android:name=".ate.UserLocation" />
<activity android:name=".activities.DomainDetailActivity" />
<activity android:name=".activities.ChangePasswordActivity" />
<activity android:name=".activities.SuggestionActivity" />
<activity android:name=".login.RestorePasswordActivity" />
<activity android:name=".activities.ShowPdfActivity" />
<activity android:name=".SeeLetterDetaily" />
<activity android:name=".GuestActivity" />
<activity android:name=".activities.LoginViaFacebookActivity" />
<activity android:name=".activities.PhoneAuthActivity" />
<activity android:name=".ChooseItemActivity" />
<activity android:name=".GuestingActivity" />
<activity android:name=".VideoPlayerActivity"></activity>
</application>
</manifest>
如果我删除了清单中的tools:replace
,则会出现以下错误: