I tried to sync my project in android studio with gradle files but it failed and I got the above message "Grade sync failed: Unresolved dependencies".
I also got these errors in the build tab:
ERROR: Unable to resolve dependency for ':app#debugUnitTest/compileClasspath': Could not resolve androidx.fragment:fragment:[1.2.0].
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app#debugAndroidTest/compileClasspath': Could not resolve androidx.fragment:fragment:[1.2.0].
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve androidx.fragment:fragment:[1.2.0].
Show Details
Affected Modules: app
These are my dependencies in build.gradle (Module:app)
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.2.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.navigation:navigation-fragment-ktx:2.2.1'
implementation 'androidx.navigation:navigation-ui-ktx:2.2.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.5'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.5'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.2.0'
Hey I am not very much sure of this I didn't find any dependency for fragment
dependencies {
def fragment_version = "1.2.4"
// Java language implementation
implementation "androidx.fragment:fragment:$fragment_version"
// Kotlin
implementation "androidx.fragment:fragment-ktx:$fragment_version"
// Testing Fragments in Isolation
implementation "androidx.fragment:fragment-testing:$fragment_version"
}
Put this in the dependencies section
Related
After newing project, I met a error that I can not handle when I am tring to add a gradle in app/build.gradle
Please help me!
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation("com.squareup.okhttp3:okhttp:4.3.1") //that's the thing I want
}
ERROR
CONFIGURE SUCCESSFUL in 57s ERROR: Unable to resolve dependency for
':app#debug/compileClasspath': Could not download okhttp.jar
(com.squareup.okhttp3:okhttp:4.3.1) Show Details Affected Modules: app
ERROR: Unable to resolve dependency for ':app#debug/compileClasspath':
Could not download okio.jar (com.squareup.okio:okio:2.4.1) Show
Details Affected Modules: app
From this answer: you can add it like this
implementation group: 'com.squareup.okhttp3', name: 'okhttp', version: '3.8.0'
and to get dependencies from maven you need to add this to your repositories
repositories {
mavenCentral()
}
There are some problems with my build.gradle(app). I'm trying to programms a drone but i can't do anything because of this error. In fact i don't have access do the repo for the version in the end of the line conserned.
ERROR: Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve com.github.YUNEEC.Yuneec-SDK-Android:sdk:3.5.2.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app#debugAndroidTest/compileClasspath': Could not resolve com.github.YUNEEC.Yuneec-SDK-Android:sdk:3.5.2.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app#debugUnitTest/compileClasspath': Could not resolve com.github.YUNEEC.Yuneec-SDK-Android:sdk:3.5.2.
Show Details
Affected Modules: app
Here's dependecies section of my build.gradle
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.github.YUNEEC:Yuneec-SDK-Android:v3.5.2'
}
I bought this app code in codecanyon, but the author is not answering. That's why I am asking here. I don't know about android, I'm simply following their tutorial. Here is the my problem. Can any one please help?
gradle version
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
This is the error I am getting
ERROR: Failed to resolve: com.google.firebase:firebase-core:17.3.99
Show in Project Structure dialog
Affected Modules: app
ERROR: Failed to resolve: com.google.android.gms:play-services-ads:17.3.99
Show in Project Structure dialog
Affected Modules: app
ERROR: Failed to resolve: com.google.firebase:firebase-messaging:17.3.99
Show in Project Structure dialog
Affected Modules: app
ERROR: Failed to resolve: com.google.android.gms:play-services-location:17.3.99
Show in Project Structure dialog
Affected Modules: app
ERROR: Failed to resolve: com.google.android.gms:play-services-ads-identifier:17.3.99
Show in Project Structure dialog
Affected Modules: app
ERROR: Failed to resolve: com.google.android.gms:play-services-base:17.3.99
Show in Project Structure dialog
Affected Modules: app
here https://firebase.google.com/support/release-notes/android, there are the latest firebase release. About firebase-core, latest version is 17.2.1.
as i saw in you app level build.gradle you use "compile" for your dependencies, you should change all this compile by implementation and update you're dependencies version to the latest release like that
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support:support-v4:26.1.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.android.support:cardview-v7:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.squareup.retrofit2:retrofit:2.6.2'
implementation 'com.squareup.retrofit2:converter-gson:2.6.2'
implementation 'com.squareup.okhttp3:logging-interceptor:4.2.1'
implementation 'com.squareup.okhttp3:okhttp:4.2.1'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.squareup.okhttp:okhttp:2.2.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.facebook.stetho:stetho:1.1.1'
implementation 'com.facebook.stetho:stetho-okhttp:1.1.1'
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'com.google.firebase:firebase-core:17.2.1'
implementation 'com.onesignal:OneSignal:3.12.2'
implementation files('libs/YouTubeAndroidPlayerApi.jar')
implementation 'org.jsoup:jsoup:1.10.1'
implementation 'com.google.android.gms:play-services-ads:18.2.0'
implementation 'com.google.firebase:firebase-messaging:20.0.0'
}
you should also use the latest release of google-services ; update your project-level build.gradle
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:4.3.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
update gradle version in gradle.properties file:
#Mon May 21 12:39:33 IST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
you can find all the firebase setup here https://firebase.google.com/docs/android/setup
This error only happening in android studio 3.5. I don't know why because I have used this same library in my other projects but after upgrading to the latest android studio which is 3.5, I am having this issue. I have checked and tried some answers but I was unable to solve it.
The error:
ERROR: Failed to resolve: com.github.hatamiarash7:RTL-Toast:1.3
Show in Project Structure dialog
Affected Modules: app
The library:
implementation 'com.github.hatamiarash7:RTL-Toast:1.3'
My apps dependencies section:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.android.support:appcompat-v7:28.+'
implementation 'com.android.support:design:28.+'
implementation 'com.android.support:cardview-v7:28.+'
implementation 'com.android.support:recyclerview-v7:28.+'
// circle image view
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'com.github.hatamiarash7:RTL-Toast:1.3'
implementation 'androidx.appcompat:appcompat:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
You must define JitPack in your root build.gradle:
allprojects {
repositories {
...
maven {
url 'https://jitpack.io'
}
}
}
and you will use this dependency:
implementation 'com.github.hatamiarash7:RTL-Toast:1.3'
There are some problems with my build.gradle file of my Android Studio Project, I'm unable to resolve it.
Whenever i build project following errors occur:
ERROR: Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve com.github.AnchorFreePartner.hydra-sdk-android:sdk:2.3.0.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app#debugAndroidTest/compileClasspath': Could not resolve com.github.AnchorFreePartner.hydra-sdk-android:sdk:2.3.0.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app#debugUnitTest/compileClasspath': Could not resolve com.github.AnchorFreePartner.hydra-sdk-android:sdk:2.3.0.
Show Details
Affected Modules: app
Here's dependecies section of my build.gradle
dependencies {
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.github.AnchorFreePartner.hydra-sdk-android:sdk:2.3.0'
implementation "com.android.support:cardview-v7:${androidSupportLibraryVersion}"
implementation "com.android.support:recyclerview-v7:${androidSupportLibraryVersion}"
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
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.google.android.gms:play-services-ads:17.2.0'
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
implementation 'com.android.billingclient:billing:1.2.2'
}
project level build.gradle
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
maven { url 'https://maven.google.com' }
}
}
use implementation 'com.github.AnchorFreePartner:hydra-sdk-android:2.3.0'
instead of
implementation 'com.github.AnchorFreePartner.hydra-sdk-android:sdk:2.3.0'
link