Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

publish android libraries with flavors

Tags:

is it possible to publish android libraries with flavors? My initial test with jitpack that I usually use to publish libraries failed. Can anyone point me to a working example of a setup like this?

Got the flavors working locally inside one project - but publishing seems to be a problem.

like image 989
ligi Avatar asked Jun 20 '18 15:06

ligi


People also ask

How do I use .AAR files on Android?

Add your AAR or JAR as a dependency To use your Android library's code in another app module, proceed as follows: Navigate to File > Project Structure > Dependencies. In the Declared Dependencies tab, click and select Jar Dependency in the dropdown. In the Add Jar/Aar Dependency dialog, first enter the path to your .

What is missingDimensionStrategy?

TL;DR: If a library module includes a flavor dimension that the app flavor does not, then use missingDimensionStrategy to specify default flavors from the missing dimension. More generally, you can use this any time a consumed module includes a flavor that the consumer module does not.

How do I publish AAR to Maven repository?

Uploading Android AAR to Local Maven RepositoryCreate an empty project without any activity. Create an AAR module. The URL file:\\DESKTOP-3PCHU10\site\ is a shared folder. Add “apply from: 'maven-publish.


1 Answers

yes it's possible.

Jitpack essentially calls ./gradlew install and then looks for artifacts. The trick is to define the artifacts and then to know how to locate them.

Here's a sample project with multi-flavor-multi-project on jitpack: https://github.com/mirceanis/multi-flavor-lib-demo

There's a single-library functional sample in the single-lib branch

like image 154
Mircea Nistor Avatar answered Oct 13 '22 08:10

Mircea Nistor