Last days I've been trying to create a simple app for Android using Maven and Jersey to connect to my local RESTful service.
First, I created a local client with use of Maven and it worked. Then, I ported it to an Android device and here comes the thing: it throws exceptions.
First of all, there's this issue: https://code.google.com/p/maven-android-plugin/issues/detail?id=97 which was supposed to be fixed with 3.2.1 plugin version. However, I've updated my version to such and the problem still apprears. I tried many newer versions, but the same story there. Cleaning project, restarting IDE, uninstalling application - nothing helps. Had any of you a similar problem?
All files in META-INF-folders are ignored by JavaResourceFilter which is used by ApkBuilder.
The only way to include these files into your apk is to put them there after packaging. so if maven doesn't do it you'll have to take care yourself.
I just did a little customization to build.xml in android-sdk and it works well.
See my post.
Related
Hi everyone,
I'm trying to implement a swipelistview into an android project with Android Studio, of course i'm using gradle, so i try to download the library from a repository, some odd things I realised so far:
The git repository of 47deg/swipelistview is no longer working. (404)
Also the repository from where gradle tries to download the library is no longer accessible 'http://clinker.47deg.com/nexus/content/groups/public'
The project worked like a charm just one week ago, I have an APK witch is deployed in my phone and i'm looking to it as am writing this question.
This happened days ago when I tried to open the project to do some enhancement to the app, nothing related to the swipelistview thought. And when I try to build Android studio says Cannot resolve
com.fortysevendeg.swipelistview:swipelistview:1.0-SNAPSHOT#aar
I tried removing snapshot#aar, changing version of swipelistview... no result.
Question:
Is there a problem with the repository I'm trying to download from?
If not, what are other libraries that can replace the swipelistview library?
I also checked all the related stackoverflow questions, I updated my Android Studio, changed version of gradle, tried to find a Jar of the library, but all of this without any positive result.
Thanks in advance for any efforts you put in this thread. I'm available for any clarifications.
I have a utility library, that I'd like to use in several app projects.
I'd like to be able to work on it without having to deploy to a server every time I change something. I need a way to test it in my app before publishing the changes anywhere.
The way I would normally do this is to install the lib to my local maven repository (by local I mean on my dev machine's hard drive), in order to make it visible to the app projects.
Unfortunately, it seems that gradle install doesn't work on Android projects (see this SO question).
So my question is, what's the recommended way to do this and how do most people do? This seems to me as a fairly common use case!
I describe my current workflow. Maybe it helps you, too.
If I develop a library, which targets a special app, I upload a Snapshot build to my local maven repo (upload works). In my app project I reference the Snapshot build. Each time you build the app project Gradle checks for a new Snapshot release. So you definitely use the most current version of your library.
If the library is finished, I upload a finished (no Snapshot) build with a fixed version to my local repository. Later, if I want to extend the library, I increase the version of the library and add the snapshot suffix again.
I'm pretty happy with this workflow. You may want to take a look at one of my build files. In order to upload a Snapshot build, you only need to add the suffix '-SNAPSHOT' to the version string.
If you are already deploying to the maven local, then you can just add that as a repo source for gradle. At least that's what we did:
repositories {
mavenLocal()
}
It may seem like a dumb question but when I add a maven dependecy in the gradle build file it gets resolved fine and everything works fine. However I dont get the dependency source code or javadocs even though those are available in maven repo and if i create an identical project with same deps in maven i get the source. I am using the latest version of AndroidStudio but I cant seem to find a way to make it work. This seems like a major feature and its definitely a deal braker for me (if i dont find a resolution I will just keep using maven and Intellij instead, since that works fine). Have you encountered a similar issue. I google a lot but all the fixes I saw were mostly patches or advised on downloading the source jars, etc. What's the point of downloading those manually if I were to use a dependency manager...? Any ideas will be highly appreciate, I am sure that someone here faced this same issue when they moved to gradle/Android Studio...
I am currently working on a growing Android project. In order to freeze "Jar Hell" in its tracks I am trying to set up Ivy with Ant to manage dependencies. I have built an ivy.xml file that successfully retrieves all of it's dependencies when called. After doing this I installed the Eclipse IvyDE plugin in order to use the ivy.xml with my current project. All the dependencies show up in Eclipse and when I go to the build path they are there. When I click "Run as android application" everything builds. When the app loads (in either an emulator or an actual phone) it immediately crashes on startup. From what I can tell the dependencies are not being compiled with my app. Eclipse itself seems to be aware of the dependencies because it does not produce any error messages.
So... Can anyone point me in the right direction to solve this problem? Is there something I am misunderstanding about Ivy or the IvyDE Plugin? Thanks!
I have also looked at this question Add Ivy managed dependencies to Android build path where the asker seemed to be having the same problem. I am using the most current version of all tools involved.
Although no one responded to this I figured I would answer it to show any other lost googlers what I have done. It turned out my problem was related to how I had ivysettings.xml set up. I was misunderstanding the way that retrieve pattern works. Fortunately, I found this project on GitHub which demonstrates how to use Ivy with an Android project. This example project provided a solid foundation for me to work with I hope it can help you too.
https://github.com/h8/IvyAndroidExample
I've started work on an Android App that will work with Google Docs.
UPDATE 12/9: From the information I've come across, it seems Google Docs is not supported by this library. The question is probably still relevant in general, but seem not specifically for this project as I can't use the library anyway.
I was doing some research and come across the Google APIs Client Library for Java
I decided to start with the tasks-android-sample to begin learning how to utilize this library.
I followed these instructions
I successfully installed Mercurial and Maven and already had Java 7 installed.
I was able to execute these commands
cd [someDirectory]
hg clone https://code.google.com/p/google-api-java-client.samples/ google-api-java-client-samples
cd google-api-java-client-samples/shared/shared-sample-android
[editor] src/main/java/com/google/api/services/samples/shared/android/ClientCredentials.java
mvn source:jar install
I was also successful in setting up the Mercurial plugin (not sure what this did for me -- I believe the hg command above is the only time Mercurial was involved) and Maven plugin
Finally, I was able to imported the tasks-android-sample, compile it, run it on the emulator and I was able to see the tasks I created on my google account.
I then repeated the process, except this time I simply imported sample's source code and the required JARs into a new Android project and added the ClientCredentials.java manually to the project (So I could specify my Google API Key).
I was also able to compile and run this project and it operated as expected.
My questions in all this is which method is preferred? Or is it a personal choice? Are there benefits to using Maven that I'm not realizing at this time?
Maven helps you download proper dependency libraries for the project, and can reduce the burden of find and download proper libraries.
It's fine to just put dependency libs in your code base. It's a personal choice.