incremental out directory should be set to aar output directory

轉載請以鏈接形式標明出處:
本文出自:103style的博客


Android Studio : 3.5.2

編譯沒問題,運行的時候 報錯信息如下:

Cause: failure, see logs for details.
incremental out directory should be set to aar output directory.

然後開始google, 有個類似的問題 stackoverflow-questions-53008162,
說是 dataBinding 的問題, 說是直接註釋掉,然而並沒有卵用…

後面經過多方查閱, 最終在 data-binding 的官方介紹 中看到使用 dataBinding 只需要配置:

android {
    ...
    dataBinding {
        enabled = true
    }
}

然後我發現功能裏面多了一個
annotationProcessor 'com.android.databinding:compiler:2.3.0'
然後註釋掉這個,運行就可以了,就可以了…

修改 build.gradle

...
android {
    ...
    dataBinding {
        enabled = true
    }    
}
dependencies {
    ...
    annotationProcessor 'com.android.databinding:compiler:2.3.0'
}

...
android {
    ...
    dataBinding {
        enabled = true
    }    
}
dependencies {
    ...
    //annotationProcessor 'com.android.databinding:compiler:2.3.0'
}

維護老項目是真的難受…

類似的問題可以在 build.gradle 中 搜索 annotationProcessor 這個,然後看下最新的官方介紹這個庫的使用方法。


如果覺得不錯的話,請幫忙點個讚唄。

以上


掃描下面的二維碼,關注我的公衆號 Android1024, 點關注,不迷路。
Android1024

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