【问题标题】:Libraries missing. "Install and Sync" not working图书馆不见了。 “安装和同步”不起作用
【发布时间】:2017-07-30 21:10:47
【问题描述】:

我打开了我的项目,它显示了一些错误,我现在开始使用 Android 世界,所以我不知道该怎么做。我按下 install Repository and sync project 但这没有任何作用。

这是我项目中的所有版本。

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "26.0.0"
    defaultConfig {
        applicationId "mx.com.dtss.carritocompras"
        minSdkVersion 15
        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(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:3.0.0', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    compile files('libs/ksoap2-android-assembly-3.0.0-jar-with-dependencies.jar')
    compile group: 'com.google.code.gson', name: 'gson', version: '2.3'
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.support:design:25.3.1'
    compile 'com.android.support:cardview-v7:25.3.1'
    compile 'com.squareup.picasso:picasso:2.5.2'
    testCompile 'junit:junit:4.12'
}

这些都是错误

我该如何解决?

【问题讨论】:

  • 可能是排除com.android.support
  • @BrunoFerreira 你是什么意思?
  • 所以你有行排除组com.androis.support所以gradle不使用名称为com.android.support的库,可能是因为你有错误
  • 嗯,让我看看是否可以。
  • 我读过一个类似我stackoverflow.com/questions/44691858/…的问题,但我不能解决我的哈哈

标签: android android-gradle-plugin


【解决方案1】:

第一个选项是单击安装存储库并同步项目, 如果该剂量有效,那么您需要手动从依赖项中添加存储库,转到文件 > 项目结构 > 依赖项 单击 + > 库依赖项 并搜索丢失的存储库 enter image description here

【讨论】:

  • 我照你说的做,但这并不能解决问题,我开始了一个新项目,当开始(没有移动任何东西)在同样的事情上失败时,我有最后一个版本安卓工作室的
  • 那么您的项目有问题,您是否尝试关闭它并重新打开?尝试更新android studio,这里有一个类似于你的gradle尝试比较和删除部分,看看它是否有效
  • android { compileSdkVersion 25 buildToolsVersion "25.0.3" defaultConfig { applicationId "com.claudiaedelman.shecodes.lecture.screenactivationreceiver" minSdkVersion 15 targetSdkVersion 22 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test. runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } }
  • 依赖项 { 编译 fileTree(dir: 'libs', include: ['*.jar']) androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2' ,{排除组:'com.android.support',模块:'support-annotations'})编译组:'com.google.code.gson',名称:'gson',版本:'2.3'编译'com. android.support:design:25.3.1' 编译 'com.android.support:cardview-v7:25.3.1' 编译 'com.squareup.picasso:picasso:2.5.2' 编译 'com.android.support:appcompat- v7:25.3.1' 编译 'com.android.support.constraint:constraint-layout:1.0.2' testCompile 'junit:junit:4.12'}
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-02-26
  • 2020-11-09
  • 2013-10-15
  • 2014-11-12
相关资源
最近更新 更多