org.gradle.api.GradleScriptException: A problem occurred evaluating project ':app'.
at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:93)
at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.lambda$apply$1(DefaultScriptPluginFactory.java:143)
at org.gradle.configuration.ProjectScriptTarget.addConfiguration(ProjectScriptTarget.java:79)
And a lot more. The base one is that the components variable from components.java didn’t have a java property. What can I do to avoid this?
This is an android build, not a Java build.
Android builds have other components.
Afaik the Android Gradle Plugin even provides custom DSL for configuring the publishing.
Have a look at its documentation: Configure publication variants | Android Studio | Android Developers
You apply the Android application plugin and the Kotlin Android plugin, so it is not even an Android library, but an Android application written in Kotlin.
If you want it to be a Java library, remove those plugins and apply java-library instead.
When I removed the android application plugin and the kotlin plugin from both the module and the top-level gradle files, I got this error message when building.
Please never anywhere share screenshots of text if you only want to share the text and not something additional like colors or IDE annotations. Text in images is hard to read, especially on mobile, very hard to copy, and nearly impossible to search for.
Regarding the problem, it is extremely hard to guess what you do wrong without you providing any code.
How do your build scripts look like now?
Can you also share a build --scan URL?
I have no idea, I’m not into Android development.
But if you need to depend on other Android libraries, you probably have to make it an Android project.
But most probably not an android application project, but an android library project.