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

Android のプロジェクトがビルドできなかったメモ (Android Studio 3.3.2 の実験的機能と Gradle 4.7 と Oracle JDK 12 の相性)

Last updated at Posted at 2019-04-09

Android Studio 3.3.2 で Gradle Sync できない

ERROR: Unsupported method: AndroidProject.getVariantNames().
The version of Gradle you connect to does not support that method.
To resolve the problem you can change/upgrade the target version of Gradle you connect to.
Alternatively, you can ignore this exception and read other information from the model.

Android Studio でビルドできないのは Android Studio の experimental feature が原因ぽい。 Preferences > Experimental > Only sync active variant をオフにしたらエラーが出てたところは回避できた。

参考 : https://stackoverflow.com/questions/53498161/unsupported-method-androidproject-getvariantnames

Oracle JDK 12 環境でコマンドラインビルドできない

Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details

FAILURE: Build failed with an exception.

* What went wrong:
Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().
> Could not create service of type PluginResolutionStrategyInternal using BuildScopeServices.createPluginResolutionStrategy().

* 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 33s

--stacktrace オプションをつけてログを見た感じ、Gradle 4.7 が Oracle JDK 12 に対応しておらずビルドに失敗するっぽい。 Gradle 5.1 にしてみたら通った。

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