'Could not resolve com.amitshekhar.android:android-networking:1.0.2
i am trying to import network library , but android studio shows up with this meessage:ERROR: Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.amitshekhar.android:android-networking:1.0.2.
here is the build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.example.myfaild"
minSdkVersion 16
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:1.1.3'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.amitshekhar.android:android-networking:1.0.2'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
Solution 1:[1]
I know this is the old question, but I saw such a problem after removing jcenter() from repositories in gradle file:
repositories {
google()
jcenter()
}
Solution 2:[2]
Try this
compile 'com.amitshekhar.android:android-networking:1.0.2'
When using it with Jackson Parser
implementation 'com.amitshekhar.android:jackson-android-networking:1.0.2'
When using it with RxJava
implementation 'com.amitshekhar.android:rx-android-networking:1.0.2'
When using it with RxJava2
compile 'com.amitshekhar.android:rx2-android-networking:1.0.2'
Solution 3:[3]
add this line in gradle.properties:
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
Solution 4:[4]
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
this worked for me ,i had to add jitpack.io
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Evgeny |
Solution 2 | |
Solution 3 | Youness Goudi |
Solution 4 | David Kiarie Macharia |