Failed to resolve: com.android.support:appcompat-v7:27.0.1問題解決

來源:互聯網
上載者:User

標籤:nim   nbsp   一起努力   man   pil   oar   http   big   3.1   

今天,在毫無徵兆的情況下AndroidStudio又抽風了,搞了大半天,試了網上眾多方案,終於解決了這個問題。咱們一步一步來

第一步:這是最開始的bug 
Error:Failed to resolve: com.android.support:support-annotations:27.0.1 
Install Repository and sync project
Open File
Show in Project Structure dialog 
Error:Failed to resolve: com.android.support:appcompat-v7:27.0.1 
Install Repository and sync project
Open File
Show in Project Structure dialog

這個問題可以通過修改project的gradle,添加maven { url “https://maven.google.com” }即可, 
 
同時,開啟SDK Manager 
 
檢查repository是否已經下載,並安裝 

第二步:問題還是沒有解決,甚至報錯,習慣就好 
Error:A problem occurred configuring project ‘:app’.

Could not resolve all dependencies for configuration ‘:app:_debugApkCopy’. 
Could not find com.android.support:appcompat-v7:27.0.1. 
Required by: 
MakerOnly0818:app:unspecified 
MakerOnly0818:app:unspecified > com.gyf.barlibrary:barlibrary:2.1.4 
MakerOnly0818:app:unspecified > MakerOnly0818:imagepicker:unspecified 
Could not find com.android.support:appcompat-v7:27.0.1. 
Required by: 
MakerOnly0818:app:unspecified > com.roughike:bottom-bar:1.3.4 
Could not find com.android.support:appcompat-v7:27.0.1. 
Required by: 
MakerOnly0818:app:unspecified > com.bigkoo:convenientbanner:2.0.5 
Could not find com.android.support:appcompat-v7:27.0.1. 
Required by: 
MakerOnly0818:app:unspecified > com.zhy:flowlayout-lib:1.0.3 
Could not find com.android.support:support-v4:27.0.1. 
Required by: 
MakerOnly0818:app:unspecified > MakerOnly0818:slidingmenu:unspecified 
Could not find com.android.support:appcompat-v7:27.0.1. 
Required by: 
MakerOnly0818:app:unspecified > cn.yipianfengye.android:zxing-library:2.2 
Could not find com.android.support:support-v4:27.0.1. 
Required by: 
MakerOnly0818:app:unspecified > cn.yipianfengye.android:zxing-library:2.2 
Could not find com.android.support:appcompat-v7:27.0.1. 
Required by: 
MakerOnly0818:app:unspecified > me.weyye.hipermission:library:1.0.3 
Could not find com.android.support:appcompat-v7:27.0.1. 
Required by: 
MakerOnly0818:app:unspecified > MakerOnly0818:NIM_Android_UIKit-master:unspecified 
MakerOnly0818:app:unspecified > MakerOnly0818:NIM_Android_UIKit-master:unspecified > com.android.support:design:25.0.1 
Could not find com.android.support:support-v4:27.0.1. 
Required by: 
MakerOnly0818:app:unspecified > com.twitter.sdk.android:tweet-ui:3.1.0 
MakerOnly0818:app:unspecified > com.twitter.sdk.android:twitter-mopub:3.1.0 > com.mopub:mopub-sdk:4.11.0 
MakerOnly0818:app:unspecified > com.twitter.sdk.android:twitter-mopub:3.1.0 > com.mopub:mopub-sdk:4.11.0 > com.mopub:mopub-sdk-base:4.11.0 
MakerOnly0818:app:unspecified > com.twitter.sdk.android:twitter-mopub:3.1.0 > com.mopub:mopub-sdk:4.11.0 > com.mopub:mopub-sdk-banner:4.11.0 
MakerOnly0818:app:unspecified > com.twitter.sdk.android:twitter-mopub:3.1.0 > com.mopub:mopub-sdk:4.11.0 > com.mopub:mopub-sdk-interstitial:4.11.0 
MakerOnly0818:app:unspecified > com.twitter.sdk.android:twitter-mopub:3.1.0 > com.mopub:mopub-sdk:4.11.0 > com.mopub:mopub-sdk-rewardedvideo:4.11.0 
MakerOnly0818:app:unspecified > com.twitter.sdk.android:twitter-mopub:3.1.0 > com.mopub:mopub-sdk:4.11.0 > com.mopub:mopub-sdk-native-static:4.11.0 
MakerOnly0818:app:unspecified > com.twitter.sdk.android:twitter-mopub:3.1.0 > com.mopub:mopub-sdk:4.11.0 > com.mopub:mopub-sdk-native-video:4.11.0 
這個問題,可以通過注釋掉module的gradle中的androidTestCompile部分代碼即可。 
第三步:然後又爆出這個問題,問題已經好轉,報錯資訊越來越少了哈哈 
Error:(15, 21) No resource found that matches the given name: attr ‘android:keyboardNavigationCluster’. 
通過下面這個連結的一個回答解決了,stackoverflow可能打不開,下面我介紹一下:就是解決方案 
https://stackoverflow.com/questions/45301203/no-resource-found-that-matches-the-given-name-attr-androidkeyboardnavigationc/45307273

的 
 
簡單說就是修改module的gradle 
1.把compileSdkVersion改26 
2.buildToolsVersion改”26.0.1” 
3.compile ‘com.android.support:appcompat-v7:26.0.1’替換之前的版本 
4.sync後會提示下載更新,完成後問題就解決了。

雖說問題解決了,但是也許解決方案並不是萬能的,如有其他情況未能解決也歡迎評論,同時qq群492462202歡迎交流。感覺有協助就贊助一下吧 ! 

 

引用原文:78732460

 

寫部落格是為了記住自己容易忘記的東西,另外也是對自己工作的總結,文章可以轉載,無需著作權。希望盡自己的努力,做到更好,大家一起努力進步!

如果有什麼問題,歡迎大家一起探討,代碼如有問題,歡迎各位大神指正!

Failed to resolve: com.android.support:appcompat-v7:27.0.1問題解決

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.