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

How to fix NoClassDefFoundError on My Library

Using Android Studio, I recently created a library from a project I am working on. Since including it on the new project, every single time I reference the library's methods it throws a java.lang.NoClassDefFoundError. I CAN ctrl + B and visibly see…
0
votes
1 answer

Cannot access inherited library

In my android library I am using ceddl4j library but when I build my library and try to add it's aar file in another Application, it is throwing error Error:(75, 44) error: cannot access DigitalData class file for nl.mirabeau.ceddl4j.DigitalData…
0
votes
1 answer

Android Studio library not working

I need to code a library that will help me on Android and Java. I follow these steps: I create a new Android Library I implement it with File > New > Import Module But I cannot use functions and voids contained into library: How can I create a…
ci0ccarellia
  • 795
  • 9
  • 26
0
votes
1 answer

Error in converting Android Application to Android library

I am converting Android Application to Android Library. Conversion is successful but when I run ./gradlew build or ./gradlew install it is giving error Execution failed for task ':sdk:installDebugAndroidTest'. >…
user7079785
0
votes
2 answers

minSdkVersion not working?

I am following all the instructions I could find and did what seems like the right thing to do and set compileSdkVersion 23, targetSdkVersion 23 and minSdkVersion 15 to support older versions of Android. But a beta tester reported that it would not…
trans
  • 1,411
  • 1
  • 13
  • 13
0
votes
2 answers

ButterKnife view binding in Library project for BaseFragment fails

I am creating a library module, in which I am trying to use ButterKnife. In this module I have a BaseFragment class from which all the fragments derive. Here's the structure of the BaseFragment - public abstract class BaseFragment extends Fragment…
0xC0DED00D
  • 19,522
  • 20
  • 117
  • 184
0
votes
1 answer

In Android Studio how to create jar Including other jar libraries

In android studio, i'm trying to create .jar file of my library and it contains another .jar dependancies. After adding created .jar file to another project and run it gives me java.lang.RuntimeException: Unable to instantiate activity…
0
votes
1 answer

Using android libraries as modules

In order to organize my android project, what is the best way to do this? Do I have to use libraries for each module, or are there a better way to create this modules? Thanks.
Diego Garcia
  • 555
  • 2
  • 6
  • 20
0
votes
1 answer

Android project with an encapsulated project

I don't know if is possible to realize what I'm going to write, but I will try to explain as better as I can. Create an Android Project with its Activities, we can call it, for example, ModuleProject Create a second Android Project with its…
0
votes
2 answers

Start module activity

I created an Android Studio project, next clicked on File/New/Import module and selected the project directory of an opensource project. Next, in the build.gradle (app), I added: dependencies { compile project(':moduleName') } It seems to…
0
votes
0 answers

java.util.zip.ZipException: duplicate entry: android/support/annotation/AnimRes.class

I am not sure what this error means while building apk in android studio. Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate…
Neo Ks
  • 23
  • 6
0
votes
0 answers

Which dependency is causing Google Play warning message for OpenSSL?

My app rejected from Google Play because of OpenSSL Vulnerability. I don't specially use OpenSSL and I can't figure out which one of these dependencies causes the problem. I am building on Windows 10. dependencies { compile…
0
votes
2 answers

Adding Android jar files with relative path

I'm trying to add a jar file to my existing app. When I tried to the following absolute path to my build.gradle, it works fine. compile files('C:/Users/julia/AndroidStudioProjects/TestProject/libs/MyPo.jar') However, when I tried to change it to…
Julia
  • 1,207
  • 4
  • 29
  • 47
0
votes
1 answer

ClassNotFoundException when trying to put Android component into a library

I have two Android projects: an app and a library. The library uses StreamProvider and it is included as an AAR module in the app project. Here are important (changed by me) bits in both projects: Library project: AndroidManifest.xml:
Miro Kropacek
  • 2,742
  • 4
  • 26
  • 41
0
votes
2 answers

Gradle build failed to resolve library

I am working on android (Java) and trying to consume websockets so I thought I would use this tutorial and they are using dependency org.java-websocket:Java-WebSocket:1.3.0 from this repo which has now become 1.3.1. So I have in my modular…
1 2 3
99
100