I have reinstalled the android studio, and while opening my old project again it shows below error:
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(Porject) file:
// 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) file:
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'
I have added all the required plugins and sdk but still it won't work. Installed Firebase plugins.even google play services as well. It was working fine before I uninstalled studio. Please help.
Add/Move this maven {url "https://maven.google.com"} to the top made mine work in build.gradle
This works for me. I just reorder them as like this
repositories {
mavenCentral()
mavenLocal()
google()
jcenter()
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With