I get this error when trying to sync my android studio project after adding the lines required in a firebase project.
Just that, it's a common android studio project in which i just want to apply a firebase database. Please, if anyone knows what could be happening?
Thanks.
PD: I already searched this error on other stackoverflow questions, but none of the answers worked for me :(
Here is my 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.4.1'
classpath 'com.google.gms:google-services:4.3.4'
//classpath 'com.google.firebase:firebase-crashlytics-gradle:2.2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
And my buid.gradle(app):
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 28
buildToolsVersion "29.0.0"
defaultConfig {
applicationId "com.example.proceedingmanager"
minSdkVersion 21
targetSdkVersion 28
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:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:2.0.4'
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 platform('com.google.firebase:firebase-bom:26.2.0')
implementation 'com.google.firebase:firebase-analytics'
}
Update:
Hey! I solved it by just updating my android studio version to a newer one.
But no, i don't know how to solve it without doing that
I've tried to download RecycleView in order to use in my project but this error keeps occurring and download fails.
Gradle sync failed: Could not resolve all dependencies for
configuration ':app:debugRuntimeClasspath'. Could not determine
artifacts for androidx.recyclerview:recyclerview:1.0.0 Could not
get resource
'https://dl.google.com/dl/android/maven2/androidx/recyclerview/recyclerview/1.0.0/recyclerview-1.0.0.aar'.
Could not HEAD
'https://dl.google.com/dl/android/maven2/androidx/recyclerview/recyclerview/1.0.0/recyclerview-1.0.0.aar'.
Remote host closed connection during handshake SSL peer shut
down incorrectly Consult IDE log for more details (Help | Show Log)
(12 s 965 ms)
This is the Project Build Gradle:
buildscript {
repositories {
jcenter()
mavenCentral()
google()
maven { url 'http://repo.maven.apache.org/maven2' }
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.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()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
and this is the Module:App build Gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
applicationId "com.aden.adenmarket"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.firebase:firebase-core:17.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.google.firebase:firebase-auth:18.0.0'
implementation 'com.google.firebase:firebase-firestore:20.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
}
apply plugin: 'com.google.gms.google-services'
Since no one answered my question, I'll post this answer. Maybe it'll help someone who may face an issue like this. I solved this problem by updating Firebase libraries and
updating these two dependencies to the last version and it worked successfully .
//module:app
implementation 'com.google.firebase:firebase-auth:18.1.0'
implementation 'com.google.firebase:firebase-firestore:20.1.0'
implementation 'com.google.firebase:firebase-core:17.0.1'
//project Build Graddle
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'com.google.gms:google-services:4.3.0'
I have an android app I want to import to my project as a module. The module syncs and compiles fine with apply plugin: 'com.android.application' However, there are classes from the module that I want to use in my project. To do this, it seems like I need to switch the gradle for the module to read apply plugin: 'com.android.library' as per this question. However, changing the module from an application to a library results in the following error log:
Unable to resolve dependency for ':app#debug/compileClasspath': Failed to transform file 'OCRTest-release.aar' to match attributes {artifactType=android-exploded-aar} using transform ExtractAarTransform
Unable to resolve dependency for ':app#debugAndroidTest/compileClasspath': Failed to transform file 'OCRTest-release.aar' to match attributes {artifactType=android-exploded-aar} using transform ExtractAarTransform
...
Unable to resolve dependency for ':app#releaseUnitTest/compileClasspath': Failed to transform file 'OCRTest-release.aar' to match attributes {artifactType=android-exploded-aar} using transform ExtractAarTransform
So far I have tried invalidating caches and restarting Android Studio, as that was a common suggestion. I have also seen it suggested to delete the .gradle file altogether. Is that safe to do? Also, the main thing I want to do is be able to use Java classes from the module in my app's activities. If there is a better way to go about doing this, let me know.
Here is the code for my .gradle files.
settings.gradle:
include ':app'
include ':OCRTest'
build.gradle(Project):
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gradle(Module: OCRTest): This is the module that contains classes I want to use in my app
apply plugin: 'com.android.library'
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
minSdkVersion 15
targetSdkVersion 27
}
buildTypes {
release {
minifyEnabled true
proguardFiles 'proguard.cfg'
}
}
}
dependencies {
implementation 'com.rmtheis:tess-two:9.0.0'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
}
build.gradle(Module: app):
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "org.noblis.thirdeye"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
cppFlags ""
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
matchingFallbacks = ['debug']
}
}
externalNativeBuild {
cmake {
path "CMakeLists.txt"
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.rmtheis:tess-two:9.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 project(path: ':OCRTest', configuration: 'default')
}
Remove the following line from build.gradle(Module:app):
implementation project(path: ':OCRTest', configuration: 'default')
Sync Gradle files.
Replace settings.gradle with this line:
include ':app', ':OCRTest'
Sync Gradle files again.
Now goto Project Structure>Add Module dependency and add module.
Hope this helps :)
This question already has answers here:
Failed to resolve: com.android.support:cardview-v7:26.0.0 android
(26 answers)
Closed 5 years ago.
I have just created a new Android Studio project for both Android Mobile and wear. The initial gradle build failed because I am getting several errors-
Error: Failed to resolve: com.android.support:support-v4:26.0.0
Error: Failed to resolve: com.android.support:percent:26.0.0
Error: Failed to resolve: com.android.support:recyclerview-v7:26.0.0
Error: Failed to resolve: com.android.support:support-annotations:26.0.0
With each error, I am given the option to Install repository and sync project, but nothing happens when I click on it. I have spent several hours trying to find why I am getting these errors, but I can't find any solutions. Does anybody know how to fix these very frustrating errors? Thank you!
build.gradle (project)
// 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"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gradle (mobile)
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.georgeberdovskiy.androidweartest"
minSdkVersion 23
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(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso- core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
wearApp project(':wear')
compile 'com.google.android.gms:play-services-wearable:11.0.4'
compile 'com.android.support:appcompat-v7:26+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile "com.android.support:support-core-utils:26+"
testCompile 'junit:junit:4.12'
}
build.gradle (wear)
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.georgeberdovskiy.androidweartest"
minSdkVersion 23
targetSdkVersion 26
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
provided 'com.google.android.wearable:wearable:2.0.4'
compile 'com.google.android.support:wearable:2.0.4'
compile 'com.google.android.gms:play-services-wearable:11.0.4'
compile "com.android.support:support-core-utils:26+"
}
I am sure that my version of Android Studio is updated, and all support repositories and APIs are installed.
I don't have an Android wear project, but I had the same problem when I wanted to upgrade the Support Library version for an existing project to 26.0.0. Since 26.0.0 the support libraries are available through Google's Maven repository. So I had to add the repository to my build. gradle file.
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
Check out https://developer.android.com/topic/libraries/support-library/setup.html for more details.
The following worked for me:
In the Application build.gradle considered to add following:
allprojects {
repositories {
maven {
url "https://maven.google.com"
}
}
}
in the Module build.gradle:
compileSdkVersion 26
buildToolsVersion "26.0.1"
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.google.android.gms:play-services-wearable:11.0.4'
compile 'com.android.support:support-compat:26.0.1'
compile 'com.android.support:support-v4:26.0.1'
compile 'com.google.android.gms:play-services:11.0.4'
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:support-annotations:26.0.1'
compile 'com.android.support:support-vector-drawable:26.0.1'
compile 'com.android.support:animated-vector-drawable:26.0.1'
compile 'com.android.support:design:26.0.1'
compile 'com.android.support:support-v13:26.0.1'
compile 'com.android.support:percent:26.0.1'
compile 'com.android.support:wear:26.0.1'
compile 'com.google.android.support:wearable:2.0.4'
provided 'com.google.android.wearable:wearable:2.0.4'
}
Either change your build tool version from 26.0.1 to 26.0.0 or you can replace 26.0.0 by 26.+ like below.
compile 'com.android.support:support-v4:26.0.0'
to
compile 'com.android.support:support-v4:26.+"
Do same with all...
Hope it helps.
Happy Coding! ^_^
For now, I fixed this with changing in the wear build.gradle:
compile 'com.google.android.support:wearable:2.0.3'
provided 'com.google.android.wearable:wearable:2.0.3'
It seems like the problem is com.google.android.support:wearable:2.0.4. With that, Using 26.0.1 build tools compiles fine. I haven't gone any further with this but it looks like a dependency problem related to a repository although that is really just a guess from the error messages.
Add the following dependencies in your app/build.gradle.
repositories {
maven { url 'https://maven.fabric.io/public' }
maven{url 'https://maven.google.com'}
}
Replace this:
compile 'com.android.support:recyclerview-v7:26.0.0'
With this
compile 'com.android.support:recyclerview-v7:26.0.0-alpha1'
Do same with all
Update - new version released
compile 'com.android.support:recyclerview-v7:26.1.0'
Add following dependency in your gradle
Replace
compile 'com.android.support:support-v4:26.0.0'
with
compile 'com.android.support:support-v4:25.0.0'
and Replace
compile 'com.android.support:appcompat-v7:26+'
with
compile 'com.android.support:appcompat-v7:25.0.0'
The reason that my project was giving me these errors was because I created the project for Android Platform 26. However, Wear currently doesn't support 26, and it is essential to change the target and compile SDK versions to 25 in the wear module of build.gradle.
Link to Android Developers documentation - https://developer.android.com/training/wearables/apps/creating.html#setting-up-a-phone
build.gradle (wear)
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.georgeberdovskiy.findmyphone"
minSdkVersion 25
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.support:wearable:2.0.3'
provided 'com.google.android.wearable:wearable:2.0.3'
compile 'com.google.android.gms:play-services-maps:11.0.4'
compile 'com.google.firebase:firebase-core:11.0.4'
compile 'com.google.firebase:firebase-database:11.0.4'
compile 'com.google.android.gms:play-services-wearable:11.0.4'
}
apply plugin: 'com.google.gms.google-services'
I only needed to change the compile and target SDK versions to 25 in the wear module. I left them as 26 for the mobile module.
This one worked for me
allprojects {
repositories {
jcenter()
google()
}
}
google() does the magic with the following configuration
Studio version : 3.0 beta 2
classpath 'com.android.tools.build:gradle:3.0.0-beta2'
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-rc-1-all.zip
I meet this problem, changing the build tool/ sdk version didn't work, clearly write compile version didn't work, off line build didn't work.
Finally I just change wearable version, and this problem gone.
provided 'com.google.android.wearable:wearable:2.0.4'
compile 'com.google.android.support:wearable:2.0.4'
to
provided 'com.google.android.wearable:wearable:2.0.2'
compile 'com.google.android.support:wearable:2.0.2'
By the way, I used offline building now because it is really fast when I check this issue.
I am quite new into Android World. I have added SMACK 4.1.0 for developing XMPP connectivity. While trying to build app, got below errors consistently. Tried googling but no fruitful results. Kindly provide your help.
Error:A problem occurred configuring project ':app'.
Could not resolve all dependencies for configuration ':app:_debugCompile'.
Could not resolve de.measite.minidns:minidns:[0.1,0.2).
Required by:bind:app:unspecified > org.igniterealtime.smack:smack-android:4.1.0 > org.igniterealtime.smack:smack-resolver-minidns:4.1.0
Failed to list versions for de.measite.minidns:minidns.
Unable to load Maven meta-data from https://jcenter.bintray.com/de/measite/minidns/minidns/maven-metadata.xml.
Could not GET 'https://jcenter.bintray.com/de/measite/minidns/minidns/maven-metadata.xml'.
peer not authenticated
Build.Gradle(Project:bind) file is :-
// Top-level build file where you can add configuration options common to
all sub-projects/modules.
buildscript {
repositories {
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots'
}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
Build.Gradle(Module:app) file is :-
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.example.sukeshsaxena.bind"
minSdkVersion 8
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
//Smak config for XMPP over TCP
compile "org.igniterealtime.smack:smack-android:4.1.0"
compile "org.igniterealtime.smack:smack-tcp:4.1.0"
}
Let me know if anything else is required.
Newest version of
de.measite.minidns:minidns is 0.1.7
org.igniterealtime.smack:smack-resolver-minidns is 4.1.3.
Try to use
de.measite.minidns:minidns:0.1.7
org.igniterealtime.smack:smack-resolver-minidns:4.1.3
in your gradle file.