Could not resolve com.amitshekhar.android:android-networking:1.0.2

huangapple go评论62阅读模式
英文:

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'
}

答案1

得分: 7

我知道这是一个旧问题,但在gradle文件中删除jcenter()后,我看到了这样一个问题:

repositories {
    google()
    jcenter()
}
英文:

I know this is the old question, but I saw such a problem after removing jcenter() from repositories in gradle file:

repositories {
        google()
        jcenter()
    }

答案2

得分: 1

这对我来说有效,我不得不添加jitpack.io。

英文:
allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

this worked for me ,i had to add jitpack.io

答案3

得分: 0

尝试这个

compile 'com.amitshekhar.android:android-networking:1.0.2'

当与Jackson解析器一起使用时

implementation 'com.amitshekhar.android:jackson-android-networking:1.0.2'

当与RxJava一起使用时

implementation 'com.amitshekhar.android:rx-android-networking:1.0.2'

当与RxJava2一起使用时

compile 'com.amitshekhar.android:rx2-android-networking:1.0.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'

答案4

得分: 0

add this line in gradle.properties:

自动将第三方库转换为使用 AndroidX

android.enableJetifier=true

英文:

add this line in gradle.properties:

# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true

huangapple
  • 本文由 发表于 2020年7月29日 14:15:55
  • 转载请务必保留本文链接:https://go.coder-hub.com/63147411.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定