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

ERROR: No build artifacts found #3814

Closed
Darkos-den opened this issue Apr 14, 2019 · 17 comments
Closed

ERROR: No build artifacts found #3814

Darkos-den opened this issue Apr 14, 2019 · 17 comments
Labels

Comments

@Darkos-den
Copy link

Hello. I make simple library from guide. The log states that the build was assembled but no artifacts were found. I do not understand what the problem is.
https://jitpack.io/com/github/Darkos-den/MustHaveExtensions/1.0.8/build.log

@hantrungkien
Copy link

hantrungkien commented Apr 14, 2019

@Darkos-den
After 4 hours I found this problem by default gradlew (seems after gradle ver 4.6+) was incorrect generated. You can using my file to replace in your project.

https://github.com/hantrungkien/tinder-scarlet-lifecycle-android/blob/master/gradlew

@Darkos-den
Copy link
Author

@hantrungkien
After the change, an error began to appear:

  • What went wrong:
    Execution failed for task ':library:compileDebugKotlin'.
    Kotlin could not find the required JDK tools in the Java installation '/usr/lib/jvm/java-8-openjdk->amd64/jre' used by Gradle. Make sure Gradle is running on a JDK, not JRE.

How can this be solved?

@hantrungkien
Copy link

@Darkos-den
you forgot add dependencies in your lib module
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
:p

You also can try: https://android.github.io/android-ktx/core-ktx/

@Darkos-den
Copy link
Author

@hantrungkien
I added this:

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

but I have the same error

@hantrungkien
Copy link

Run this command in your terminal in android studio:
./gradlew install

You can see your incorrect.
Example in your class: https://github.com/Darkos-den/MustHaveExtensions/blob/master/library/src/main/java/com/darkos/mustHaveExtensions/fragmentManager/addFragmentWithBackStackAnimDownUp.kt

@Darkos-den
Copy link
Author

Darkos-den commented Apr 14, 2019

@hantrungkien
I commented it out.
./gradlew install causes the same error. Strange but if I return the file to its original state, then there will be no error, but then there will be no artifacts.

@jitpack-io
Copy link
Member

Hi,

Would recommend adding the 'maven' or 'android-maven' plugin then trying locally with ./gradlew install.
See the documentation and examples: https://jitpack.io/docs/

@Yrp
Copy link

Yrp commented Nov 7, 2019

The same issue here. This is the build log.
build.log

@MarcoCiaramella
Copy link

Try following the jitpack example

@seljabali
Copy link

seljabali commented Sep 5, 2021

In working on a Kotlin library, using Gradle 7.1, the following did the trick for me:

root build.gradle:

plugins {
    id 'maven-publish'
}

publishing {
    publications {
        mavenJava(MavenPublication) {
            groupId = 'foo'
            artifactId = 'bar'
            version = '0.1'

            from components.java
        }
    }
}

I also put this article together that may help out.

@AndroidDeveloperLB
Copy link

AndroidDeveloperLB commented Dec 18, 2021

@seljabali Shouldn't it be:

plugins {
    id 'com.android.library'
    id 'kotlin-android'
    id 'maven-publish'
}

...
android {
...
}
afterEvaluate {
    publishing {
        publications {
            release(MavenPublication) {
                from components.release
            }
        }
    }
}

?

@seljabali
Copy link

What I had placed @AndroidDeveloperLB was for a java/kotlin project and not an Android one.

@AndroidDeveloperLB
Copy link

@seljabali OK no idea in this case, but I think you could remove the parts of groupId = 'foo',artifactId = 'bar',version = '0.1' .

@EnthuDai
Copy link

@seljabali Shouldn't it be:

plugins {
    id 'com.android.library'
    id 'kotlin-android'
    id 'maven-publish'
}

...
android {
    afterEvaluate {
        publishing {
            publications {
                release(MavenPublication) {
                    from components.release
                }
            }
        }
    }
...

?

YES!!! It works on my project!!! The question puzzled me for several days.Thanks very much.

@AndroidDeveloperLB
Copy link

@EnthuDai I still don't understand why we need this. We didn't need it in the past, and now this weird thing I've found somewhere. I don't even understand what it's doing...

@github-actions
Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Sep 28, 2022
@github-actions
Copy link

This issue was closed because it has been inactive for 14 days since being marked as stale.

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

No branches or pull requests

8 participants