I've tried to find a solution for my problem but I haven't found it yet.
I'm working on a project that only compiles against Android 3.0, uses Android Library Projects, which are now supported by the maven-android-plugin and also uses AspectJ.
From maven-android-plugin website,
"The currently valid dependencies versions are 1.5_r4, 1.6_r2, 2.1.2 and 2.2.1"
I want to create a Maven 3 configuration for a project in this conditions.
Any hints?
I'm using maven-android-plugin 3.0.0-alpha-7.
Here is a sample provided by maven-android-plugin that you can start with (you need LibraryProjects in 2.9.0-beta download), btw, the website is out of date, I am using 2.3.3 in my current project.
Related
Whenever I install Gradle third-party dependencies, my android studio project doesn't recognize the library classes. For example, I've tried installing a library called fuzzydateformatter. Android studio doesn't recognize the classes from that library. I've also tried installing other third-party libraries but the same thing happens. Only google and androidx libraries seem to work fine.
// Time Formatter
implementation 'si.virag:fuzzydateformatter:1.1.0'
PS: I'm new to android and I use kotlin
That library has not been updated in six years. It is only published on JCenter, which has threatened shutdown a few times. As a result, JCenter is not included as a repository in modern Android Studio projects.
The best solution would be to use another library, one that is actively being maintained.
If you insist on using this library, your choices are:
Use the source code of the library directly, copying it out of GitHub into your project, or
Adding jcenter() as a repository, in the same spot(s) in your project where you have google() and mavenCentral() (e.g., repositories closures in your project-level build.gradle file)
I'm working on an Android app using Android Studio. So far I've been using mavenCentral to depend on all required libraries but now I'd like to add bitcoinj-0.13-SNAPSHOT dependency which is not yet present on mavenCentral.
Is it possible to somehow instruct gradle to get it directly from GitHub repo which is located here: https://github.com/bitcoinj/bitcoinj/tree/master?
For projects that are not yet in mavenCentral you can use JitPack
It will build the github repo for you and provide you with a dependency.
I'm using maven to manage my dependency, how can i add the facebook-androidk-sdk 3.0.1 as library project in pom.
Where i can get the latest code for facebook sdk 3.0.1
I treed to build the apk, but I'm gettting following error please advice how to fix this issue
'drawable' with value '#drawable/com_facebook_picker_list_selector_background_transition'
Samith
The Facebook SDK is a normal Android library, in order to use it with Maven you need to do the following:
Create the apklib
Install the apklib in your local or remote repository
Add the apklib dependency to your project pom.xml
Take a look at the documentation for commands examples:
https://code.google.com/p/maven-android-plugin/wiki/ApkLib
You can obtain the Facebook SDK here: https://developers.facebook.com/android/downloads/
We are standardizing our infrastructure for Android development and we are trying to incorporate dependency management to our Android library projects. My current track is using the maven android plugin with m2e-android. We have uploaded the Android artifacts to our Artifactory repository with the Android SDK Deployer. We also have an internal framework with a few libraries we can import into our projects and for most part it works fine.
The issue we are facing now is that apklib dependencies containing resource files are hard to set up. The maven plugin can correctly configure the classpath but if the apklib has resource files that needs to be referenced by the parent Android project, Eclipse is unable to find them unless you checkout the Library Project and link it to the parent project through ADT.
After reading m2e-android discussion on issue https://github.com/rgladwell/m2e-android/issues/8, https://stackoverflow.com/questions/6269816/creating-closed-source-android-libraries#answer-6270768 and APKLIB does not get installed in Maven Repo, I'm not convinced maven is the way to go until ADT properly support closed source apk libraries.
I'd like to know how are you handling these kind of dependencies on your Android projects. What strategies are there other than using Maven?
For reference, here's what we have tried so far.
No dependency management. All required jars are stored into the lib folder and pushed to the source control repo. Library projects are set up as subfolders and pushed to the source control repo for each project they are used in. Eclipse project settings are also pushed. Project built with standard ADT Ant script.
Jar dependencies into libs folder and library dependencies as git submodules. Project built with standard ADT Ant script.
Dependency management with maven, including library projects with apklib packaging. Issue with resource files in apklibs.
You can have an insight on how Facebook Android developers address their dependencies issues in this video: How Facebook Built Facebook for Android.
They use Buck for that. Buck is a build system for Android that encourages the creation of small, reusable modules consisting of code and resources. Buck is in github
This might not be the best solution for you but maybe for someone else.
With the advent of Android Studio and Gradle, we are no longer facing issues with project dependencies; Android or otherwise.
Gradle supports Maven dependencies in jar or apklib formats. Popular libraries have been exported to the apklib (aar) format and made available through Maven.
can i merge three maven android project into a single one using maven ?
thanks
regards
If the three projects are Android Library projects (<packaging>apklib</packaging>), you should be able to collect them into a single Android Application project (<packaging>apk</packaging>).
Using Maven Android Plugin version 2.9.0-beta-2 or later, you should be able to accomplish that.
Here are the release notes for 2.9.0-beta-1:
http://groups.google.com/group/maven-android-developers/browse_thread/thread/e7978fbf4e4b85f0?pli=1
This is where the apklib support in maven-android-plugin is documented:
http://code.google.com/p/maven-android-plugin/wiki/ApkLib
(be sure to read up on Google's official Android Library documentation which is linked from there too)
Look at the changelog for the latest version to use:
http://code.google.com/p/maven-android-plugin/wiki/Changelog