android-library

Android Library Dependencies broken after SDK/ADT-Update

China☆狼群 提交于 2019-12-03 23:27:57
Today, I updated my Android SDK and Eciple ADT to the most recent versions (ADT Rev 22). After restarting Eclipse it is quite unhappy with the Build Paths whenever I reference custom libraries. An example is shown in this screenshot: My custom "Android Utilities Library" compiles fine, but everything that depends on it shows build path errors. E.g. when I investigate the build path settings for "Android URA Library" it shows me an error with the android_utilities_library.jar missing under "Android Dependencies" (which in fact is true, the libraries will be built to individual class files in

Does an Android Library need a manifest ,app_name,Icon?

六眼飞鱼酱① 提交于 2019-12-03 22:03:42
I have an android Library that outputs an aar library. This library will be built into different projectFlavors of Mobile, TV and Wear apps. I think that each of these platforms' should be the ones that set variables like the app name, icon, and permissions through the manifest and productflavors. Is there any way to build an AAR without requiring an AndroidManifest.xml and therefore drawables(for the icon)? More information about what I'm doing can be found at my last question on the subject : Android Studio Java Library Module vs. Android Library Module Any android library needs to have an

Android with Gradle and Proguard

廉价感情. 提交于 2019-12-03 21:33:59
I'm just created a new Android Library project using Gradle and would like the code to be optimized and obfuscated with via Proguard. Here is the android portion the build.gradle file: android { compileSdkVersion 19 buildToolsVersion "19.0.1" defaultConfig { minSdkVersion 14 targetSdkVersion 19 versionCode 1 versionName "1.0" } release { runProguard true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.txt' } } When I run the gradle build command from terminal it fails at :library:proguardRelease with the message: * What went wrong: Execution failed for

How to exclude a jar-file from my Android library build target

佐手、 提交于 2019-12-03 16:20:15
I am using Android Studio and have a several apps that rely on the same code. I moved shared code to a separate library in order to include it in my apps. The library project ( MyLib ) that I created for this purpose requires a jar-file to compile, so I added it to project's libs directory. My build.gradle of MyLib main module looks like this: apply plugin: 'com.android.library' android { compileSdkVersion 21 buildToolsVersion "20.0.0" defaultConfig { applicationId "com.example.android" minSdkVersion 9 targetSdkVersion 21 versionCode 1 versionName "1.0" } buildTypes { release { } } }

Gradle configuration with multi-module android library

≡放荡痞女 提交于 2019-12-03 15:05:43
Back history I have this android library aar that devs can use normally with compile 'com.companyname.sdk:android-sdk:2.x' and now we're doing a re-write of the library from scratch to create V3. On this re-organization we managed to break the lib into modules. So one could say that on V3 we would have the following artifacts compile 'com.companyname.sdk:core:3.x' compile 'com.companyname.sdk:extra_1:3.x' compile 'com.companyname.sdk:extra_2:3.x' compile 'com.companyname.sdk:extra_ .... and this would give on the gradle structure the following modules: root: |- test_app (apk just for testing,

Can't add modules on project structure in Android Studio

点点圈 提交于 2019-12-03 13:00:53
The structure project window does not show all the options and I can not add libraries or modules. Check the image: And this is how it should look with all the options: I try to fix that reinstalling androidstudio, but it didn't work. I'm using Android Studio 2.9 and i already have working ABS, but i can't make work HoloEverywhere Is there any solution for this problem? Beforehand, thanks Do Right Mouse Click on visible package, then select 'Open Module Settings' - it will give you ability to add Module. I added a screenshot to show exacly what I mean. It's a workaround but it give you ability

How to ship library for Android

对着背影说爱祢 提交于 2019-12-03 08:08:57
I want to develop a library for Android. In what form can I ship it? jar, apk or something else? How should I do it so that other developers can use my library in their application? If your library is pure Java code, a JAR is fine, perhaps ZIPped with documentation, etc. If you need resources or other Android-specific non-Java stuff, you should look at using an Android library project . That is best shipped as source code, though there are tricks for packaging it up in (mostly) binary form. And the new Gradle-based build system under development should make it easier to create library projects

Ant rebuilding library projects every time

眉间皱痕 提交于 2019-12-03 07:59:06
I have an Android project that includes two Android Library projects. I'm using the command ant debug to build the project and it takes around 1min and 20sec. I've counted that 17 seconds are used to compile the first android library project and 42 seconds are used to compile the second android library project. Since these two dependency projects are rarely updated it's not necessary to compile them each time. How can I avoid ant compiling the two Android library projects each build? Add dont.do.deps=1 to your local.properties (or pass this property to ant some other way) yorkw This is how

Aspectj with android library

一曲冷凌霜 提交于 2019-12-03 06:28:43
问题 I have a lib that use aspects and is available via maven, now I'm trying to use that lib in an android application. If I include this plug-in in the app gradle file, everything works fine, but my goal is to extract the classpath 'com.uphyca.gradle:gradle-android-aspectj-plugin:0.9.+' and the apply plugin: 'android-aspectj' (required by the plugin) to the my.lib gradle file instead of declaring in my app. Is that possible? app gradle file: classpath 'com.uphyca.gradle:gradle-android-aspectj

How to avoid unused resources and code from an Android Library Project getting into my APK?

僤鯓⒐⒋嵵緔 提交于 2019-12-03 06:24:44
I have an Android Library Project in my Eclipse workspace, that I use as a unique toolbox. By chance(1), I just discovered that resources from the library (xml animations, xml layouts, even drawables!!!) are packed into the APK's of the projects that use the library, even if I don't use them. After reading Does android always package unused resources? , I wonder if it's normal. How can I avoid this? Is the only way having different library projects? EDIT : I've found, decompiling the .dex, that unused code too makes it into the apk. (1) I was trying to test a new icon for my app, /res/drawable