processing-android icon indicating copy to clipboard operation
processing-android copied to clipboard

Gradle dependency not working

Open tassilo-posegga opened this issue 3 years ago • 10 comments

I am trying to use

implementation 'org.p5android:processing-core:4.2.0'

instead of including the .jar file - but no dependencies show up. There isn't even an entry at "External libraries" with given org.p5android qualifier. Gradle sync works fine. What's going wrong?

tassilo-posegga avatar Mar 04 '21 21:03 tassilo-posegga

Getting the following output with the command gradlew check --stacktrace

FAILURE: Build failed with an exception. What went wrong: Could not determine the dependencies of task ':app:lint'. Could not resolve all artifacts for configuration ':app:releaseCompileClasspath'. Could not resolve org.p5android:processing-core:4.2.0. Could not resolve org.p5android:processing-core:4.2.0. Could not parse POM https://jcenter.bintray.com/org/p5android/processing-core/4.2.0/processing-core-4.2.0.pom Missing required attribute: dependency groupId

Generally, Android Mode uses core jar file by placing it in libs folder of the project and using project dependency as

implementation files('libs/processing-core.jar')

Here's the template for reference. I think the issue does not affect the working of Android Mode.

rupeshkumar22 avatar Mar 10 '21 23:03 rupeshkumar22

I am trying to use

implementation 'org.p5android:processing-core:4.2.0'

instead of including the .jar file - but no dependencies show up. There isn't even an entry at "External libraries" with given org.p5android qualifier. Gradle sync works fine. What's going wrong?

Hi @tassilo-posegga , there seems to be some error in the uploaded POM file for the 4.1.x + versions of processing-core distribution over Maven ! But you can still use 4.0.x versions of the processing-core like normal gradle dependencies as you mentioned in your issue (ex - implementation 'org.p5android:processing-core:4.0.2')

You can find processing-core over maven repository here for your referrence.

You can find all latest releases of processing-core here and can use as an external jar(dependency) as described here

Soon we will fix this issue.

Thanks ! happy coding

ranaaditya avatar Mar 29 '21 02:03 ranaaditya

I'm moving the core, vr, and ar artifacts to mavenCentral, since JCenter is shutting down on May 1st. Hopefully this solves the issue.

codeanticode avatar Apr 25 '21 22:04 codeanticode

I'm moving the core, vr, and ar artifacts to mavenCentral, since JCenter is shutting down on May 1st. Hopefully this solves the issue.

yes this should resolve the issue, thanks for this step @codeanticode !

ranaaditya avatar Apr 25 '21 23:04 ranaaditya

Actually this is the same issue as #582

codeanticode avatar Apr 25 '21 23:04 codeanticode

@ranaaditya I started following the instructions here to create releases in Maven Central using the Gradle Nexus Publish Plugin but got stuck. I got all in place (I think) to push artifacts to a staging repo, and from there create a release manually, but authentication fails.

Seems to me like following the Sonatype instructions to publish with Gradle might be the next option. I'd need some help though... All of this is quite intricate :thinking:

codeanticode avatar Apr 29 '21 19:04 codeanticode

@ranaaditya I started following the instructions here to create releases in Maven Central using the Gradle Nexus Publish Plugin but got stuck. I got all in place (I think) to push artifacts to a staging repo, and from there create a release manually, but authentication fails.

Seems to me like following the Sonatype instructions to publish with Gradle might be the next option. I'd need some help though... All of this is quite intricate thinking

@codeanticode yeah I also think so that following the sonatype instructions would be better option now, if you need any help in this please let me know !

thanks, Aditya

ranaaditya avatar Apr 30 '21 02:04 ranaaditya

@ranaaditya This is completely over my head... I tried to follow the official OSSRH guide for Gradle to publish artifacts but seems outdated because it refers to the maven plugin, which has been deprecated and is now maven-publish, I think?

I made some changes in this branch to ignore errors in the javadoc generation (providing javadoc artifacts seems a requirement for publishing).

Anyways, since the OSSRH guide seems outdated, I'm not sure what to do next. There are many online tutorials about maven publishing, like this one or this other one but they say slightly different things so I'm stuck. For the time being I'm going to just remove any reference to artifact generation in the wiki. If you have some time to look at the branch I created, would be great, otherwise, I think we can just do without maven artifacts. This probably useful only to a very small number of users, and someone who is advanced enough to use maven can probably figure out how to use processing-android dependencies in their code :-)

codeanticode avatar Apr 30 '21 23:04 codeanticode

@ranaaditya This is completely over my head... I tried to follow the official OSSRH guide for Gradle to publish artifacts but seems outdated because it refers to the maven plugin, which has been deprecated and is now maven-publish, I think?

I made some changes in this branch to ignore errors in the javadoc generation (providing javadoc artifacts seems a requirement for publishing).

Anyways, since the OSSRH guide seems outdated, I'm not sure what to do next. There are many online tutorials about maven publishing, like this one or this other one but they say slightly different things so I'm stuck. For the time being I'm going to just remove any reference to artifact generation in the wiki. If you have some time to look at the branch I created, would be great, otherwise, I think we can just do without maven artifacts. This probably useful only to a very small number of users, and someone who is advanced enough to use maven can probably figure out how to use processing-android dependencies in their code :-)

@codeanticode give me sometime I will look into it and try to come up with a solution.

ranaaditya avatar May 01 '21 00:05 ranaaditya

Thanks, there is no rush with this. As additional background, I managed to create a sonatype account, so I have credentials to create staging and release repos:

https://issues.sonatype.org/browse/OSSRH-67993

With regards to the build system itself, I implemented the signing and signing tasks as part of a module that all sub-projects should be able to use, seems like one can use the publishToMavenLocal task to publish locally for testing, when I run:

 gradle core:publishToMavenLocal

I get this error:

> Configure project :core
========> processing-core
> Configure project :mode:libraries:ar
========> processing-ar
> Configure project :mode:libraries:vr
========> processing-vrResolve dependencies of :mode:libraries:vr:implementationAar
> Task :core:generateMetadataFileForReleasePublication FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':core:generateMetadataFileForReleasePublication'.
> Invalid publication 'release':
    - Publication only contains dependencies and/or constraints without a version. You need to add minimal version information, publish resolved versions (https://docs.gradle.org/7.0/userguide/publishing_maven.html#publishing_maven:resolved_dependencies) or reference a platform (https://docs.gradle.org/7.0/userguide/platforms.html)

* 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

Sounds like some information is missing, but on the right track.

codeanticode avatar May 01 '21 12:05 codeanticode

Solved by including the processing-android dep from the self-hosted repo: https://github.com/processing/processing-android/issues/623

codeanticode avatar Oct 30 '23 01:10 codeanticode