LoginSignup
9
3

More than 1 year has passed since last update.

gradleで「Accessing GradleBuildProject.Builder through AnalyticsConfiguratorService is not allowed」が出た時の対処方法

Posted at

概要

マルチモジュール構成で依存関係を見ようと以下のコマンドを打ったところ

$ ./gradlew -q :app:dependencies --configuration releaseCompileClasspath

以下のエラーが出ました

FAILURE: Build failed with an exception.

* Where:
Build file '<パス>/build.gradle' line: 2

* What went wrong:
An exception occurred applying plugin request [id: 'com.android.library']
> Failed to apply plugin 'com.android.internal.library'.
   > Accessing GradleBuildProject.Builder through AnalyticsConfiguratorService is not allowed after AnalyticsService is created.

調べるとこれは、Android Gradle Plugin の バージョン7のバグのようです。8では直るみたいです。
https://issuetracker.google.com/issues/226095015

対処方法

そのうち直ると思いますが、対処方法を。

~/.android/analytics.settingshasOptedInをfalseにすれば良いです。

$ vim ~/.android/analytics.settings
- {"userId":"・・・・","hasOptedIn":true,"・・・・
+ {"userId":"・・・・","hasOptedIn":false,"・・・・ 

これで無事にコマンド成功しました

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