我试图在我的gradle文件中使用最新版本的Firebase for
android.我正在尝试建立一个firebase电话号码身份验证,但我不断收到此错误,这是因为我无法找到我的问题:
Error:Execution Failed for task ':app:processDebugManifest'. > Manifest merger Failed : Attribute Meta-data#android.support.VERSION@value value=(26.0.2) from [com.android.support:design:26.0.2] AndroidManifest.xml:28:13-35 is also present at [com.android.support:customtabs:26.0.1] AndroidManifest.xml:25:13-35 value=(26.0.1). Suggestion: add 'tools:replace="android:value"' to <Meta-data> element at AndroidManifest.xml:26:9-28:38 to override.
这是我的应用程序:gradle文件
apply plugin: 'com.android.application' android { compileSdkVersion 26 buildToolsVersion "26.0.1" defaultConfig { applicationId "com.shiMetaapp.shiMetacustomerapp" minSdkVersion 21 targetSdkVersion 26 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true } 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 'com.squareup.picasso:picasso:2.5.2' compile 'com.squareup.retrofit2:retrofit:2.3.0' compile 'com.squareup.retrofit2:converter-gson:2.3.0' compile 'com.synnapps:carouselview:0.1.4' compile 'com.astuetz:pagerslidingtabstrip:1.0.1' compile 'com.android.support:appcompat-v7:26.+' compile 'com.android.support:design:26.+' compile 'de.hdodenhof:circleimageview:2.1.0' compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7' compile 'com.android.support:cardview-v7:26.+' compile 'com.android.support:recyclerview-v7:26.+' compile 'com.android.support:support-v4:26.+' compile 'com.android.support:support-vector-drawable:26.+' // compile 'com.facebook.android:account-kit-sdk:4.11.0' // compile 'com.facebook.android:facebook-android-sdk:4.11.0'// Firebase Authentication testCompile 'junit:junit:4.12' // Firebase Database compile 'com.google.firebase:firebase-auth:11.0.4' compile 'com.google.firebase:firebase-messaging:11.0.4' compile 'com.google.firebase:firebase-config:11.0.4' compile 'com.firebaseui:firebase-ui-auth:2.3.0' } apply plugin: 'com.google.gms.google-services'
这是我的清单文件
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.shiMetaapp.shiMetacustomerapp"> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.READ_PHONE_STATE" /> <uses-permission android:name="android.permission.RECEIVE_SMS" /> <uses-permission android:name="android.permission.GET_ACCOUNTS" /> <uses-permission android:name="android.permission.READ_CONTACTS" /> <uses-permission android:name="android.permission.WRITE_CONTACTS" /> <uses-permission android:name="android.permission.MANAGE_ACCOUNTS" /> <uses-permission android:name="android.permission.READ_PROFILE" /> <application android:name=".activity.App" 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=".activity.MainActivity" android:theme="@style/AppTheme" /> <activity android:name=".activity.ProfileActivity" android:theme="@style/AppTheme.NoActionBar" /> <activity android:name=".activity.SettingsActivity" android:label="@string/title_activity_settings" /> <activity android:name=".activity.SplashActivity" android:theme="@style/AppTheme.NoActionBar"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".activity.Purchases" /> <activity android:name=".activity.PhoneNumberAuthentication"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.DEFAULT"/> </intent-filter> </activity> </application>
This是我在android工作室中设置firebase的文档.
解决方法
支持工件之间的版本冲突
com.android.support:design:26.0.2和com.android.support:customtabs:26.0.1
更新您的firebase-auth verison,firebase-auth具有自定义项的依赖关系,在您的情况下是26.0.1的较低版本.
compile 'com.google.firebase:firebase-auth:11.2.0' compile 'com.google.firebase:firebase-messaging:11.2.0' compile 'com.google.firebase:firebase-config:11.2.0'