ERROR: Failed to resolve: androidx.recycleview:recyclerview:1.0.0 - android

I have Error comment
ERROR: Failed to resolve: androidx.recycleview:recyclerview:1.1.0" and
"ERROR: Failed to resolve: com.google.firebase:firebase-core:19.3.0"
as below;
ERROR: Failed to resolve: androidx.recycleview:recyclerview:1.0.0
Add Google Maven repository and sync project
Show in Project Structure dialog
Affected Modules: app
ERROR: Failed to resolve: com.google.firebase:firebase-core:19.3.0
Show in Project Structure dialog
Affected Modules: app
How can I solve these errors? Please advise.
build.gradle code is as below;
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "io.github.stack07142.firebase_photos"
minSdkVersion 19
targetSdkVersion 29
versionCode 5
versionName "1.4"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dataBinding {
enabled = true
}
}
dependencies {
api fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-auth:19.3.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
implementation 'com.facebook.android:facebook-android-sdk:4.42.0'
implementation 'com.google.firebase:firebase-storage:19.1.1'
implementation 'com.google.firebase:firebase-database:19.2.1'
implementation 'androidx.recycleview:recyclerview:1.1.0'
implementation 'com.github.bumptech.glide:glide:4.11.0'
implementation 'com.google.firebase:firebase-analytics:17.2.3'
testImplementation 'junit:junit:4.13'
}
allprojects {
repositories {
maven{
url 'https://maven.google.com'
}
jcenter()
maven{url'http://maven.fabric.io/public'}
}
}
apply plugin: 'com.google.gms.google-services'

implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.recycleview:recyclerview:1.1.0'

You need to add google() in your project Top-level build file like that
buildscript {
repositories {
...
google()
}
...
allprojects {
repositories {
...
google()
}

Related

Failed to resolve: support-v4?

I have following dependencies in build.gradel file.
I am not using any kind of v4 library but ,
still it's giving "Failed to resolve: support-v4" error while i build the gradle.
I have already gone through these 2 links
"Failed to resolve: com.android.support:support-v4:26.0.0" and other similar errors on Gradle sync
Failed to resolve: com.android.support:support-v4:23.0.0
But can't find solution.
Here i have attached project structure image.
android {
compileSdkVersion 26
dataBinding.enabled = true
defaultConfig {
applicationId "XXX.XXXXXXX.XXXXXXXXXX"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
dataBinding {
enabled = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
repositories {
maven { url "https://maven.google.com" }
}
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:26.1.0'
implementation "com.android.support:customtabs:26.1.0"
implementation 'com.android.support.constraint:constraint-
layout:1.0.2'
implementation 'com.android.support:design:26.+'
implementation 'com.android.support:cardview-v7:26.+'
implementation 'com.google.android.gms:play-services:10.2.1'
implementation 'com.android.support:multidex:1.0.0'
implementation 'com.google.firebase:firebase-messaging:10.2.1'
testImplementation 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
Please help me to get solved this issue.
Thanks in advance.
I have same problem and i'm change order of repositories in biuld.gradle (app) and problem solved.
Change :
jcenter()
google()
To :
google()
jcenter()
Hope it's help
Move repositories in the module build.gradle not in app build.gradle. It will solve your problem.

How to fix Failed to resolve: support-compat

Why not help me?
In my application I want use ButterKnife library and I add this library dependencies. But when add this library and when click on Sync button.
Not sync project and show me error.
gradle.Build (project) :
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.jakewharton:butterknife-gradle-plugin:8.8.1'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
gradle.build (app) :
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.mohammad.ncistutorial"
minSdkVersion 14
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
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.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
}
Error message :
Failed to resolve: support-compat
How can I fix it?
Please try to add depedency line with exclude group of support of app compact.
implementation 'com.jakewharton:butterknife:8.8.1',{
exclude group: 'com.android.support'
})
use this code
implementation 'com.jakewharton:butterknife:9.0.0-rc2',{
exclude group: 'com.android.support'
}
check your .gradle file version. Update or change latest gradle version.

After updating Gradle dependencies failed to resolve Firebase modules

I have updated my project to latest dependencies, also changed compile to implementations and gradle plugins and i have this error
Failed to resolve: firebase-analytics Open File
Failed to resolve: play-services-tasks Open File
Failed to resolve: play-services-ads-identifier Open File
Failed to resolve: play-services-stats Open File
Failed to resolve: play-services-basement Open File
Module
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "my.id"
minSdkVersion 16
targetSdkVersion 28
versionCode 36
versionName "2.04"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
//multiDexEnabled true
}
buildTypes {
release {
debuggable false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
debug {
}
}
productFlavors {
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation files('libs/chartboost.jar')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:percent:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.jakewharton:butterknife:8.8.1'
implementation 'com.github.polok:clicknumberpicker:0.1.2'
implementation 'com.android.volley:volley:1.0.0'
implementation 'com.kila.apprater_dialog.lars:apprater-dialog:1.0.5'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.google.firebase:firebase-core:16.0.0'
implementation 'com.google.firebase:firebase-crash:16.0.0'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-ads:15.0.1'
implementation 'com.google.firebase:firebase-messaging:17.0.0'
implementation 'com.android.billingclient:billing:1.0'
testImplementation 'junit:junit:4.12'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
}
apply plugin: 'realm-android'
apply plugin: 'com.google.gms.google-services'
Project
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:4.0.1'
classpath "io.realm:realm-gradle-plugin:3.5.0"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Tried a lot of combinations, can someone help?

App level gradle sync failed, showing error: Failed to resolve: com.google.firebase:firebase-core:15.1.0

Syncing for my app level gradle failed after I added the following lines to the build.gradle file
implementation 'com.google.firebase:firebase-auth:15.1.0'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
Edit: Adding the following line will fix the problem
implementation 'com.google.firebase:firebase-core:15.0.2'
It returns the following error:
Failed to resolve: com.google.firebase:firebase-core:15.1.0
I checked my Google Play Services, Google Repository, and Android Support Repository via the SDK Manager which has Versions 49, 58, and 47.0.0, respectively, which are all updated.
I also tried adding
implementation 'com.google.firebase:firebase-core:15.1.0'
but it still produces the same error.
These are some of my codes:
build.gradle (app)
apply plugin: 'com.android.application'
android {
useLibrary 'org.apache.http.legacy' //to be able to use HttpClient class
compileSdkVersion 26
defaultConfig {
applicationId "ph.edu.uplb.ics.opruplb"
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'
}
}
}
dependencies {
implementation 'com.google.firebase:firebase-core:15.1.0'
implementation 'com.google.firebase:firebase-auth:15.1.0'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation 'com.google.firebase:firebase-database:15.0.1'
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:26.1.0'
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'
}
apply plugin: 'com.google.gms.google-services'
build.gradle(Project)
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:4.0.0'
}
}
allprojects {
repositories {
maven {
url "https://maven.google.com" // Google's Maven repository
}
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Failed to resolve: com.google.firebase:firebase-core:15.1.0
Read Firebase Android Release Notes. You should set firebase-core:15.0.2
implementation 'com.google.firebase:firebase-core:15.0.2'

gradle Unable to merge dex error at android studio 3

I am trying run my app at emulator but I got his error:
Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
This is my gradle file:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
multiDexEnabled true
applicationId "com.example.sayres.presencesystem"
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'
})
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.google.firebase:firebase-database:11.6.0'
implementation 'com.google.firebase:firebase-auth:11.6.0'
implementation 'com.firebaseui:firebase-ui-auth:3.1.0'
implementation 'com.firebaseui:firebase-ui-database:3.1.0'
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:multidex:1.0.1'
}
and this:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.google.gms:google-services:3.0.0' // google-services plugin
}
}
allprojects {
repositories {
jcenter()
maven { url 'http://maven.fabric.io/public' }
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
according some siggestion on some post I have added multiDexEnabled true to my gradle but I still got error. some developers at this site had suggested, rebuild project.I did this suggestion but I did work and I still got this error!!
what is your suggestion?
I still did this suggestion
but did not work again.
I do not have too many methods.I have just 2 activity and a few methods.my project is for learning.
I change my build.gradle to :
implementation 'com.google.firebase:firebase-database:10.2.0'
implementation 'com.google.firebase:firebase-auth:10.2.0'
implementation 'com.firebaseui:firebase-ui-auth:1.2.0'
implementation 'com.firebaseui:firebase-ui-database:1.2.0'
and
classpath 'com.google.gms:google-services:3.0.0' // google-services plugin
my problem fixed.now I can compile my project.

Categories

Resources