Gradle 7 and jitpack.io runs into error during publish
The Maven plugin has been eliminated in Gradle 7.0, please use the maven-publish plugin instead.
I made it work with
plugins {
id 'maven-publish'
...
}
task androidSourcesJar(type: Jar) {
classifier 'sources'
from android.sourceSets.main.java.srcDirs
}
project.afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release
artifact androidSourcesJar // optional sources
}
}
}
}
and you need an own jitpack.yml
jdk:
- openjdk11
install:
- ./gradlew build :lib:publishToMavenLocal
Here you see complete pull request https://github.com/AppDevNext/Moka/pull/77 now it works https://jitpack.io/#AppDevNext/moka/1.0
Android gradle fails to resolve jitpack snapshot build dependency
Check your repositority on jitpack.io, and verify that the snapshot was actually built. (Enter your repo url, select 'branches', you must see a green icon near your commit sha)
Also if your repository is private, you'd need to add access token in build.gradle (you can find it in ur account setting)
jitpack.io failed to resolve github repo
After a few attempts and thanks to jitpack support now I can import my library hosted in Github as a Android Gradle dependency.
I will provide a a few very useful links:
How setup your java library
https://jitpack.io/docs/BUILDING/#gradle-projects
How check logs of your dependency in jitpack
https://jitpack.io/com/github/USER/REPO/TAG/build.log
In my case
https://jitpack.io/com/github/rchampa/DropboxHttpConector/1.0.3/build.log
Can't publish on jitpack
In jitpack log you can see why jitpack can't publish your library. Just delete some part of your code because of jitpack error.
Cannot get the value of write-only property 'publishNonDefault' for object of type com.android.build.gradle.LibraryExtension.
if( android.publishNonDefault && variant.name == android.defaultPublishConfig ) {
def bundleTask = tasks["bundle${name.capitalize()}"]
artifacts {
archives(bundleTask.archivePath) {
classifier null
builtBy bundleTask
}
}
}
}
}
Then jitpack do not show the error when publishing your library. Works like a charm. To publish your library just realese once again then publish your libary.
I just made it for you as an example see the repository which I forked from you here https://github.com/markizdeviler/Busybox
Related Topics
How to to Check If a User Has Rated Your App on the Google Play
Android - Running a Method Periodically Using Postdelayed() Call
How to Monitor Sim State Change
Android, How to Create Option Menu
Android Manifest Restrict to Tablets
Android - How to Get Application Name? (Not Package Name)
Android Studio: Creating Landscape Layouts
Editing Functionality of Host Card Emulation in Android
Android Background Drawable Not Working in Button Since Android Studio 4.1
How to Run a Service Every Day at Noon, and on Every Boot
Horizontalscrollview: Auto-Scroll to End When New Views Are Added
How to Make Drawerlayout to Display Below the Toolbar
Android Fragments: When to Use Hide/Show or Add/Remove/Replace