2017-07-30 42 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' } } } –