Visitar URL original
Update Gradle tooling to latest version · Issue #732 · processing/processing-android · GitHub
Skip to content

Update Gradle tooling to latest version #732

Description

@p4puniya

The Gradle dependencies of version: 7.2 (gradle-tooling) are not supported by JAVA-17.
(as given in: https://docs.gradle.org/current/userguide/compatibility.html)

JAVA-17 supports gradle versions 7.3 and higher. Due to this issue, the build is failing. Could you help me in rectifying this issue?
@codeanticode

Activity

  1. changed the title [-]Gradle 1.7.2 not supported by JAVA-17[/-] [+]Gradle 7.2 not supported by JAVA-17[/+] on Mar 18, 2023
  2. changed the title [-]Gradle 7.2 not supported by JAVA-17[/-] [+]Gradle Tooling 7.2 not supported by JAVA-17[/+] on Mar 18, 2023
  3. codeanticode commented on Mar 20, 2023

    @codeanticode
    Contributor

    Thanks for flagging this. I have not experienced any issues with the build process (using Java 17 from Adoptium on macOS). What's the exact error message you are getting?

    @rupeshkumar22 do you have any suggestions/comments about this issue?

  4. p4puniya commented on Mar 21, 2023

    @p4puniya
    Author

    When I build the PDE for Android and run it on an Emulator/Device, it shows this error message:
    Exception in thread "Thread-11" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
    at org.gradle.internal.concurrent.CompositeStoppable.(CompositeStoppable.java:37)
    at org.gradle.internal.service.DefaultServiceRegistry$OwnServices.(DefaultServiceRegistry.java:389)
    at org.gradle.internal.service.DefaultServiceRegistry.(DefaultServiceRegistry.java:105)
    at org.gradle.internal.service.DefaultServiceRegistry.(DefaultServiceRegistry.java:92)
    at org.gradle.tooling.internal.consumer.ConnectorServices$ConnectorServiceRegistry.(ConnectorServices.java:60)
    at org.gradle.tooling.internal.consumer.ConnectorServices$ConnectorServiceRegistry.(ConnectorServices.java:60)
    at org.gradle.tooling.internal.consumer.ConnectorServices.(ConnectorServices.java:37)
    at org.gradle.tooling.GradleConnector.newConnector(GradleConnector.java:86)
    at processing.mode.android.AndroidBuild.gradleBuildPackage(AndroidBuild.java:316)
    at processing.mode.android.AndroidBuild.build(AndroidBuild.java:225)
    at processing.mode.android.AndroidMode.handleRunEmulator(AndroidMode.java:246)
    at processing.mode.android.AndroidEditor$16.run(AndroidEditor.java:399)
    Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)

  5. p4puniya commented on Mar 21, 2023

    @p4puniya
    Author

    Before this also, I had to import multiple dependencies for building the project, including Apache logger, common jar, Flatlaf, lsp4j, repository-30.3.0, sdklib, slf4j and tooling. It appears that all the project is not downloading all the dependencies when build. Maybe the gradle files need to be updated.

  6. p4puniya commented on Mar 21, 2023

    @p4puniya
    Author

    As for this slf4j logger, even importing the jar file doesn't seem to help. What I found was that tooling was not supported with the gradle version.

  7. p4puniya commented on Mar 21, 2023

    @p4puniya
    Author

    If possible, I would like to work on this issue, please guide me in the right direction.

  8. ranaaditya commented on Mar 22, 2023

    @ranaaditya
    Member

    Thanks for flagging this. I have not experienced any issues with the build process (using Java 17 from Adoptium on macOS). What's the exact error message you are getting?

    @rupeshkumar22 do you have any suggestions/comments about this issue?

    Hi @codeanticode , gradle issue is real, for @p4puniya I tried setting up pde and mode for him over the meet but gradle version issue persists there.

    According to my understanding what happens with gradle is when you have more than one version of gradle in your system, cache corruption due to wrong version of gradle use instead of the required creates the issue many times.

    And while building for processing-mode with Java 17 , i think we need to upgrade to the gradle version.

    Apart from gradle issue, dependencies issue is also there, idk why but this happened during my time as well.

    So exactly what happens you can see the dependencies in the gradle / module folder but when you try to build the code it says some files are missing or class not found error for the some dependencies this varies system to system. To fix this i got the temporary solution - just list all the dependencies creating issue -> download them with correct version in your local from maven , etc -> go to project settings -> add the local downloaded dependencies to the modules where they are being used.

    This helped me to solve the issue long back. Though this is a temporary solution.

    What I feel is we need to change the mechanism how dependencies are being managed in our codebase.

    I am open for discussion.

    @p4puniya will try to solve your issue over a meet today (most probably).

    Thanks !

  9. added this to the 4.5.1 bugfixes milestone on Mar 22, 2023
  10. codeanticode commented on Mar 22, 2023

    @codeanticode
    Contributor

    @p4puniya @ranaaditya so this error happens not when building the mode using Gradle, but when you try to run a sketch from the PDE, is that correct?

  11. p4puniya commented on Mar 22, 2023

    @p4puniya
    Author

    It happens when building mode with Gradle. But that can be temporarily fixed by importing the dependencies that give the error and thus, we can build our project. But when you run any code in the pde, the dependencies give the error again, just that they can't be externally imported this time.

  12. codeanticode commented on Mar 23, 2023

    @codeanticode
    Contributor

    If this issue is affects running code from the PDE it should be impacting many users, so far does not seem to be the case. So it must be happening only under certain circumstances, Aditya said something about having several versions of Gradle installed in the system? I have not experienced it myself...

    My suggestion would be to update all the various gradle versions in use by the Android mode. The thing is that there is no single gradle tool/plugin/dependency, so far I think we have the following:

    I do not know if I missing anything but my recommendation would be to upload all of these version so the latest in each category and see what happens. Some things might break and require updating the build scripts or the code of the mode itself :-)

  13. ranaaditya commented on Jul 16, 2023

    @ranaaditya
    Member

    If this issue is affects running code from the PDE it should be impacting many users, so far does not seem to be the case. So it must be happening only under certain circumstances, Aditya said something about having several versions of Gradle installed in the system? I have not experienced it myself...

    My suggestion would be to update all the various gradle versions in use by the Android mode. The thing is that there is no single gradle tool/plugin/dependency, so far I think we have the following:

    I do not know if I missing anything but my recommendation would be to upload all of these version so the latest in each category and see what happens. Some things might break and require updating the build scripts or the code of the mode itself :-)

    Hi @codeanticode , yes I also think that upgrading the Gradle version to 7.3+ would solve the issue.

    Please take a look at Gradle Matrix Compatibility

    Thanks,
    Aditya Rana

  14. ranaaditya commented on Jul 16, 2023

    @ranaaditya
    Member

    If this issue is affects running code from the PDE it should be impacting many users, so far does not seem to be the case. So it must be happening only under certain circumstances, Aditya said something about having several versions of Gradle installed in the system? I have not experienced it myself...
    My suggestion would be to update all the various gradle versions in use by the Android mode. The thing is that there is no single gradle tool/plugin/dependency, so far I think we have the following:

    I do not know if I missing anything but my recommendation would be to upload all of these version so the latest in each category and see what happens. Some things might break and require updating the build scripts or the code of the mode itself :-)

    Hi @codeanticode , yes I also think that upgrading the Gradle version to 7.3+ would solve the issue.

    Please take a look at Gradle Matrix Compatibility

    Thanks, Aditya Rana

    Hi @p4puniya , i think you can check simply by upgrading the gradle tooling api version.

    Let me know if you face any issue in this.

    For referrence similar issue

    Thanks,
    rana

  15. codeanticode commented on Oct 30, 2023

    @codeanticode
    Contributor

    So far, I don't see any errors in building the mode or running sketches from the PDE or Android Studio related to the current version of the tooling. However, we should update it to latest versions at some point. Updating to Gradle 8 may require some changes in the build files:

    https://docs.gradle.org/current/userguide/upgrading_version_7.html

  16. changed the title [-]Gradle Tooling 7.2 not supported by JAVA-17[/-] [+]Update Gradle tooling to latest version[/+] on Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions