Questions tagged [android-library]

An Android library project is a development project that holds shared Android source code and resources. Other Android application projects can reference the library project and, at build time, include its compiled sources in their .apk files.

An Android library project is a development project that holds everything needed to build an app, including source code, resource files, and an Android manifest. However, instead of compiling into an APK that runs on a device, an Android library compiles into an Android Archive (AAR) file that can be used as a dependency for an Android app module.

Android Team started revamping the whole design of Android library project since SDK r14 and is going to move from source-based mechanism to compiled-code based library mechanism, in order to support distributing Android library project as a single self-contained jar file. More details in their official blog.

A library module is useful in the following situations:

  • When you're building multiple apps that use some of the same components, such as activities, services, or UI layouts.
  • When you're building an app that exists in multiple APK variations, such as a free and paid version and you need the same core components in both.

Useful links

1883 questions
0
votes
0 answers

Android library with flavors and dependencies

I have custom library with flavors "water" and "blue" : flavorDimensions "water", "blue" productFlavors { water { flavorDimensions "water" } blue { flavorDimensions "blue" } } configurations { …
0
votes
1 answer

Best practices/strategies for a library project with activities, routing back to host activities?

I'm working on a library project that includes a few activities. These activities would need to redirect back to activities in the host application based on input. for example: [host activity#1] -> [library activity] -> [host activity#1] …
BooleanCheese
  • 615
  • 12
  • 34
0
votes
0 answers

Can't make a Java library work with my Android app

I've been trying for the past few days to make a Java library work with an Android app. The library is called WooCommerce API Java Wrapper and it's open-source. The problem is that I'm getting a compile time error which is the following: Return code…
Toufic Batache
  • 762
  • 10
  • 24
0
votes
1 answer

When build my main Android app, my library bring many classes

I have created my first library and build the library as .aar, and then deploy the .aar file into my private artifactory server. actually the .aar file size is just 18kb, but when I used the library as a dependency in my other app. my apk file size…
0
votes
1 answer

Error:Execution failed for task ':app:compileDebugJavaWithJavac'. > android.databinding.tool.util.LoggedErrorException: Found data binding errors

I'd like to build obfuscated AAR library which makes use of Android data binding. When I use the library with minifyEnabled false my library build successfully and my testing app works , after enabling ProGuard the testing app doesn't compile since…
0
votes
1 answer

Adding a dependency to library on Kotlin in full Java-project

I created a simple library (AAR) on the Kotlin, when called up, interacts with the other application through the Broadcast mechanism. And now I had a question: how to properly connect it to third-party developers, as a file (not Maven), that them do…
EfremovAV
  • 91
  • 10
0
votes
0 answers

How to know the dependency of a library ? How to manually upgrade a library to a new version?

I m not under android studio, and I need to upgrade manually these libraries…
zeus
  • 12,173
  • 9
  • 63
  • 184
0
votes
0 answers

How to change java code parameters with XML on android

In my application, I create custom TextView and I change colors in Java file. But I want to change this colors with XML file such as some Android libraries. My Java code for custom TextView: public class GradientTextView extends AppCompatTextView…
RedBounce
  • 213
  • 5
  • 14
0
votes
0 answers

Unable to import github library to gradle

For the very first time, I have been using Fancy Toast library. https://github.com/Shashank02051997/FancyToast-Android#prerequisites Then I decided to edit the color and logo the Fancy Toast, after that I did a sync again in my Gradle and did error.…
Yehezkiel L
  • 389
  • 2
  • 10
0
votes
1 answer

Failing to use resource from Android library ("Error retrieving parent for item: No resource found that matches...")

I have an Android library module that defines a theme: