【问题标题】:Program Type Already Present : : com.google.firebase.analytics.FirebaseAnalytics$UserProperty程序类型已经存在 :: com.google.firebase.analytics.FirebaseAnalytics$UserProperty
【发布时间】:2019-03-19 08:40:38
【问题描述】:

尝试将 Firebase 集成到我现有的 Android 应用程序中,但是当我运行它进行设置时,我不断收到此错误。

Program Type Already Present : com.google.firebase.analytics.FirebaseAnalytics$UserProperty

我知道这与我的 Gradle 依赖项有关,但我没有在其他线程中发现这个特定问题。我曾尝试clean 该项目,但这并没有帮助解决它。

这是我的 gradle 文件,希望有人能看到可能存在依赖冲突的地方。

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
compileSdkVersion 28
defaultConfig {
    applicationId "com.example.project"
    minSdkVersion 28
    targetSdkVersion 28
    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:28.0.0'
implementation 'com.android.support:mediarouter-v7:28.0.0'
implementation 'com.android.support:support-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.android.gms:play-services:12.0.1'
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.google.firebase:firebase-database:16.1.0'
implementation 'com.google.firebase:firebase-core:16.0.8'
implementation 'com.google.firebase:firebase-auth:16.2.0'
}

【问题讨论】:

    标签: android firebase gradle


    【解决方案1】:

    修复了这个问题,这是因为 implementation 'com.google.android.gms:play-services:12.0.1' 与我的 firebase 依赖项发生冲突,为了解决这个问题,我已将该依赖项更改为仅包含我需要的库,而不是使用整个 'com.google.android.gms:play-services:12.0.1' 我使用了 @ 987654325@,因为我正在使用它来检测应用程序中的电话位置。

    我用这个链接到https://developers.google.com/android/guides/setup 找出我应该使用哪个特定的库而不是整个库。

    【讨论】:

      猜你喜欢
      • 2019-11-01
      • 2018-09-23
      • 2019-02-22
      • 1970-01-01
      • 2018-10-21
      • 1970-01-01
      • 2018-10-03
      • 2019-04-10
      • 2018-11-15
      相关资源
      最近更新 更多