Closed2

Composite Buildをするときに、「Failed to apply plugin 'com.android.internal.library'」・「androidJdkImage」と怒られる

yuu1111mainyuu1111main

エラー文はこんな感じ

Build file '/Users/miyayu/Programs/***/app/build.gradle.kts' line: 1

An exception occurred applying plugin request [id: '***.android.feature', version: 'unspecified']
> Failed to apply plugin 'com.android.internal.library'.
   > org.gradle.api.InvalidUserDataException: Cannot add a configuration with name 'androidJdkImage' as a configuration with that name already exists.

* Try:
> 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.

* Exception is:
org.gradle.api.plugins.InvalidPluginException: An exception occurred applying plugin request [id: '***.android.feature', version: 'unspecified']
	at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.exceptionOccurred(DefaultPluginRequestApplicator.java:222)
(省略)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
	at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:47)
Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin 'com.android.internal.library'.
	at org.gradle.api.internal.plugins.DefaultPluginManager.doApply(DefaultPluginManager.java:173)
	at org.gradle.api.internal.plugins.DefaultPluginManager.apply(DefaultPluginManager.java:146)
(省略)
Caused by: java.lang.RuntimeException: org.gradle.api.InvalidUserDataException: Cannot add a configuration with name 'androidJdkImage' as a configuration with that name already exists.
	at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:71)
(省略)
Caused by: org.gradle.api.InvalidUserDataException: Cannot add a configuration with name 'androidJdkImage' as a configuration with that name already exists.
	at org.gradle.api.internal.DefaultNamedDomainObjectCollection.assertCanAdd(DefaultNamedDomainObjectCollection.java:213)
	at org.gradle.api.internal.AbstractNamedDomainObjectContainer.create(AbstractNamedDomainObjectContainer.java:77)
(省略)

yuu1111mainyuu1111main

原因

appモジュールがcom.android.librarycom.android.applicationをどちらも読み込んでいたため

このスクラップは2024/01/06にクローズされました