jitpack.io ERROR: No build artifacts found
The foreword is solved
preface
Before, Android studio has been used to develop open source libraries and put them into jitpack Compile and package on Io. Recently, due to the research on the kotlin multiplatform of JetBrains, it is changed to develop an independent JVM library or multiplatform Library in idea. The multiplatform library is placed in jitpack There are bound to be problems with IO, because jitpack There are only JVM environments on Io. However, when the JVM library is put on, there are compilation success and packaging errors, error: no build artifacts found
Solution:
This is actually due to the fact that the com.android.libraryplugin
is included when developing the library in Android studio, and artifacts are generated. But there is no need to put the com.android.libraryplugin
in when making the jvm library ;
So we need to add artifacts
manually.
Modify build Gradle file
groovy:
publishing {
publications {
// This mavenJava can be filled in randomly, it's just a task name
// MavenPublication must have, this is the task class to call
mavenJava(MavenPublication) {
// The header here is the artifacts configuration information, do not fill in the default
groupId = 'org.gradle.sample'
artifactId = 'library'
version = '1.1'
from components.java
}
}
}
If it is build gradle.kts file
kotlin:
publishing {
publications {
create("maven_public", MavenPublication::class) {
groupId = "org.gradle.sample"
artifactId = "library"
version = "1.1"
from(components.getByName("java"))
}
}
}
Finish
Read More:
- Execution failed for task ‘:app:kaptDebugKotlin‘ [How to Solve]
- [Solved] Execution failed for task ‘:app:mergeDebugJavaResource‘.
- Flutter android studio runs gradle build error: Could not resolve all artifacts for configuration’:classpath’.
- How to Solve Project Upgrade to flutter2.5.0 Error
- error: resource android:attr/lStar not found [How to Solve]
- Kotlin gets the ID automatically error [How to Solve]
- [Solved] Unity Package Error: FAILURE: Build failed with an exception.
- [Solved] Manifest merger failed with multiple errors, see logs
- [Solved] Android Studio Error: The binary version of its metadata is 1.5.1, expected version is 1.1.15.
- [Solved] Execution failed for task ‘:app:checkDebugAarMetadata‘
- [Solved] Failed to apply plugin appears when Android studio imports a project
- IDEA: How to Solve Springboot Project install Error
- Android studio New kotlin project Error: org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.21-release-315
- ktor org.jetbrains:kotlin-css-jvm Dependency Failure [Solved]
- [Solved] Android app development version update failed, Android – error: task execution failed ‘: app: com
- Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment
- [Solved] UE4 Android Package Error: failed for task :permission_library:compileDebugJavaWithJavac
- app:kaptDebugKotlin no error message [How to Solve]
- [Solved] Maven log jar package conflict error: Class path contains multiple SLF4J bindings
- [Solved] Android Studio 4.1 get manifestOutputDirectory error