getting ERROR: No build artifacts found while publish the android library to jitpack.io - android-library

I have created a library and published it on jitpack.io but there is some issue not able to figure it out.
Here is my build.gradle file
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.github.dcendents.android-maven'
group = 'com.github.Shubhamsdr3:timertextview:'
android {
compileSdkVersion 30
buildToolsVersion "30.0.1"
defaultConfig {
minSdkVersion 19
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
//**. **//
}
Below is the log file from jitpack.io:
------------------------------------------------------------
Gradle 6.1.1
------------------------------------------------------------
Kotlin: 1.3.61
Groovy: 2.5.8
Ant: Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM: 1.8.0_252 (Private Build 25.252-b09)
OS: Linux 4.14.63-xxxx-std-ipv6-64 amd64
Getting tasks: ./gradlew tasks --all
0m3.734s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
Tasks: install,
Running: ./gradlew clean -Pgroup=com.github.XXXXXX -Pversion=0.1.7 -xtest -xlint install
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
> Task :clean UP-TO-DATE
BUILD SUCCESSFUL in 12s
25 actionable tasks: 22 executed, 3 up-to-date
Build tool exit code: 0
Looking for artifacts...
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
Looking for pom.xml in build directory and ~/.m2
Found artifact: com.github.XXXXXX:timertextview::timertextview:0.1.7
2021-01-02T13:52:06.495618771Z
Exit code: 0
ERROR: No build artifacts found
Expected artifacts in: $HOME/.m2/repository/com/github/XXXXXX/timertextview
It used work in it's previous version and suddenly stopped working.

Related

How to resolve Android Build error "Your build is currently configured to use Java 19 and Gradle 7.5."

My Android project was building fine with the following project build file
buildscript {
ext {
compose_version = '1.4.0-alpha02'
}
}
plugins {
id 'com.android.application' version '8.0.0-alpha10' apply false
id 'com.android.library' version '8.0.0-alpha10' apply false
id 'org.jetbrains.kotlin.android' version '1.7.21' apply false
id 'com.google.dagger.hilt.android' version '2.44.2' apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}
my Android Studio version is
Android Studio Flamingo | 2022.2.1 Canary 10
Build #AI-222.4459.24.2221.9409768, built on December 15, 2022
Runtime version: 17.0.4.1+0-17.0.4.1b469.62-9127311 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 10.15.7
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 12
Metal Rendering is ON
Registry:
external.system.auto.import.disabled=true
ide.text.editor.with.preview.show.floating.toolbar=false
gradle.version.catalogs.dynamic.support=true
ide.images.show.chessboard=true
Non-Bundled Plugins:
com.android.aas (3.5.1)
com.jetbrains.kmm (0.5.1(222)-30)
My Android application is a multi module project with each module setting the following java/kotlin options
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
coreLibraryDesugaringEnabled true
}
kotlinOptions {
jvmTarget = '11'
freeCompilerArgs += [
"-opt-in=androidx.compose.material3.windowsizeclass.ExperimentalMaterial3WindowSizeClassApi"]
}
Within my Android Studio preferences I set Gradle JDK: Java 18
However when I make the following change to my app gradle build file
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
coreLibraryDesugaringEnabled true
}
kotlinOptions {
jvmTarget = '11'
freeCompilerArgs += [
"-opt-in=androidx.compose.material3.windowsizeclass.ExperimentalMaterial3WindowSizeClassApi",
"-opt-in=kotlinx.coroutines.ObsoleteCoroutinesApi",
]
}
e.g. add this additional -opt-in entry "-opt-in=kotlinx.coroutines.ObsoleteCoroutinesApi",
my build fails with
Starting Gradle Daemon...
Gradle Daemon started in 3 s 350 ms
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Could not open cp_proj generic class cache for build file '/Users/anonymous/github/mobile-android-app/app/build.gradle' (/Users/beecheya/.gradle/caches/7.5/scripts/3am3ttbat0qsqgsjlhtiaj5se).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 63
and also
Unsupported Java.
Your build is currently configured to use Java 19 and Gradle 7.5.
Possible solution:
- Open Gradle wrapper settings, change `distributionUrl` property to use compatible Gradle version and reload the project
my gradle wrapper contents resemble this:-
#Tue Oct 25 07:38:32 BST 2022
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
How do i resolve this build error?
What have I done wrong?
Update to Gradle 7.6 that has Java 19 support.
See https://docs.gradle.org/7.6/release-notes.html#java19

Upgrading Gradle Quarkus Plugin to 2.10.0.Final

trying to upgrade Gradle's Quarkus Plugin to 2.10.0.Final. Running
./gradlew build -x test
leads to
An exception occurred applying plugin request [id: 'io.quarkus', version: '2.10.0.Final']
> Failed to apply plugin 'io.quarkus'.
> class org.gradle.api.internal.provider.DefaultProvider cannot be cast to class org.gradle.api.internal.provider.CollectionProviderInternal (org.gradle.api.internal.provider.DefaultProvider and org.gradle.api.internal.provider.CollectionProviderInternal are in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader #685cb137)
Above Exception gives me the impression, that gradle can't find version 2.10.0.Final of the plugin, which is counter-intuitive for me ... it is available online https://plugins.gradle.org/plugin/io.quarkus.
For reference:
gradle.properties
quarkusPluginVersion=2.10.0.Final
quarkusPlatformArtifactId=quarkus-bom
quarkusPluginId=io.quarkus
quarkusPlatformGroupId=io.quarkus.platform
quarkusPlatformVersion=2.10.0.Final
settings.gradle
pluginManagement {
repositories {
mavenLocal()
mavenCentral()
gradlePluginPortal()
}
plugins {
id "${quarkusPluginId}" version "${quarkusPluginVersion}"
}
}
EDIT
$ ./gradlew --version
------------------------------------------------------------
Gradle 7.3.3
------------------------------------------------------------
Build time: 2021-12-22 12:37:54 UTC
Revision: 6f556c80f945dc54b50e0be633da6c62dbe8dc71
Kotlin: 1.5.31
Groovy: 3.0.9
Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM: 11.0.15 (Azul Systems, Inc. 11.0.15+10-LTS)
OS: Mac OS X 12.1 x86_64

Can publish to mavenLocal but not remote repo?

$ ./gradlew -version
------------------------------------------------------------
Gradle 6.5
------------------------------------------------------------
Build time: 2020-06-02 20:46:21 UTC
Revision: a27f41e4ae5e8a41ab9b19f8dd6d86d7b384dad4
Kotlin: 1.3.72
Groovy: 2.5.11
Ant: Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM: 1.8.0_181 (Oracle Corporation 25.181-b13)
OS: Mac OS X 10.15.7 x86_64
I have a sub-project with the following build.gradle file
plugins {
id 'java'
id 'maven-publish'
}
dependencies {
compileOnly group: 'org.projectlombok', name: 'lombok', version: '1.18.10'
annotationProcessor group: 'org.projectlombok', name: 'lombok', version: '1.18.10'
compile group: 'javax.validation', name: 'validation-api', version: '2.0.1.Final'
}
task sourcesJar(type: Jar, dependsOn: classes){
from sourceSets.main.allSource
}
artifacts{
archives sourcesJar
}
publishing {
repositories{
maven {
url 's3://' + s3_bucket
authentication {
awsIm(AwsImAuthentication)
}
}
}
publications {
integrationsCommon(MavenPublication){
artifactId artifactId
from components.java
artifact sourcesJar{
classifier "sources"
}
}
}
}
I can run
$ ./gradlew clean build pTML -p my-sub-project
...and see the artifact published in my ~/.m2 local repo.
But I get the following error when I run the publish task
$ ./gradlew clean build publish -p my-sub-project
* What went wrong:
Execution failed for task ':my-sub-project:publishIntegrationsCommonPublicationToMaven2Repository'.
> Failed to publish publication 'integrationsCommon' to repository 'maven2'
> java.lang.NullPointerException (no error message)
Why is that? I was under the impression that if can publish to Maven local I can publish anywhere! (God I miss Maven!).
The AWS documentation suggest to define credentials.
This just refers to CodeArtifact instead of S3, which appears to be the common back-end. If you want to use S3 instead... add --stacktrace to the command, in order to determine what that NullPointerException may be caused by; the configuration may lack something essential.
This would be the Gradle documentation for S3: AWS S3 repositories configuration
.

Gradle: Could not get unknown property 'classesDir' for main classes

According to the documentation, I've tried to use aspectj plugin.
This is the message I get when I build my project.
FAILURE: Build failed with an exception.
* Where:
Build file '/home/jesudi/projects/gradle-vscode/build.gradle' line: 22
* What went wrong:
A problem occurred evaluating root project 'security'.
> Failed to apply plugin [id 'aspectj.gradle']
> Could not create task ':compileAspect'.
> Could not get unknown property 'classesDir' for main classes of type org.gradle.api.internal.tasks.DefaultSourceSetOutput.
This is my script:
buildscript {
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "org.apache.meecrowave:meecrowave-gradle-plugin:1.2.6"
classpath "gradle.plugin.aspectj:gradle-aspectj:0.1.6"
}
}
plugins {
id 'java'
}
project.ext {
aspectjVersion = '1.9.2'
}
apply plugin: 'aspectj.gradle'
apply plugin: "org.apache.microwave.microwave"
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
dependencies {
compile("org.apache.meecrowave:meecrowave-core:1.2.6")
compile("org.apache.meecrowave:meecrowave-specs-api:1.2.6")
}
meecrowave {
httpPort = 9090
// most of the meecrowave core configuration
}
This is the gradle -version output:
------------------------------------------------------------
Gradle 5.1.1
------------------------------------------------------------
Build time: 2019-01-10 23:05:02 UTC
Revision: 3c9abb645fb83932c44e8610642393ad62116807
Kotlin DSL: 1.1.1
Kotlin: 1.3.11
Groovy: 2.5.4
Ant: Apache Ant(TM) version 1.9.13 compiled on July 10 2018
JVM: 11.0.2 (Oracle Corporation 11.0.2+9)
OS: Linux 4.15.0-20-generic amd64
In Gradle 5.x, this property has been renamed to classesDirs from classesDir.
You can find more information here
Possible your plugin is not a root of problem but the version of Gradle is.
First time I had the same error in libgdx game (android studio).
In build.gradle(desktop) file "classDir was renamed to classesDirs and it helped.
from files(sourceSets.main.output.classesDirs)
The classesDir property was deprecated in gradle 4.x, and removed in gradle 5.x (see the release notes).
The plugin has apparently not been maintained.
I got a similar error message, not with this plugin but even with the HelloWorld app created by Grails (3.2.9). In my case, I already used sdkman to set my current Gradle to 3.5 instead of 5, but the problem persists. It turned out that the "grails" cli (https://github.com/grails/grails-core/blob/3.2.x/grails-shell/src/main/groovy/org/grails/cli/gradle/GradleUtil.groovy) uses the default sdkman version for Gradle (which is different from the "current" version).
From Grails 3.3.X, one can set "gradleWrapperVersion=3.5" in gradle.properties instead, or use GRAILS_GRADLE_HOME environment variable as before.

Gradle task does not execute its dependency

I'm trying to use http://launch4j.sourceforge.net/ through this Gradle plugin https://github.com/TheBoegl/gradle-launch4j.
When I do gradle clean launch4j I get the following output.
:clean
:compileJava
:processResources UP-TO-DATE
:classes
:jar
:copyL4jLib
:generateXmlConfig
:createExeWithBin SKIPPED
:unzipL4jBin
:copyL4jBinLib
:createExeWithJar FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':createExeWithJar'.
> meta-tagger.exe not created:
launch4j: Icon doesn't exist.
I do not understand why copyResources is not run. Clearly :copyL4jLib is executed. Shouldn't Gradle figure out that copyResources comes before it and execute it first?
Here is my gradle -version info.
Gradle 2.10
Build time: 2015-12-21 21:15:04 UTC
Build number: none
Revision: 276bdcded730f53aa8c11b479986aafa58e124a6
Groovy: 2.4.4
Ant: Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM: 1.8.0_66 (Oracle Corporation 25.66-b18)
OS: Windows 7 6.1 amd64
And here is my build script.
plugins {
id 'edu.sc.seis.launch4j' version '1.6.1'
id 'java'
}
repositories {
mavenLocal()
mavenCentral()
jcenter()
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
task copyResources(type: Copy) {
from 'src/main/wrapper-resources/'
into 'build/launch4j'
}
copyL4jLib {
dependsOn copyResources
}
launch4j {
mainClassName = 'com.mpinnegar.Main'
icon = 'favicon.ico'
headerType = 'console'
errTitle = 'Image Tagger'
stayAlive = true
}
tasks.copyL4jLib.dependsOn copyResources
It seems the plugin is doing something weired. First it creates the task (see https://github.com/TheBoegl/gradle-launch4j/blob/develop/src/main/groovy/edu/sc/seis/launch4j/Launch4jPlugin.groovy#L50) and then replaces the task in an afterEvaluate block (see https://github.com/TheBoegl/gradle-launch4j/blob/develop/src/main/groovy/edu/sc/seis/launch4j/Launch4jPlugin.groovy#L122)
To workaround this issue you should be able to put your task dependency setup in a afterEvaluate block to ensure you're configuring the replaced task:
afterEvaluate {
copyL4jLib.dependsOn copyResources
}

Resources