gpt4 book ai didi

firebase - 错误:Failed to resolve: common in android studio

转载 作者:行者123 更新时间:2023-12-01 22:28:09 26 4
gpt4 key购买 nike

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

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(项目)文件:

// 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(应用程序)文件:

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 插件。甚至还安装了 google play 服务。在我卸载studio之前它工作得很好。请帮忙。

最佳答案

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

关于firebase - 错误:Failed to resolve: common in android studio,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50760911/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com