0
0

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 1 year has passed since last update.

【Flutter】connectivity_plusで「Execution failed for task ':connectivity_plus:compileDebugJavaWithJavac'.」のビルドエラー

Posted at

はじめに

大学生のFlutterコードレビューのボランティア的なことをしているのですが、レビュー対象のプロジェクトをビルドしようとしたところ、ビルドエラーになって2時間ほど溶かしてしまったのでメモ。

状況

レビュー対象のFlutterプロジェクトをローカルにclone

Androidのエミュレータを立ち上げる

Android Studioでビルド

エラー発生

エラー文

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':connectivity_plus:compileDebugJavaWithJavac'.
> エラー: 17は無効なソース・リリースです

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
Running Gradle task 'assembleDebug'...                           2,232ms
Error: Gradle task assembleDebug failed with exit code 1

原因

Flutterのpackageであるconnectivity_plusが原因でした。
connectivity_plusのリポジトリにもバグ報告のissueが上がっていました。

解決策

connectivity_plusのバージョンを変えることにより、このビルドエラーを回避することができます。
この記事執筆時点でのconnectivity_plusの最新バージョンは6.0.2ですが、6.0.2だとビルドエラーが発生してしまいます。
現時点でconnectivity_plusのバグ修正対応が完了していないため、ダウングレードを行なって5.0.2以前のバージョンを利用するのが解決策になります。
5.0.2以前のバージョンであれば、ビルドエラーも発生しないはずです。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?