1
1

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.

Gradle 4.4にした時の "Failed to resolve: 3rd-party Gradle plug-ins may be the cause"エラー

Posted at

#概要
Gradleを3.1.3から4.4に上げた時にDaggar2を入れた時に追記したkapt関連で以下のwarningが発生し、ビルドが通らなくなったので対処法メモ

Folder /Users/ユーザー名/AndroidStudioProjects/プロジェクト名/app/build/generated/source/kaptKotlin/developmentDebug
   ・
   ・
   ・
3rd-party Gradle plug-ins may be the cause

#対処法
Kapt diagnostic locationsを有効にする。
build.gradleにmapDiagnosticLocations = trueを追加することで解決

build.gradle
kapt {
    generateStubs = true 
    mapDiagnosticLocations = true
}

annotation関連のエラーを生成されたJavaスタブではなく、元のKotlinファイルの記述場所へのリンクを表示できるようにする機能らしいです。
なぜ、これを有効にするとエラーが消えるのかは後で調査

#参考
https://github.com/bumptech/glide/issues/2993

1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?