首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >错误:解析失败: android直播间常见

错误:解析失败: android直播间常见
EN

Stack Overflow用户
提问于 2018-06-08 20:41:59
回答 2查看 7.9K关注 0票数 14

我已经重新安装了android studio,当再次打开我的旧项目时,它显示以下错误:

代码语言:javascript
复制
Error:Failed to resolve: firebase-messaging
<a href="openFile:D:/Android projects/Porject_name/app/build.gradle">Open File</a>

Error:Failed to resolve: common
<a href="openFile:D:/Android projects/Porject_name/app/build.gradle">Open File</a>

Build.gradle(移植)文件:

代码语言:javascript
复制
// Top-level build file where you can add configuration options common to 

all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'
        classpath 'com.google.gms:google-services:3.1.0'

    }
}

allprojects {
    repositories {
        jcenter()
        mavenCentral()

        google()


        maven {
            url "https://jitpack.io"
        }

    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

build.gradle(app)文件:

代码语言:javascript
复制
apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion '27.0.3'
    useLibrary 'org.apache.http.legacy'

    defaultConfig {
        applicationId "com.example.abc"
        minSdkVersion 16
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:26.1.0'
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:design:26.1.0'
    compile 'com.android.support:support-v4:26.1.0'
    compile 'com.github.traex.rippleeffect:library:1.3'
    compile 'com.mcxiaoke.volley:library-aar:1.0.0'
    compile 'com.google.firebase:firebase-messaging:12.0.0'
    compile 'com.baoyz.swipemenulistview:library:1.3.0'
    compile 'se.emilsjolander:stickylistheaders:2.1.5'
    compile 'com.applandeo:material-calendar-view:1.4.0'
    compile 'com.github.michaelye.easydialog:easydialog:1.4'
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    compile 'com.squareup.picasso:picasso:2.5.2'

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

我已经添加了所有需要的插件和sdk,但它仍然不能工作。也安装了Firebase plugins.even google play服务。在我卸载studio之前,它工作得很好。请帮帮忙。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2018-06-08 22:15:59

将此maven {url "https://maven.google.com"}添加/移动到顶部,使我的maven在build.gradle中工作

票数 22
EN

Stack Overflow用户

发布于 2018-06-10 01:56:53

这对我很有效。我只是像这样重新排序

代码语言:javascript
复制
repositories {
    mavenCentral()
    mavenLocal()
    google()
    jcenter()
  }
票数 6
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50760911

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档