【问题标题】:Failed to resolve: firebase-iid-interop [duplicate]无法解决:firebase-iid-interop [重复]
【发布时间】:2018-12-14 04:02:22
【问题描述】:

This is Screen shot

我遇到了这个问题,谁能帮帮我?我到处搜索,但我找不到解决方案

Failed to resolve: firebase-common Open File
Failed to resolve: firebase-iid-interop Open File
Failed to resolve: firebase-measurement-connector Open File

我正在使用 classpath 'com.android.tools.build:gradle:3.1.3' classpath 'com.google.gms:google-services:4.0.1' 我的 Gradle 文件:

apply plugin: 'com.android.application'
android {
    compileSdkVersion 27
    buildToolsVersion '27.0.3'
    useLibrary 'org.apache.http.legacy'

    defaultConfig {
      applicationId "com.*****"
      minSdkVersion 15
      targetSdkVersion 27
      versionCode 20
      versionName "2.0"

      multiDexEnabled true
    }

    buildTypes {
      release {
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
      }
    }
}

// Maven Repositories
repositories {

  google()
  mavenCentral()
  flatDir { dirs 'libs' }
  maven { url "https://dl.bintray.com/ironsource-mobile/android-sdk" }
  maven { url "https://bitbucket.org/adscend/androidsdk/raw/master/" }
  maven { name "Fyber's maven repo"
        url "https://fyber.bintray.com/maven" }

}

dependencies {

  // test Libraries
  implementation fileTree(include: ['*.jar'], dir: 'libs')
  testImplementation 'junit:junit:4.12'

  // Android Support Libraries
  implementation 'com.android.support:design:27.1.1'
  implementation 'com.android.support:support-v4:27.1.1'
  implementation 'com.android.support:customtabs:27.1.1'
  implementation 'com.android.support:cardview-v7:27.1.1'
  implementation 'com.android.support:appcompat-v7:27.1.1'
  implementation 'com.android.support:mediarouter-v7:27.1.1'
  implementation 'com.android.support:support-vector-drawable:27.1.1'

  // Adnetwork Libraries
  implementation 'com.fyber:fyber-sdk:8.19.0'
  implementation(name: 'adgatemediasdk', ext: 'aar')
  implementation(name: 'OfferToroSdk-v3.1.10', ext: 'aar')
  implementation 'com.adscendmedia.sdk:adscendmedia:2.3.4'
  implementation 'com.ironsource.sdk:mediationsdk:6.7.4@jar'

  // MultiDex Dependency
  implementation 'com.android.support:multidex:1.0.3'

  // Other Libraries
  implementation 'com.squareup.okio:okio:1.14.0'
  implementation 'com.google.code.gson:gson:2.8.1'
  implementation 'com.nineoldandroids:library:2.4.0'
  implementation 'com.squareup.okhttp3:okhttp:3.10.0'
  implementation 'com.squareup.picasso:picasso:2.5.2'
  implementation 'de.hdodenhof:circleimageview:2.2.0'
  implementation 'com.mcxiaoke.volley:library:1.0.18'
  implementation 'com.github.d-max:spots-dialog:0.7@aar'
  implementation 'com.github.paolorotolo:appintro:4.1.0'
  implementation 'org.apache.httpcomponents:httpclient-android:4.3.5'
  implementation 'com.facebook.network.connectionclass:connectionclass:1.0.1'

  // Facebook Login only
  implementation 'com.facebook.android:facebook-login:4.34.0'

  // slider library
  implementation 'com.daimajia.slider:library:1.1.5@aar'

  // Google Libraries
  implementation 'com.google.firebase:firebase-messaging:17.1.0'
  implementation 'com.google.firebase:firebase-auth:16.0.2'
  implementation 'com.google.firebase:firebase-analytics:16.0.1'

  // Firebase
  implementation 'com.google.firebase:firebase-ads:15.0.1'
  implementation 'com.google.firebase:firebase-messaging:17.1.0'

}

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

谢谢你。

【问题讨论】:

  • 再次尝试同步。
  • 非常感谢您的评论 Alex Mamo 我尝试了很多次但这不起作用但现在我找到了解决方案。鲍勃斯奈德回答再次感谢您的评论:)

标签: android firebase android-studio android-gradle-plugin jcenter


【解决方案1】:

您需要将 google() 存储库 BEFORE jcenter()。

这是因为 Google 从 jcenter 中删除了他们的项目,但错误地留下了一些带有依赖项的工件。

buildscript {
    repositories {
        google()
        jcenter()
    }

...

allprojects {
    repositories {
        google()
        jcenter()
        maven { url "https://jitpack.io" }
    }
}

【讨论】:

  • 天啊!我很不情愿地试了一下……但它奏效了!谢谢@Borzh
  • 不客气,很高兴它对你有用。
  • 太棒了!!谢谢
  • 太棒了!!工作
  • 什么鬼!!!它起作用了....而且我不知道为什么
【解决方案2】:

从 Firebase SDK 的 June 12th release 开始,您必须明确包含 firebase-core

您的应用 gradle 文件现在必须明确列出 com.google.firebase:firebase-core 作为 Firebase 的依赖项 服务按预期工作。

添加:

implementation 'com.google.firebase:firebase-core:16.0.1'

【讨论】:

  • 非常感谢 Bob Snyder 的回答。当我添加 implementation 'com.google.firebase:firebase-core:16.0.1' 时,它没有解决,但是当我清理项目时,我有一个新错误 Could not find firebase-common.aar 然后我在这里找到解决方案 [链接]stackoverflow.com/questions/48242111/… 它现在正在工作!!!!非常感谢您的帮助:)
  • 如果您仍然像我一样遇到问题,请确保使用最新的:implementation 'com.google.firebase:firebase-core:16.0.6'16.0.1 仍然报错。
【解决方案3】:

将依赖项版本更新到最新版本。 为我工作。

【讨论】:

    【解决方案4】:

    正如@Borzh 建议的那样,在 jcenter() 存储库之前添加 google() 存储库对我有用。请注意,此更改必须在“项目级 gradle 文件”(顶级构建文件)和模块级构建文件中完成。

    项目级 build.gradle 文件

    allprojects {
            repositories {
                google()
                jcenter()
            }
        }
    

    模块级 build.gradle 文件

    repositories {
        google()
        jcenter()
    }
    

    【讨论】:

      猜你喜欢
      • 2018-11-06
      • 1970-01-01
      • 1970-01-01
      • 2019-05-08
      • 2017-11-22
      • 2013-02-15
      • 2011-08-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多