首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法在android studio中导入某些库

无法在android studio中导入某些库
EN

Stack Overflow用户
提问于 2018-09-09 17:16:07
回答 3查看 437关注 0票数 0

我正在尝试导入一些库,比如毕加索等,但Android Studio显示了这条消息。

这是build.gradle(模块:应用程序)

代码语言:javascript
复制
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
    applicationId "com.example.mypc.urumcafe"
    minSdkVersion 17
    targetSdkVersion 25
    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(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', 
{
    exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
compile 'com.android.volley:volley:1.0.0'
compile 'com.amitshekhar.android:android-networking:1.0.1'
compile 'com.android.support:design:25.3.1'
testCompile 'junit:junit:4.12'
}

我只想导入'com.amitshekhar.android:android-networking:1.0.1'but,因为你可以在上传的图像中看到“无法解决”错误。那么我如何修复这个错误?毕加索的库也是如此。谢谢。

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2018-09-09 17:23:23

将您的构建工具版本更新为27.0.3,并将相应的依赖项更新为版本27。

这是更新的build.gradle,它工作得很好。

代码语言:javascript
复制
apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    buildToolsVersion "27.0.3"
    defaultConfig {
        applicationId "com.example.mypc.urumcafe"
        minSdkVersion 17
        targetSdkVersion 27
        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(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2',
            {
                exclude group: 'com.android.support', module: 'support-annotations'
            })
    compile 'com.android.support:appcompat-v7:27.1.1'
    compile 'com.android.support.constraint:constraint-layout:2.+'
    compile 'com.android.volley:volley:1.0.0'
    compile 'com.amitshekhar.android:android-networking:1.0.1'
    compile 'com.android.support:design:27.1.1'
    testCompile 'junit:junit:4.12'
}
票数 1
EN

Stack Overflow用户

发布于 2018-09-09 17:24:03

该库的最新版本是1.0.2。使用此命令,然后重试:

代码语言:javascript
复制
com.amitshekhar.android:android-networking:1.0.2
票数 0
EN

Stack Overflow用户

发布于 2018-09-09 17:28:51

您可能缺少Maven Central (或用于v1.0.2jitpack.io )存储库:

代码语言:javascript
复制
allprojects {
    repositories {
        google()
        mavenCentral()
        jcenter() 
    }
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52243040

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档