In an app project which uses Android Gradle plugin 8.2.0, it fails to build with the following error at this plugin
> Task :gradle-plugin:inspectClassesForKotlinIC UP-TO-DATE
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* Where:
Build file '/..../node_modules/@orbital-systems/react-native-esp-idf-provisioning/android/build.gradle' line: 1
* What went wrong:
A problem occurred evaluating project ':orbital-systems_react-native-esp-idf-provisioning'.
> Failed to apply plugin 'kotlin-android'.
> Extension of type 'JavaPluginExtension' does not exist. Currently registered extension types: [ExtraPropertiesExtension, KotlinAndroidProjectExtension, KotlinTestsRegistry]
* 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.GradleScriptException: A problem occurred evaluating project ':orbital-systems_react-native-esp-idf-provisioning'.
at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:93)
at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.lambda$apply$0(DefaultScriptPluginFactory.java:135)
at org.gradle.configuration.ProjectScriptTarget.addConfiguration(ProjectScriptTarget.java:79)
at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:138)
at org.gradle.configuration.BuildOperationScriptPlugin$1.run(BuildOperationScriptPlugin.java:65)
at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
at org.gradle.configuration.BuildOperationScriptPlugin.lambda$apply$0(BuildOperationScriptPlugin.java:62)
at org.gradle.configuration.internal.DefaultUserCodeApplicationContext.apply(DefaultUserCodeApplicationContext.java:44)
at org.gradle.configuration.BuildOperationScriptPlugin.apply(BuildOperationScriptPlugin.java:62)
a...
...
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':orbital-systems_react-native-esp-idf-provisioning'.
> 'kotlin-android' plugin requires one of the Android Gradle plugins.
Please apply one of the following plugins to ':orbital-systems_react-native-esp-idf-provisioning' project:
- com.android.application
- com.android.library
- com.android.dynamic-feature
- com.android.test
- com.android.instantapp
- com.android.feature
* 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.
...
The reason is at file android/build.gradle. It currently looks like
The line apply plugin: "kotlin-android" is on the top, then, on the way down, there is the apply plugin: "com.android.library".
If I move the apply plugin: "com.android.library" on the very first line, the build succeed
apply plugin: "com.android.library"
apply plugin: "kotlin-android"
... then the rest of the file
In an app project which uses Android Gradle plugin 8.2.0, it fails to build with the following error at this plugin
The reason is at file
android/build.gradle
. It currently looks likeThe line
apply plugin: "kotlin-android"
is on the top, then, on the way down, there is theapply plugin: "com.android.library"
. If I move theapply plugin: "com.android.library"
on the very first line, the build succeed