java - 将 Firebase 添加到我的依赖项“程序已存在”后出现错误
问题描述
最近将 Firebase 添加到我的代码后,它显示“程序类型已存在”完整堆栈:错误:程序类型已存在:com.firebase.client.android.AndroidCredentialStore
build.gradle 应用程序:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.user.candleclub"
minSdkVersion 23
targetSdkVersion 26
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-database:16.0.6'
implementation 'com.google.firebase:firebase-storage:16.0.5'
implementation 'com.google.firebase:firebase-auth:16.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.github.yukuku:ambilwarna:2.0.1'
implementation 'com.android.support:support-annotations:28.0.0'
// implementation 'com.github.kencheung4:android-StickerView:1.0.0'
implementation 'com.github.hotchemi:permissionsdispatcher:3.1.0'
annotationProcessor 'com.github.hotchemi:permissionsdispatcher-processor:3.1.0'
implementation project(':android-StickerView')
implementation 'com.vanniktech:emoji:0.5.1'
implementation 'com.vanniktech:emoji-ios:0.5.1'
implementation 'com.vanniktech:emoji-one:0.5.1'
implementation 'com.vanniktech:emoji-google:0.5.1'
implementation 'com.vanniktech:emoji-twitter:0.5.1'
implementation 'com.firebase:firebase-client-android:2.5.2'
implementation 'com.google.firebase:firebase-measurement-connector-impl:17.0.5'
implementation "android.arch.core:runtime:1.1.1"
implementation "android.arch.core:common:1.1.1"
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.android.gms:play-services-places:16.0.0'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'com.google.firebase:firebase-core:16.0.7'
}
apply plugin: 'com.google.gms.google-services'
项目等级:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.1'
classpath 'com.google.gms:google-services:4.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
清单.xml:
<?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.example.user.candleclub">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<meta-data
tools:replace="android:value"
android:name="android.support.VERSION"
android:value="26.1.0" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".ChooseFrame" />
<activity android:name=".PrintActivity" />
<activity android:name=".MainMenu">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".MainActivity" />
</application>
</manifest>
尝试添加各种依赖项,但没有解决。有人有想法吗?
编辑:注释掉所有 Firebase 依赖项后没有错误。有谁知道为什么?有没有办法在没有错误的情况下使用 Firebase 的存储?
解决方案
推荐阅读
- python - django如何为ForeignKey使用过滤器
- python - 自定义 Base64 编码器无法正确编码
- python - 请求获取与浏览器不同的数据
- python - POSTGRESQL 和 Django 应用程序:无法从客户端接收数据:对等方重置连接
- c# - 如何根据在c#中调用另一个方法来停止执行一个方法
- wordpress - wordpress 文件无法在 Mozilla 上下载
- android - Android WorkManager setForegroundInfo
- typescript - 如何仅收集类型中的键,该类型的对象具有某个特定键作为 Typescript 接口中的值?
- task - 使用 Tasks API 时收到运行时错误
- javascript - react-bootstrap - Form.Check(单选按钮)即使在重置后也会被检查