2016-03-04 63 views
0
Error:Failed to resolve: com.android.support:appcompat-v7:23.2.0 

這是我在嘗試編譯我的android應用程序時得到的錯誤。我環顧四周已經問過這個問題,並嘗試更新我的SDK,Android的重新Studio和CHANE許多問題:compile (com.android.support:appcompat-v7:+)並沒有什麼作品,Android的工作室仍然抱怨說,他無法解決。有人知道它爲什麼會發生?這是我的搖籃文件:解決Android相關問題的解決方法

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 23 
    buildToolsVersion '23.0.2' 


    lintOptions { 
     abortOnError false 
    } 

    defaultConfig { 
     applicationId "com...." 
     minSdkVersion 16 
     targetSdkVersion 23 
     versionCode 35 
     versionName "1.5" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    testCompile 'junit:junit:4.12' 

    compile 'com.google.android.gms:play-services-ads:8.4.0' 
    compile 'com.android.support:cardview-v7:23.2.0' 
    compile 'com.android.support:design:23.2.0' 
    compile 'com.google.android.gms:play-services-appindexing:8.4.0' 
    compile 'com.android.support:appcompat-v7:23.2.0' 
    compile project(':library') 

    compile 'net.steamcrafted:materialiconlib:1.0.8' 
    compile 'com.pes.materialcolorpicker:library:1.0.2' 
    compile 'com.nineoldandroids:library:2.4.0' 
    compile 'com.daimajia.easing:library:[email protected]' 
    compile 'com.daimajia.androidanimations:library:[email protected]' 

    compile('de.psdev.licensesdialog:licensesdialog:1.8.0') 

    compile 'com.github.paolorotolo:appintro:3.4.0' 

    compile 'com.github.deano2390:MaterialShowcaseView:1.0.6' 

    compile "com.oneskyapp:screenshot:0.7.4" 

    compile('com.mikepenz:materialdrawer:[email protected]') { 
     transitive = true 
    } 
} 

我的SDK附加功能都安裝: enter image description here

+0

的可能重複http://stackoverflow.com/questions/29284236 /失敗到決心-COM-Android的supportappcompat-v722和-COM-Android的supportre –

+0

我試着做他們說什麼,我peroblem保持不變。 –

回答

0

改變,如果你正在使用buildToolsVersion '23.0.2'然後用

compile 'com.android.support:appcompat-v7:23.1.1' 
compile 'com.android.support:design:23.1.1' 
compile 'com.android.support:support-v4:23.1.1' 

如果你想用「23.2 .0「PLZ完全更新您的SDK。

編輯 Check Check this too

是您的SDK這個樣子?如果是,首先清理你的代碼並重新構建。

+0

「忽略未知的包過濾器'build-tools-23.2.0'警告:包過濾器刪除了所有包,沒有什麼可安裝的,請考慮在沒有包過濾器的情況下再次嘗試更新。當我嘗試去做 –

+0

@ Y.Franco檢查編輯答案。 –

+0

感謝您的快速答覆,我試了一下,莫名其妙的錯誤仍然是相同的:「錯誤:無法解析:com.android.support:appcompat-v7:23.2.0」,即使沒有這樣的行在我的gradle文件中。 –

1

檢查您的SDK管理器。大多數「正常」支持組件都包含在支持存儲庫中。 「Android支持庫」是不夠的。這將安裝獨立版本,而不是Gradle使用的版本。

pic

+0

I用sdk上的額外圖像編輯我的問題。所有這些都已安裝。 –

0

至於你說你的Android工作室都更新。然後,可以用很多原因會出現此問題......

1..Make確保你有適當的互聯網連接時同步,重建或運行項目。因爲您正在使用許多遠程依賴項(如(compile 'com.android.support:appcompat-v7:23.2.0')),並且在這種情況下,gradle會下載所有遠程依賴項。

2。由於您使用的本地和遠程的依賴關係,如果你有程式的libs文件夾中的任何程序兼容性V7在這種情況下,可能會發生,因爲一個庫版本的兼容性這一問題。

// Remote binary dependency 
compile 'com.android.support:appcompat-v7:23.2.0' 

// Local binary dependency 
compile fileTree(dir: 'libs', include: ['*.jar']) 
1

請在下面的模式命名您的支持庫依賴和檢查,因爲這可能會幫助你。還有,而不是硬編碼挑選最新的更新。

編譯 'com.android.support:appcompat-v7:$supportLibraryVersion' 編譯 'com.android.support:support-v4:$supportLibraryVersion'