yung7086
2022-06-22 15:30
采纳率: 100%
浏览 42

Could not resolve com.facebook.android:facebook-core:[5,6).

问题遇到的现象和发生背景

android studio 编译时最近经常报错 Could not resolve com.facebook.android:facebook-core:[5,6).
而实际我并没有引入,我引入的是 implementation 'com.facebook.android:facebook-android-sdk:[8,9)'

本项目集成了mob的sdk和极光推送等是不是他们引入的?

问题相关代码,请勿粘贴截图

这是我的gradle文件


buildscript {
    repositories {
        //jcenter()
        google()

        mavenCentral()
//        maven { url "https://dl.bintray.com/thelasterstar/maven/" }
        maven { url "https://maven.aliyun.com/repository/google" }
        maven { url "https://maven.aliyun.com/repository/jcenter" }
        maven { url "https://maven.aliyun.com/repository/public" }
        maven { url "https://maven.aliyun.com/repository/gradle-plugin" }


//        maven { url "https://mvn.mob.com/android" }

        maven { url 'https://repo1.maven.org/maven2/' }//友盟

        maven { url "https://mvn.mob.com/android" }//sharesdk 202221715:50:40

        // hms, 若不集成华为厂商通道,可直接跳过
//        maven { url 'http://developer.huawei.com/repo/' }
        // fcm, 若不集成 FCM 通道,可直接跳过
        maven { url "https://maven.google.com" }
    }
    dependencies {
//         classpath 'com.android.tools.build:gradle:2.3.1'
        classpath 'com.android.tools.build:gradle:4.2.2'

        classpath 'org.greenrobot:greendao-gradle-plugin:3.3.0'
        classpath 'com.mob.sdk:MobSDK:+'
//        classpath "com.mob.sdk:MobSDK:2018.0319.1724"
        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
        classpath "org.jfrog.buildinfo:build-info-extractor-gradle:3.1.1"
        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'

        // classpath "com.mob.sdk:MobSDK:2018.0319.1724"////sharesdk 202221715:50:40
        // fcm,若不集成 FCM 通道,可直接跳过 20225612:00:11  加入谷歌推送需要用到
        classpath 'com.google.gms:google-services:4.3.8'
        // hms,若不集成华为厂商通道,可直接跳过
//        classpath 'com.huawei.agconnect:agcp:1.6.0.300'

    }
}

allprojects {
    repositories {
        google()
        mavenCentral()

        //  jcenter()
        maven { url "https://mvn.mob.com/android" }
        mavenCentral()
        maven { url "https://maven.aliyun.com/repository/google" }
        maven { url "https://maven.aliyun.com/repository/jcenter" }
        maven { url "https://maven.aliyun.com/repository/public" }
        maven { url "https://maven.aliyun.com/repository/gradle-plugin" }

        maven { url 'https://repo1.maven.org/maven2/' }//友盟
//        maven { url "https://dl.bintray.com/thelasterstar/maven/" }
//        maven { url "https://jitpack.io" }

//        maven { url "https://maven.google.com" }

        //hms,若不集成华为厂商通道,可直接跳过
//        maven {url 'http://developer.huawei.com/repo/'}
        //fcm,若不集成 FCM 通道,可直接跳过
        maven { url "https://maven.google.com" }
    }
}

运行结果及报错内容

img

我的解答思路和尝试过的方法

是更换,代理吗?

我想要达到的结果

如何去掉解决这个问题?

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

2条回答 默认 最新

相关推荐 更多相似问题