Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create android studio library with fabric sdk?

Tags:

java

android

I have integrated Twitter and all is done well.
But now I need to create a reusable component.

I.e.: a library using the fabric sdk in android studio.

We can get the fabric plugin from the Twitter developer site.
By using that I'm able to add sdk to an Android Studio project, but not to a library.

How to add this sdk to an Android Studio library project?

like image 490
Anoop M Maddasseri Avatar asked Mar 21 '15 14:03

Anoop M Maddasseri


People also ask

Is Android SDK a library?

SDKs have a wider scope than libraries do. In fact, all SDKs will contain one or more libraries. An SDK is a collection of libraries, APIs, documentation, utilities, and/or sample code that help you implement certain features without having to do the work from scratch.

What are Android libraries?

The Android Support Library package is a set of code libraries that provide backward-compatible versions of Android framework APIs as well as features that are only available through the library APIs. Each Support Library is backward-compatible to a specific Android API level.

Where is the AAR file in Android Studio?

Change Project structure from Android to Project. Then paste "aar" in libs folder. Click on File at top left of android studio and click "Sync Project with Gradle Files" as below. That's it.


1 Answers

Define the classpath in your project's build.gradle as usual.

Add the dependencies to your library module as you would suspect.

Apply the io.fabric plugin in your app module. No way around this, that's by design. Fabric needs application ID, libraries don't have one.

EDIT: Due to manifest merging you are able to specify the API key meta-data (e.g. for Crashlytics) in your library's manifest.

EDIT 2: Looks like there's a page for it. http://support.crashlytics.com/knowledgebase/articles/456258-library-subproject-in-gradle https://docs.fabric.io/android/crashlytics/build-tools.html#set-up-a-library-subproject

like image 157
Eugen Pechanec Avatar answered Sep 22 '22 12:09

Eugen Pechanec