android-library

How can I use filter for emma when building Android test with ant for a library project?

本秂侑毒 提交于 2019-12-04 10:37:31
From this question : How can I use filter for emma when building Android test with ant? I know emma can use a filter by adding the following lines to my ant.properties of the targeted project, not the test project, emma.filter=-com.your.excluded.package.* but it seems it doesn't work properly if my target project is a library project. My workspace looks like this: projectlib1 : lib project using lib2 projectlib1/tests : unit tests for lib1 projectlib2 : lib project using lib3 projectlib2/tests : unit tests for lib2 projectlib3 : stand alone lib When I run coverage for lib1 I also get coverage

How to setup Android Library module and be referenced by multiple projects in Android Studio?

坚强是说给别人听的谎言 提交于 2019-12-04 09:31:03
问题 My company is making several Android projects on Android Studio, which all of them share some similar codes, such as custom views, customised HTTP clients, and many other things. The problem I am facing is, I am new to Android Studio and I am not sure how to extract these common codes across several projects to a single Android Library modules that will be referenced by these projects. In Eclipse it is very simple, just create a new Android Library project, and then move your code over there,

Unable to Debug Library Projects with ADT v14 - Source Not Found

房东的猫 提交于 2019-12-04 08:53:20
问题 Ever since upgrading my current projects to use the new R14 Tools in Eclipse, I'm now unable to debug any code that exists in my library projects. When I hit a break point in my library project code, instead of Eclipse opening the original source file, it opens up the read-only copy of the source file contained within the JAR with the message "Source not found". I've searched around for a solution to this, but have yet to come across anything. Does anybody else have any suggestions? It's

How to set name of AAR output from Gradle

不想你离开。 提交于 2019-12-04 07:44:43
问题 I have a project with several modules in it one of which is a Android Library named (poorly) as sdk . When I build the project it outputs an AAR named sdk.aar . I haven't been able to find anything in the Android or Gradle documentation that allows me to change the name of the AAR output. I would like it to have a basename + version number like the Jar tasks do, but I can't work out how to do the same for the AAR because all the config for it seems to be hidden in the android.library plugin.

Do library dependency increase size of APK?

陌路散爱 提交于 2019-12-04 07:33:51
I have multiple libraries in my project like dependencies { compile files('libs/universalloaderlibrary.jar') compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:22.2.1' compile 'com.android.support:design:22.2.1' compile 'com.android.support:recyclerview-v7:22.2.1' compile 'com.android.support:cardview-v7:22.2.1' compile 'de.hdodenhof:circleimageview:1.3.0' compile 'com.jakewharton:butterknife:7.0.1' //noinspection GradleCompatible compile 'com.google.android.gms:play-services-gcm:7.3.0' compile 'com.github.castorflex.smoothprogressbar:library:1.1.0'

How to fix the libgnustl_shared.so file duplicated which in third party sdks?

扶醉桌前 提交于 2019-12-04 03:18:12
When i used the gradle to build and run the apk, i get the error below:::: Error:Execution failed for task ':app:transformNative_libsWithMergeJniLibsForDebug'. > com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK lib/armeabi-v7a/libgnustl_shared.so File1: app/build/intermediates/exploded-aar/com.facebook.react/react-native/0.20.1/jni File2: app/build/intermediates/exploded-aar/app/videosdk/unspecified/jni Cleaner solution is to explicitly tell Gradle that you know about the problem and accept any of these

How to make Android library resources private?

不羁的心 提交于 2019-12-04 02:37:14
How do I make the resources (string, dimen, color, etc.) in my Android library module private? I've tried both documented ways of doing this and neither work... Following the official Android doc of creating a res/values/public.xml does not work; all of the resources remain public in the app that uses this library. Following Chris Banes's instruction (and reiterated in this StackOverflow answer ) of creating a res-public/values/public.xml folder does not work either; all of the resources are made private, but those listed in the public.xml file are not made public as they should be. Does

android library project obfuscation

烈酒焚心 提交于 2019-12-04 02:21:00
Hi I developed one android library and Now I want to obfuscate it for redistribution. I develop my library with eclipse and android version 4.1.2. I tried obfuscating with eclipse and pro-guard. I do export and and also put proguard.config = proguard-project.text in project-properties but it not generating any jar file. It shows me result as its not allowing to library projects. So I don't know how to obfuscating android library project. I need help regarding how to obfuscating of android library projects. Need Help Thank you. The Android SDK doesn't apply ProGuard to library projects; it only

How to override styles of a library which has its own Activity

寵の児 提交于 2019-12-04 01:57:13
I have a library which has its own Activities with colorPrimary and colorPrimaryDark attributes. In the application which is using this library, there are different values for these color attributes. Is there a way to make the library use the style provided by the caller application? So that in the end, if the app has a green toolbar, the activities in the library would have a green toolbar, not the one defined in library theme. This is the library's theme: <style name="LibraryTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="colorPrimary">@color/red</item> <item name=

How to run unit tests with dependency to an Android library module?

落爺英雄遲暮 提交于 2019-12-04 01:48:52
问题 Whenever I try to run unit-tests for classes in my app module that depend on classes from an library module, I get this: java.lang.NoClassDefFoundError: de/ivu/junittest/DummyData at de.ivu.junittest.app.DummyModel.<init>(DummyModel.java:16) at DummyModelTest.testInstantiation(DummyModelTest.java:7) ... In the above sample, DummyData is part of the lib module, while DummyModel is part of the app module. DummyModel has a member of type DummyData , but instantiating this in the test-class