Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not compatible Android Studio gradle #20

Open
wjtxyz opened this issue Feb 24, 2021 · 5 comments
Open

Not compatible Android Studio gradle #20

wjtxyz opened this issue Feb 24, 2021 · 5 comments

Comments

@wjtxyz
Copy link

wjtxyz commented Feb 24, 2021

Caused by: org.gradle.api.artifacts.UnknownConfigurationException: Configuration with name 'compileClasspath' not found.
at org.gradle.api.internal.artifacts.configurations.DefaultConfigurationContainer.createNotFoundException(DefaultConfigurationContainer.java:160)
at org.gradle.api.internal.DefaultNamedDomainObjectCollection.getByName(DefaultNamedDomainObjectCollection.java:332)
at org.gradle.api.internal.artifacts.configurations.DefaultConfigurationContainer.getByName(DefaultConfigurationContainer.java:150)
at org.gradle.api.internal.artifacts.configurations.DefaultConfigurationContainer.getByName(DefaultConfigurationContainer.java:63)
at org.gradle.api.internal.DefaultNamedDomainObjectCollection.getAt(DefaultNamedDomainObjectCollection.java:352)
at org.gradle.api.internal.artifacts.configurations.DefaultConfigurationContainer.getAt(DefaultConfigurationContainer.java:63)
at org.gradle.api.artifacts.ConfigurationContainer$getAt.call(Unknown Source)
at com.github.roroche.plantuml.urls.CompileClasspathUrls.(CompileClasspathUrls.groovy:26)
at com.github.roroche.plantuml.tasks.BuildClassDiagramTask.getClassLoader(BuildClassDiagramTask.groovy:81)
at com.github.roroche.plantuml.tasks.BuildClassDiagramTask_Decorated.getClassLoader(Unknown Source)
at com.github.roroche.plantuml.tasks.BuildClassDiagramTask.execute(BuildClassDiagramTask.groovy:54)

at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:103)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:49)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:42)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:717)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:684)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$5.run(ExecuteActionsTaskExecuter.java:476)

Caused by: org.gradle.api.UnknownDomainObjectException: SourceSet with name 'main' not found.
at org.gradle.api.internal.DefaultNamedDomainObjectCollection.createNotFoundException(DefaultNamedDomainObjectCollection.java:503)
at org.gradle.api.internal.DefaultNamedDomainObjectCollection.getByName(DefaultNamedDomainObjectCollection.java:332)
at org.gradle.api.NamedDomainObjectCollection$getByName.call(Unknown Source)
at com.github.roroche.plantuml.urls.MainOutputUrls.(MainOutputUrls.groovy:39)
at com.github.roroche.plantuml.urls.MainOutputUrls.(MainOutputUrls.groovy:27)
at com.github.roroche.plantuml.tasks.BuildClassDiagramTask.getClassLoader(BuildClassDiagramTask.groovy:86)
at com.github.roroche.plantuml.tasks.BuildClassDiagramTask_Decorated.getClassLoader(Unknown Source)
at com.github.roroche.plantuml.tasks.BuildClassDiagramTask.execute(BuildClassDiagramTask.groovy:54)

at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:103)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:49)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:42)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:717)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:684)

@dpfannenstiel
Copy link

Have you gotten anywhere on this? I'm having a similar issue.

@wjtxyz
Copy link
Author

wjtxyz commented May 24, 2021

Have you gotten anywhere on this? I'm having a similar issue.

No :(

@dpfannenstiel
Copy link

Were you attempting to document a framework? Because I was. I reached the conclusion that the error SourceSet with name 'main' not found indicated that the plugin was unable to find an entry point to the code to start building the documentation. As I dug into the source, it looks like there's no way for the user to change that. We'd have to modify the project.

@fuhrmanator
Copy link

fuhrmanator commented Aug 21, 2022

I have a similar problem with Android Studio Chipmunk | 2021.2.1 Patch 2.

I started a new project from the template Basic Activity:
image

To the project-level build.gradle file I had to add (this is not in the plugin documentation):

plugins {
    id ' java'
}

configurations {
    compileClasspath
}

But then I finally get Invalid package 'com.example.myapplication', maybe missing or empty which is implying that the reflection used to find the packages isn't working.

./gradlew buildClassDiagram
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
> Task :buildClassDiagram FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':buildClassDiagram'.
> Invalid package 'com.example.myapplication', maybe missing or empty

* 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

EDIT

Here's my My\Application\build.gradle finally:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
    id 'com.android.application' version '7.2.2' apply false
    id 'com.android.library' version '7.2.2' apply false
    id 'org.jetbrains.kotlin.android' version '1.6.10' apply false
    id "com.github.roroche.plantuml" version "1.0.2"
    id 'java'
}

//task clean(type: Delete) {
//    delete rootProject.buildDir
//}

configurations {
    compileClasspath
}

classDiagram { // (1)
    packageName = "com.example.myapplication" // (2)
    outputFile = project.file('diagrams/class_diagram.plantuml') // (3)
    // outputFile = new File("${projectDir}/diagrams/class_diagram.plantuml") // (4)
//    ignoredClasses = [ // (5)
//                       "com.github.roroche.plantuml.diagrams.Diagram\$Simple",
//                       "com.github.roroche.plantuml.diagrams.Diagram\$Wrap",
//                       "com.github.roroche.plantuml.classes.Classes\$Simple",
//                       "com.github.roroche.plantuml.classes.Classes\$Wrap"
//    ]
}

@Plunts
Copy link

Plunts commented Jan 2, 2023

I forked and rewrote the plugin and did my best to make it compatible with Android Studio: https://plugins.gradle.org/plugin/io.gitlab.plunts.plantuml

I'm open for suggestions if anything is still not working, since I actually don't use Android Studio myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants