LoginSignup
2

More than 5 years have passed since last update.

AS2.2 Preview版でDataBindingが正常に動作しない場合の対処方法

Posted at

AS2.2 Preview5が出て、そろそろ移行のことも考えようかな?と思ってみたが、DataBindingで問題が出てそのままでは移行できなかったので、(多分Preview版のみの)ワークアラウンド。

DataBindingでエラーが出る

コンソールでこんなエラーが出た。ace-v3:appは開発中のアプリプロジェクト。

* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_googleplayDebugApkCopy'.
   > Could not find com.android.databinding:baseLibrary:2.2.0-alpha5.
     Required by:
         ace-v3:app:unspecified
         ace-v3:app:unspecified > ace-v3.eglibrary:android-framework:unspecified
   > Could not find com.android.databinding:baseLibrary:2.2.0-alpha5.
     Required by:
         ace-v3:app:unspecified > com.android.databinding:library:1.2
         ace-v3:app:unspecified > com.android.databinding:adapters:1.2

DataBinding系のライブラリが足りないらしいが、「まあそのうちリポジトリに突っ込まれるべさ」と思って放置してみても、一向に突っ込まれない。

仕方ないので本腰入れて対処した結果、とりあえずワークアラウンドする方法が見つかった。

mavenの参照リポジトリを追加する

多分標準で参照するリポジトリにはalpha版のバイナリが入ってないようなので、手動でリポジトリを足す必要がある。

allprojects {
    repositories {
        maven { url "https://dl.bintray.com/android/android-tools/" } // DataBinding-alpha
    }
}

これで解決。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2