jitpack / android-example Goto Github PK
View Code? Open in Web Editor NEWExample Android library that builds on jitpack.io
Example Android library that builds on jitpack.io
They moved the android-maven-plugin to a new site several months ago.
My build needs a variable (it's out of my control to remove it) and a specific NDK, but jitpack.io don't know anything about.
https://jitpack.io/com/github/hannesa2/android-database-sqlcipher/4.2.0.0/build.log
How can I specify it ?
In the same repo I prepared a travis build with this variable https://github.com/hannesa2/android-database-sqlcipher/blob/6ab61dc90a36d62fd57c62c446fba9d9315a6bd1/.travis.yml#L37
But as it looks like Travis and jitpack.io are different things
I see in doku to add a jitpack.yml
jdk:
- openjdk9
before_install:
- ./custom_setup.sh
install:
- ./gradlew clean install -xtest
env:
ANDROID_NDK_ROOT : `pwd`/android-ndk-r15c
PATH : ${PATH}:$ANDROID_NDK_ROOT
but this doesn't work.
Build starting...
/script/buildit.sh: line 3: date: command not found
/script/buildit.sh: line 3: hostname: command not found
Start:
Git:
/script/buildit.sh: line 5: git: command not found
/script/buildit.sh: line 6: git: command not found
/script/buildit.sh: line 6: head: command not found
/script/buildit.sh: line 6: cut: command not found/script/buildit.sh: line 11: cp: command not found
/script/buildit.sh: line 12: cd: /home/jitpack/build: No such file or directory
/script/buildit.sh: line 19: dirname: command not found
/script/buildit.sh: line 27: find: command not found
Running before_install command:
./custom_setup.sh
./custom_setup.sh: line 1: wget: command not found
./custom_setup.sh: line 2: unzip: command not found
Running install command:
echo "Running a custom install command";./gradlew clean install -xtest
Running a custom install command
/usr/bin/env: ‘sh’: No such file or directory
Build tool exit code: 0
/script/buildit.sh: line 106: cp: command not found
Looking for artifacts...
/script/buildit.sh: line 110: gradle: command not found
/script/buildit.sh: line 111: gradle: command not found
2019-06-21T09:17:48.791934217Z
Exit code: 0ERROR: No build artifacts found
This is my code https://github.com/hannesa2/android-database-sqlcipher/tree/jitpack
Can you show me an example which is working ?
Might need to use a different plugin:
https://gist.github.com/jitpack-io/45322b496498371d189fe1a557f6093b
because there is an open issue with dcendents/android-maven-gradle-plugin:
dcendents/android-maven-gradle-plugin#80
In jitpack.yml file have below content
jdk:
Date: Mon Dec 13 19:16:32 2021 +0530
4.0.21v jitpack with 11 issue is resolved
Found Android manifest
Android SDK version: 31. Build tools: 31.0.0
Installing Android platform 31
Installing Build-tools 31.0.0
Going into directory: ./FFSpinSDK
Gradle build script
Found gradle version: 7.0.2.
Using gradle wrapper
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
Downloading https://services.gradle.org/distributions/gradle-7.0.2-bin.zip
.
Unzipping /home/jitpack/.gradle/wrapper/dists/gradle-7.0.2-bin/857tjihv64xamwrf0h14cai3r/gradle-7.0.2-bin.zip to /home/jitpack/.gradle/wrapper/dists/gradle-7.0.2-bin/857tjihv64xamwrf0h14cai3r
Set executable permissions for: /home/jitpack/.gradle/wrapper/dists/gradle-7.0.2-bin/857tjihv64xamwrf0h14cai3r/gradle-7.0.2/bin/gradle
Build time: 2021-05-14 12:02:31 UTC
Revision: 1ef1b260d39daacbf9357f9d8594a8a743e2152e
Kotlin: 1.4.31
Groovy: 3.0.7
Ant: Apache Ant(TM) version 1.10.9 compiled on September 27 2020
JVM: 1.8.0_252 (Private Build 25.252-b09)
OS: Linux 4.10.0-28-generic amd64
0m3.152s
Getting tasks: ./gradlew tasks --all
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
FAILURE: Build failed with an exception.
Where:
Build file '/home/jitpack/build/FFSpinSDK/app/build.gradle' line: 2
What went wrong:
An exception occurred applying plugin request [id: 'com.android.application']
Failed to apply plugin 'com.android.internal.application'.
Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
You can try some of the following options:
- changing the IDE settings.
- changing the JAVA_HOME environment variable.
- changingorg.gradle.java.home
ingradle.properties
.
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
BUILD FAILED in 13s
Tasks:
WARNING:
Gradle 'install' task not found. Please add the 'maven' or 'android-maven' plugin.
See the documentation and examples: https://jitpack.io/docs/
Adding maven plugin
Found android library build file in ffspinapi
Found android library build file in ffspinapi
Running: ./gradlew clean -Pgroup=com.github.flickfusion -Pversion=4.0.21 install
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
Configure project :
Gradle version Gradle 7.0.2
FAILURE: Build failed with an exception.
Where:
Build file '/home/jitpack/build/FFSpinSDK/app/build.gradle' line: 2
What went wrong:
An exception occurred applying plugin request [id: 'com.android.application']
Failed to apply plugin 'com.android.internal.application'.
Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
You can try some of the following options:
- changing the IDE settings.
- changing the JAVA_HOME environment variable.
- changingorg.gradle.java.home
ingradle.properties
.
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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/7.0.2/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 855ms
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
2021-12-13T13:50:01.374397374Z
Exit code: 0
ERROR: No build artifacts found
I built this project ‘https://github.com/weimingjue/TakePhoto/tree/maven_error_test’ using ‘https://jitpack.io’, and this is the test version after the build ‘com.github.weimingjue:TakePhoto:0.0.1’. I used Android Studio to depend on this version and build an Android package without any errors or warnings, but when my code executed into this library, I encountered a ‘ClassNotFoundException’. I found that the TakePhoto library can be used normally, but all the dependencies it references have not been built correctly, resulting in the inability to find other libraries referenced. After troubleshooting, I found that it was mainly caused by this aar library in the pom file ‘implementation ‘com.soundcloud.android:android-crop:1.0.1@aar’’. I tried to use my own pom file, but the pom built was not replaced. I don’t know what to do now. How can I use this library?’
Let's say I had 3 modules in my Android project:
Core - contains shared code for other modules.
API - contains all the networking logic. Relies on Core
MyLib - contains some views and other logic. Relies on API and Core
I want to allow a user of my library to either use MyLib or just API (if they wanted to do everything themselves). How do I go about publishing this on jitpack to do that?
ExampleLib not accessible in project where we used this library
Please, update version of android-maven-gradle-plugin to work with most recent version of gradle.
Thanks.
hello,After I do this,there are some problems
like this:
can not find android-maven-gradle-plugin in 'D:\software\Android Studio\gradle\m2repository\com...'
I don't know how to solve.
Hi there @jitpack-io ,
is it possible to specify a build variant to be generated the library using jitpack?
In my library I have two build variants (for example, sandbox and production), how can I specify which of them I want to build?
Thanks
Took me ages to figure out that gradle expects a certain directory structure for the source files.
I'm confused by the 2nd instruction:
I see the reference to maven { url 'https://jitpack.io' }
but nothing regarding the implementation 'com.github.jitpack:android-example:Tag'
in either the project level build.gradle file, nor the module level gradle file from this example project.
Can you explain the reason for this disconnect? I'm struggling to understand where to put the dependency mentioned in my build.gradle file(s).
Hi there! Wondering if you can clarify some of the required steps to get this to work with Android - I've been fighting with this for some time and I still can't quite seem to get it to work.
include:library
notation in my settings.gradle
file, or do I need to use direct file references as shown here?gradle install
- on the project where I've created the library, or on the project where I'm attempting to add the library?android-maven
plugin need to be applied to both the project where I've created the library, the project where I'm attempting to add the library, or both?Any clarifications on any of these would be most helpful. It would be really helpful if you could update the README to give a step-by-step set of instructions as to how to set up your repo so that jitpack will recognize it - I feel like I'm missing something big here. Thanks!
Hello!
After adding the required code snippets no my gradle files in Android Studio, the build failed with message : cannot resolve com.github.jitpack (and so on)
Whats the problem? I added the maven repo to allprojects - repos in project build.gradle, and the implementation for GitHub url in the module build.gradle
(Same problem I had with my own jitpack project, so I imported this, but is doesnt work, too.
Error log on Jitpack.io
Failed to apply plugin 'com.android.internal.application'.
Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
You can try some of the following options:
- changing the IDE settings.
- changing the JAVA_HOME environment variable.
- changingorg.gradle.java.home
ingradle.properties
.
The build.gradle
file contains these lines at the bottom:
android.libraryVariants.all { variant ->
def name = variant.buildType.name
def task = project.tasks.create "jar${name.capitalize()}", Jar
task.dependsOn variant.javaCompile
task.from variant.javaCompile.destinationDir
artifacts.add('archives', task)
}
All instances of varient.javaCompile
should be replaced with varient.javaCompiler
because the former is deprecated.
I want to cancel my subscription to jitpack.io, but it is not displayed in my account! Support has not responded for many months! While the money is debited monthly! Email me asap!
I use kotlin 1.5.21.
It build failed on jitpack, but successfully on my computer.
https://jitpack.io/com/github/tonyzzp/upnp.portmapping/1.0/build.log
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.