Could not find firebase-messaging.jar - Android Build Error - android

I am getting this build error.
Could not find firebase-messaging.jar
(com.google.firebase:firebase-messaging:15.0.2). Searched in the
following locations:
https://jcenter.bintray.com/com/google/firebase/firebase-messaging/15.0.2/firebase-messaging-15.0.2.jar
I have attached the build.gradle code below. Please check. I am not able to get solution for this on stackoverflow
build.gradle
plugins {
id 'com.onesignal.androidsdk.onesignal-gradle-plugin' version '0.8.1'
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
//buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.test.android"
minSdkVersion 15
targetSdkVersion 26
versionCode 3
versionName "1.0.2"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
manifestPlaceholders = [onesignal_app_id : "65f11821-XXXXXX-4ec4-9e41-XXXXXXXX",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "XXXXX"]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
// applovin
implementation project(':unity-ads')
//unity ads
//compile 'com.google.android.gms:play-services-ads:11.0.4'
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support:support-vector-drawable:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.1'
implementation 'com.android.support:support-v4:26.1.0'
//implementation 'com.google.android.gms:play-services:11.6.0'
implementation 'com.android.support:multidex:1.0.3'
//compile 'com.github.cooltechworks:ScratchView:v1.1'//not used
implementation 'com.jackpocket:scratchoff:1.1.0'
implementation 'com.adcolony:sdk:3.2.1'
implementation 'com.android.support:support-annotations:27.1.1'
implementation 'com.google.android.gms:play-services-ads:15.0.1'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.facebook.android:facebook-share:4.33.0'
testImplementation 'junit:junit:4.12'
implementation 'com.ironsource.sdk:mediationsdk:6.7.0.1#jar'
//compile 'com.google.ads.mediation:unity:2.1.1.0' //not used
//implementation 'com.google.firebase:firebase-database:11.6.0'
implementation 'com.github.bumptech.glide:glide:4.1.1'
//implementation 'commons-net:commons-net:3.3'
//get server time
//compile 'com.github.instacart.truetime-android:library-extension-rx:2.0'
//compile 'com.github.instacart.truetime-android:library:2.0' // not used
implementation 'com.google.firebase:firebase-messaging:15.0.2'
//implementation 'com.google.firebase:firebase-auth:11.6.0'
//implementation 'com.google.firebase:firebase-core:11.6.0'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
//implementation 'com.onesignal:OneSignal:[3.7.1, 3.9.1]'
implementation 'com.onesignal:OneSignal:[3.9.1, 3.99.99]'
implementation files('libs/applovin-sdk-7.7.0-javadoc.jar')
implementation files('libs/applovin-sdk-7.7.0.jar')
}
apply plugin: 'com.google.gms.google-services'
Project build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
maven {
url "https://maven.google.com"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0-alpha17'
classpath 'com.google.gms:google-services:4.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://maven.google.com" }
maven { url "https://jitpack.io" }
maven { url "https://adcolony.bintray.com/AdColony" }
maven { url "https://dl.bintray.com/ironsource-mobile/android-sdk" }
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

moving google() on top of jcenter() worked for me in the build.gradle file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
mavenLocal()
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0-alpha17'
classpath 'com.google.gms:google-services:4.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
//maven { url "https://maven.google.com" }
maven { url "https://jitpack.io" }
maven { url "https://adcolony.bintray.com/AdColony" }
maven { url "https://dl.bintray.com/ironsource-mobile/android-sdk" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

Related

ERROR: Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve com.google.android.gms:play-services-base

As you can see here are the errors I'm getting when I'm trying to sync my project I'm getting this issue again and again. Gradle is in Online mode. I also tried offline mode but I found the same issue.
I also tried so many methods but still, I can't able to solve this problem.
Gradle Sync Error
ERROR: Unable to resolve dependency for ':app#debugUnitTest/compileClasspath': Could not resolve com.google.android.gms:play-services-base:[10.2.1, 16.1.99]
Build.gradle (project)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
classpath 'com.google.gms:google-services:4.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
mavenLocal()
jcenter()
maven { url "https://maven.google.com" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Build.gradle (:app)
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.6, 0.99.99]'
}
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
repositories {
maven { url 'https://maven.google.com' }
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
useLibrary 'org.apache.http.legacy'
defaultConfig {
vectorDrawables {
useSupportLibrary = true
}
vectorDrawables.useSupportLibrary = true
applicationId "com.game.pubg.best.tournaments"
// TODO: Please update the OneSignal ID below to yours!
manifestPlaceholders = [onesignal_app_id: '6554b669-a188-4110-8836-b181ff64894b',
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: 'REMOTE']
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath false
}
}
}
repositories {
mavenCentral()
maven { url 'http://repo1.maven.org/maven2' }
maven { url "http://jcenter.bintray.com" }
maven { url "https://www.jitpack.io" }
maven { url "https://maven.google.com" }
maven { url 'https://dl.bintray.com/drummer-aidan/maven' }
maven { url "https://s3-ap-southeast-1.amazonaws.com/godel-release/godel/" }
jcenter()
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
// debug {
// minifyEnabled true
// proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
// }
}
}
apply plugin: 'com.google.gms.google-services'
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:support-vector-drawable:28.0.0'
// implementation 'ai.devsupport.instamojo:instamojolib:0.1.6'
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.2',
{
exclude group: 'com.android.support', module: 'support-annotations'
}
)
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:design:28.0.0'
// implementation 'com.google.android.gms:play-services-ads:17.0.0'
implementation 'de.hdodenhof:circleimageview:3.1.0'
implementation 'com.facebook.shimmer:shimmer:0.5.0'
implementation 'me.zhanghai.android.materialprogressbar:library:1.6.1'
implementation 'com.github.bumptech.glide:glide:4.11.0'
implementation 'com.onesignal:OneSignal:[3.13.0, 3.99.99]'
implementation('com.paytm:pgplussdk:1.3.3')
{
transitive = true
}
implementation 'org.jsoup:jsoup:1.13.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.android.gms:play-services-auth:18.0.0'
}
Add apply plugin: 'com.google.gms.google-services' to build.gradle (:app)
Try dependencies of answer of this question: Android Studio can't find Kotlin dependency

Could not resolve com.android.tools.build:gradle:3.2.1. error in gradle

i'm trying to compile my project but i get this error, i tried to resolve my problem with other answers but nothing helped:
Could not resolve com.android.tools.build:gradle:3.5.3.
Could not get resource 'https://maven.google.com/com/android/tools/build/gradle/3.5.3/gradle-3.5.3.pom'.
Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.5.3/gradle-3.5.3.pom'.
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
**
my Gradle app looks like this:
apply plugin: 'com.android.application'
android {
buildToolsVersion "28.0.0"
// buildToolsVersion "29"
compileSdkVersion 28
defaultConfig {
applicationId "com.example.a1.makeitapp"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
allprojects {
repositories {
google()
maven { url "https://jitpack.io" }
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.google.android.gms:play-services-auth:16.0.0'
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.0.0'
testImplementation 'junit:junit:4.12'
// androidTestImplementation 'com.android.support.test:runner:1.0.2'
// androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.github.parse-community.Parse-SDK-Android:fcm:1.18.5'
// implementation 'com.android.support:design:REPLACE-WITH-APPCOMPAT-VERSION'
}
}
my Gradle :
buildscript {
repositories {
google()
jcenter()
mavenCentral()
maven { url 'https://maven.google.com' }
}
dependencies {
//classpath 'com.android.tools.build:gradle:3.2.0'
classpath 'com.android.tools.build:gradle:3.5.3'
//classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url 'https://maven.google.com' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
can someone help to solve the problem??
thanks!!

The implementation 'com.github.prolificinteractive:material-calendarview:2.0' cant resolve

why my material calendar view failed to resolve, here is my
Module: app
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.project.cms"
minSdkVersion 22
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android- optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.0.0-beta1'
implementation 'com.android.support:design:26.0.0-beta1'
implementation 'com.android.support:support-v4:26.0.0-beta1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso- core:3.0.2'
implementation 'com.github.ybq:Android-SpinKit:1.2.0'
implementation 'com.android.support:cardview-v7:26.0.0-beta1'
implementation 'com.android.support:recyclerview-v7:26.0.0-beta1'
implementation 'com.github.prolificinteractive:material-calendarview:2.0'
}
here is my BUILD FILE
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
when I sync the gradle the error showed is
Failed to resolve:
com.github.prolificinteractive:material-calendarview:2.0
open.dependency.in.project.structure affected module app
Please help me
There is an issue in your dependency version
implementation 'com.github.prolificinteractive:material-calendarview:2.0'
Replace with
implementation 'com.github.prolificinteractive:material-calendarview:2.0.0'
Place this code:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
in the settings.gradle

Failed to resolve: support-compat unable to identify the error repository

I am getting an error failed to resolve: support-compat in Android Studio while trying to build. I could not identify which repository is having the error. please see my app grundle. How to check which repository is failed or anything I need to add in project grundle. please suggest me.
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.beingdev.magicprint"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
useLibrary 'org.apache.http.legacy'
manifestPlaceholders = [onesignal_app_id : "5c3d7b9b-1874-463f-8081-1c3439ccb3ea",
onesignal_google_project_number: "REMOTE"]
multiDexEnabled true
}
buildTypes {
debug {
minifyEnabled true
useProguard true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
release {
minifyEnabled false
shrinkResources false
useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation 'com.onesignal:OneSignal:3.10.5#aar'
//database operation lib
implementation 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'
//google play services
implementation 'com.google.android.gms:play-services-gcm:11.0.1'
implementation 'com.google.android.gms:play-services-analytics:11.0.1'
implementation 'com.google.android.gms:play-services-location:11.0.1'
implementation 'com.google.android.gms:play-services:11.0.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:customtabs:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.daimajia.easing:library:2.0#aar'
implementation 'com.rengwuxian.materialedittext:library:2.1.4'
implementation 'com.github.GrenderG:Toasty:1.2.5'
implementation 'com.daimajia.androidanimations:library:2.3#aar'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.daimajia.slider:library:1.1.5#aar'
implementation "com.android.support:recyclerview-v7:27.1.1"
implementation 'com.android.support:cardview-v7:27.1.1'
implementation "com.android.support:support-annotations:28.0.0"
implementation 'com.webianks.library:easy-feedback:1.0.2'
implementation 'com.geniusforapp.fancydialog:FancyDialog:0.1.4'
implementation('com.mikepenz:crossfadedrawerlayout:1.0.1#aar')
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.kaopiz:kprogresshud:1.1.0'
implementation 'com.getkeepsafe.taptargetview:taptargetview:1.11.0'
implementation 'com.github.bumptech.glide:glide:4.7.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.4.0'
implementation 'com.github.yesidlazaro:GmailBackground:1.2.0'
//Field and method binding for Android views which uses annotation processing
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1',{
exclude group: 'com.android.support'
}
implementation 'com.airbnb.android:lottie:2.2.5'
implementation 'com.firebaseui:firebase-ui:0.4.4'
//Libraries I've included
implementation 'com.google.firebase:firebase-database:9.4.0'
//Stylish edittextbox
implementation 'com.github.florent37:materialtextfield:1.0.7'
//radiogroup
implementation 'com.github.Gavras:MultiLineRadioGroup:v1.0.0.6'
//ticker textview
implementation 'com.tomer:fadingtextview:2.5'
// Dexter runtime permissions
implementation 'com.karumi:dexter:4.2.0'
testImplementation 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
and my project grundle as follows
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
//use maven repo
mavenCentral()
maven {
url 'https://maven.google.com/'
name 'Google'
}
maven { url 'https://jitpack.io' }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
i think your project gradle need some changes, mentioned below. put google() first.
buildscript {
repositories {
google() <-------put this first
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google() <-------put this first
jcenter()
//use maven repo
mavenCentral()
maven {
url 'https://maven.google.com/'
name 'Google'
}
maven { url 'https://jitpack.io' }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

Could not find method maven()

I am getting the following error :
Could not find method maven() for arguments [build_3sdtqstdmsgdnexrxaaxgljji$_run_closure1$_closure4#325a800c] on root project 'Appointments' of type org.gradle.api.Project.
Here's my Project Level Gradle File:
buildscript {
repositories {
google()
jcenter()
maven { url "http://jcenter.bintray.com"}
maven { url "https://maven.fabric.io/public" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:4.0.0'
classpath 'io.fabric.tools:gradle:1.25.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
maven {
url 'https://maven.google.com/'
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
And here's my app level Gradle File :
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.gtaandteam.android.wellcure"
minSdkVersion 19
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'
}
}
}
repositories {
mavenCentral()
maven {
url "https://s3-ap-southeast-1.amazonaws.com/godel-release/godel/"
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'ai.devsupport.instamojo:instamojolib:0.1.6'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-crash:11.0.4'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation "com.android.support:design:24.2.0"
implementation 'com.google.firebase:firebase-core:16.0.0'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.3'
}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'io.fabric'
I have tried all the techniques mentioned in other posts and solution website, but I dont find my same error listed in any of these websites. Hence I am creating this question here.
You're getting this error because your maven shouldn't be a direct child of "allprojects" but a direct child of "repositories".
allprojects {
repositories {
google()
jcenter()
maven {
url 'https://maven.google.com/'
}
}
}

Categories

Resources