9
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Android Studio 2.3にてgradle 2.3にするとandroid-aptではまる

Last updated at Posted at 2017-03-07

gradle 2.3以降ではandroid-aptはdeprecated

Android Studio2.2からAndroid Studio 2.3にプロジェクトをMigradeしたら
gradle:2.3.0にしろと言われて上げたら軒並みandroid-aptでハマりました。

dependencies {
    classpath 'com.android.tools.build:gradle:2.3.0'
    // classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
}

そもそもandroid-apt自体がdeprecatedのようです。
https://bitbucket.org/hvisser/android-apt/wiki/Migration
以下、メジャーなライブラリのアノテーションはannotationProcessorで書き直されているようです。

Dagger2

追記:
android-aptのmigrationガイドでは2.0が使われていましたが、Dagger2公式では2.9になっていましたのでこちらが正しいです。
https://github.com/codepath/android_guides/wiki/Dependency-Injection-with-Dagger-2

dependencies {
    compile "com.google.dagger:dagger:2.9"
    annotationProcessor "com.google.dagger:dagger-compiler:2.9"
    provided 'javax.annotation:jsr250-api:1.0'
}

FragmentArgs

dependencies {
    compile 'com.hannesdorfmann.fragmentargs:annotation:3.0.2'
    annotationProcessor 'com.hannesdorfmann.fragmentargs:processor:3.0.2'
    compile 'com.hannesdorfmann.fragmentargs:bundler-parceler:3.0.2'
}

Parceler

dependencies {
    compile 'org.parceler:parceler-api:1.1.6'
        annotationProcessor 'org.parceler:parceler:1.1.6'
}
9
5
0

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
9
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?