2017-07-30 45 views
0

我打开了我的项目,它显示我一些错误,我现在开始在Android的世界,所以我不知道如何做到这一点。我按了安装版本库并同步项目但这没有做任何事情。库缺失。 “安装和同步”不起作用

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

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

而这些都是错误

enter image description here

我怎样才能解决呢?

+0

可能是排除com.android.support –

+1

@BrunoFerreira你是什么意思? –

+0

所以你有行排除组com.androis.support所以gradle不使用库的名称com.android.support,可能是因为你有错误 –

回答

0

第一个选项是点击如果dosent工作,那么你需要从依赖添加该存储库手动,转到文件安装库和同步工程, >项目结构>依赖 点击+>图书馆依赖 和搜索缺失的存储库 enter image description here

+0

我做你告诉我的,但是这不能解决问题,我开始一个新的项目,当开始(没有移动任何东西)开始失败时,我有android studio –

+0

的最后一个版本,那么你的项目出了问题,你是否尝试关闭它并重新打开? 尝试更新Android工作室,这里是一个gradle这个类似于你尝试比较移除部,看看它是否工作 –

+0

的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 { 释放{ minifyEnabled假 proguardFil ES getDefaultProguardFile( 'proguard的-android.txt'), 'proguard-rules.pro' } } } –