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.

AndroidStudio で新規プロジェクト作成時の Incompatible because this component declares an API of a component compatible with Java 11 and the consumer needed a runtime of a component compatible with Java 8 と出た時

Posted at

概要

何回も何回もググっては時間を使っていたので書きます。

AndroidStudio にて新しいプロジェクトを作成した時に、

  - Variant 'apiElements' capability com.android.tools.build:gradle:7.4.2 declares a library, packaged as a jar, and its dependencies declared externally:
      - Incompatible because this component declares an API of a component compatible with Java 11 and the consumer needed a runtime of a component compatible with Java 8

のようなエラーが吐き出されbuild (Hello, world) ができないときの対処法です。

解決策

上のツールバーの

AndroidStudio --> Preferences --> Build, Execution, Deployment --> Build Tools --> Gradle

を開いて、

Gradle JDK:

をドロップダウンから11 に変更。

Apply --> OK

で解決します。

Screen Shot 2023-04-25 at 10.23.39.png

以上です。

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?