升級Android Studio 3.0,報Unable to resolve dependency

Android Studio 3.0正式版已發佈,於是趕緊升級體驗了一波。不出意外,果然項目有兼容問題,什麼問題呢?日誌如下:

Error:Unable to resolve dependency for ':app@local/compileClasspath': Could not resolve project :multiAdapter.

不明所以,那我們來看下詳細日誌

Unable to find a matching configuration of project :multiAdapter:
     - Configuration 'debugApiElements':
         - Required com.android.build.api.attributes.BuildTypeAttr 'local' and found incompatible value 'debug'.

localdebug不兼容,於是在 StackOverFlow 上查找了一波。原因是在主項目中有一個變種local,而在library中是沒有對應的。build.gradle 修改如下:

local {
...
matchingFallbacks = ['debug']
}

然後 sync project
問題 OK
Just mark !

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章