Gradle Unable to resolve dependency for ':app#debug/compileClasspath': - android

Per the documentation on GitHub my build.gradle(app) is:
repositories {
jcenter()
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
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:26.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.dubsmash.volley:library:2.0.1'
compile 'ca.mimic:oauth2library:2.3.0'
compile 'com.github.kittinunf.fuel:fuel:<latest-version>' //for JVM
compile 'com.github.kittinunf.fuel:fuel-android:<latest-version>' //for Android
compile 'com.github.kittinunf.fuel:fuel-livedata:<latest-version>' //for LiveData support
compile 'com.github.kittinunf.fuel:fuel-rxjava:<latest-version>' //for RxJava support
compile 'com.github.kittinunf.fuel:fuel-gson:<latest-version>' //for Gson support
compile 'com.github.kittinunf.fuel:fuel-jackson:<latest-version>' //for Jackson support
}
And when I try to build Gradle throws the following error for all the fuel components:
Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve com.github.kittinunf.fuel:fuel-livedata:<latest-version>.
Could not resolve com.github.kittinunf.fuel:fuel-livedata:<latest-version>.
Required by:
project :app
> No cached version of com.github.kittinunf.fuel:fuel-livedata:<latest-version> available for offline mode.

You can't actually write "<latest-version>" in a gradle compile block.
You have to substitute it for the version number.
So it'd be something like:
compile 'com.github.kittinunf.fuel:fuel:2.2.0'
Again, substitute the version number for the version you want.

Related

ERROR: Failed to resolve: com.github.hatamiarash7:RTL-Toast:1.3

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'

Program type already present: com.google.android.gms.internal.measurement.zzst"

I was trying to upgrade my android compile and target version to 27 . But the dependencies always had issue . Currently the added dependencies looks like this but still some problem persists .
the dependencies in my gradle file looks like this.
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.google.android.gms:play-services-ads:17.1.3'
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 'org.jsoup:jsoup:1.10.3'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation'com.google.firebase:firebase-config:16.1.0'
I tried modifying the gradle dependencies but that isnt helping.
I want to upgrade the app gradle to version 27 but then still the problem persists.
Please help!

mapbox Add Navigation Dependencies

I'm attempting to follow the mapbox tutorials for the Navigation API.
In my app build.gradle I've added:
implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.11.1'
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:support-core-utils:25.4.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.11.1'
implementation 'com.android.support:appcompat-v7:25.4.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:25.4.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:5.5.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'
}
But the gradle build could not resolve. What is the situation? I thought all I needed was to add the dependencies block and it would acquire the dependency. I've already set my proxy settings. It acquires the other mapbox dependencies.
Error Message:
Error:Could not resolve all files for configuration ':app:debugCompileClasspath'.
Could not resolve com.mapbox.mapboxsdk:mapbox-android-navigation:0.11.1.
Required by:
project :app
Could not resolve com.mapbox.mapboxsdk:mapbox-android-navigation:0.11.1.
Could not get resource 'https://dl.google.com/dl/android/maven2/com/mapbox/mapboxsdk/mapbox-android-navigation/0.11.1/mapbox-android-navigation-0.11.1.pom'.
Could not GET 'https://dl.google.com/dl/android/maven2/com/mapbox/mapboxsdk/mapbox-android-navigation/0.11.1/mapbox-android-navigation-0.11.1.pom'.
dl.google.com
Could not resolve com.mapbox.mapboxsdk:mapbox-android-navigation:0.11.1.
Could not get resource 'https://jcenter.bintray.com/com/mapbox/mapboxsdk/mapbox-android-navigation/0.11.1/mapbox-android-navigation-0.11.1.pom'.
Could not GET 'https://jcenter.bintray.com/com/mapbox/mapboxsdk/mapbox-android-navigation/0.11.1/mapbox-android-navigation-0.11.1.pom'.
jcenter.bintray.com
Could not resolve com.mapbox.mapboxsdk:mapbox-android-navigation:0.11.1.
Could not get resource 'https://maven.google.com/com/mapbox/mapboxsdk/mapbox-android-navigation/0.11.1/mapbox-android-navigation-0.11.1.pom'.
Could not GET 'https://maven.google.com/com/mapbox/mapboxsdk/mapbox-android-navigation/0.11.1/mapbox-android-navigation-0.11.1.pom'.
maven.google.com
// You Can Use This Lib. For Android Studio 3.0.1
implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.9.0'
implementation('com.mapbox.mapboxsdk:mapbox-android-navigation-ui:0.9.0') {
transitive = true
}
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:5.3.2'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation('com.mapbox.mapboxsdk:mapbox-android-sdk:5.3.2#aar') {
transitive = true
}
// It's Including Basic Needed Dependencies
classpath "com.android.tools.build:gradle:4.1.3"
classpath 'com.google.dagger:hilt-android-gradle-plugin:2.36'
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.3.5"
// build.gradle
// RX
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
implementation 'io.reactivex.rxjava2:rxjava:2.2.10'
//Network
implementation "com.squareup.retrofit2:retrofit:2.9.0"
implementation "com.squareup.retrofit2:adapter-rxjava2:2.9.0"
implementation "com.squareup.retrofit2:converter-gson:2.9.0"
implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.12.0'
// GSON
implementation 'com.google.code.gson:gson:2.8.6'
// LifeCycle
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.0'
// Navigatiopn
implementation "androidx.navigation:navigation-compose:2.4.0-alpha03"
/// navigation component
implementation "androidx.navigation:navigation-fragment:2.3.5"
implementation "androidx.navigation:navigation-ui:2.3.5"
// Hilt
implementation "com.google.dagger:hilt-android:2.37"
annotationProcessor 'com.google.dagger:hilt-android-compiler:2.36'

Error:Error converting bytecode to dex: Cause: com.android.dex.DexException: Multiple dex files define Lokhttp3/internal/ws/WebSocketReader;

I am facing above error of multidex. I have tried to resolved with multiple way as I know and I tried to find similar issues. There is many issues related multidex but all the scenario trying to apply in my code but not resolved my problem.
My Dependencies are as below :
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:support-core-utils:26.1.0'
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:0.5'
androidTestImplementation 'com.android.support.test.espresso:espresso-
core:3.0.1'
implementation 'com.intuit.sdp:sdp-android:1.0.4'
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'io.socket:socket.io-client:0.8.2'
implementation files('libs/client-sdk.aar')
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation('com.crashlytics.sdk.android:crashlytics:2.9.1#aar') {
transitive = true;
}
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
compile 'com.squareup.retrofit2:adapter-rxjava:2.3.0'
compile 'com.android.support:multidex:1.0.1'
implementation 'com.android.support:support-annotations:28.0.0-alpha1'}
I am getting this issue due to WebSocketReader class from multiple dependency as I can understand this issue and it's coming from retrofit. But not sure about it.
Thanks in advance.

Version conflict between google-services and android-gms

I have module gradle dependencies like this
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:+'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-core:11.6.2'
implementation 'com.google.firebase:firebase-messaging:11.6.2'
implementation 'com.google.android.gms:play-services-gcm:11.6.2'
implementation 'com.google.android.gms:play-services-ads:11.6.2'
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'
}
and project gradle like this
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.1.2'
}
when i am syncing my project with gradle i am getting execution failed error
Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 11.4.2.
But why? I have target SDK of 27, i am everywhere where i can already set to use latest packages, why studio asks me to downgrade com.google.android.gms to 11.4.2 ?
SDK Tools are
As mentioned by the OP, the line
apply plugin: 'com.google.gms.google-services'
must be moved to the bottom of the app module build gradle file. This line should come after all google gms dependencies.
Instead of
implementation 'com.android.support:appcompat-v7:+'
...
implementation 'com.google.firebase:firebase-core:11.6.2'
implementation 'com.google.firebase:firebase-messaging:11.6.2'
implementation 'com.google.android.gms:play-services-gcm:11.6.2'
implementation 'com.google.android.gms:play-services-ads:11.6.2'
use
implementation 'com.android.support:appcompat-v7:27.0.2'
...
implementation 'com.google.firebase:firebase-core:11.8.0'
implementation 'com.google.firebase:firebase-messaging:11.8.0'
implementation 'com.google.android.gms:play-services-gcm:11.8.0'
implementation 'com.google.android.gms:play-services-ads:11.8.0'

Categories

Resources