I have a Android project that is currently built and deployed to a internal website by a Hudson build server. Recently we added the android-support-v7-appcompat library as a dependency (library project).
My question is, how do I include the android-support-v7-appcompat resources and library into my build script? Do I copy the actual files into my project with the build script (don't even know if the app will then still recognize the library) or will this automatically happen when the build file (to build the apk) is executed?
In the end the only thing I had to do was generate a build file for the appcompat library. After that the build was successful.
Related
I have an Android App set up as an eclipse project and associated library projects. I create jars from these library projects and share them with customers and/or plug in into my app's libs folder.
Now, I am moving my entire project to Android Studio and I notice that the library projects in Android Studio create .aar files by default.
I am not sure if it will be an easy task to request customers to start using .aar, so I want to stick with .jar files.
I was wondering if there are any detailed tutorials for creating .jar files from an Android Studio project. Any help would be appreciated :)
I am trying to import this Android Backend Starter Client project into Android Studio.
It's an Eclipse project which means that to import it into Android Studio it needs to be exported from Eclipse with the Generate Gradle Build files option.
The project has as dependency Google Play services. I have imported the Google Play Sevices source code from the SDK as another Eclipse project.
The issue is that when I try to export the main project, Eclipse complains that it cannot find the Google Play Services project, even though the project is open in Eclipse. See the image below.
I have to mention that both of the projects are compiling and that I am using the Windows version of Eclipse.
I managed to export the project from eclipse. The issue was that the google-play-services_lib project was not located in the same workspace as the solutions-mbsac project. Once I moved it to the same workspace the export worked.
To import it into Android Studio I still had to modify the generated gradle.build files a bit and to update to the latest gradle.
The Eclipse export generates paths for the source files, but it generates them with \. This causes the import into Android Studio to fail. The \ need to be replaced with /.
To update to the latest gradle I just replaced the dependencies in the gradle.build file and replaced the gradle-wrapper files with other files generated by Android Studio.
After making all these changes the project imported successfully into Android Studio.
I am working alongside with two other developers in an android application. In the application we use other third-party libraries like SlidingMenu.
In eclipse we should include the SlidingMenu project and point our application to use this project as library.
Now I want to automate the building of the application using Hudson(Jenkins) but I have no Idea how I will deal with the dependence libraries like SlidingMenu.
Any Ideas
So long as you can build your app on the command line (e.g. using the Ant or Gradle build systems for Android), then you can build your app in Jenkins.
For the Ant build system, all you need to do is place your dependency JARs in the "libs" directory.
Or if you're using library projects, the Eclipse plugin should have already added the required entries to your project.properties file.
I'm using NetBeans for android application. I installed properly (I think) ActionBarSherlock package as android library project. Everything works fine, I can build and run application, but code editor doesn't recognize ABS classes (just look at screenshot, BUILD SUCCESSFUL but errors exists) and code completion doesn't work too.
My configuration:
Stable NetBeans 7.2 with android plugin ver. 1.13
Linux Mint 13 Maya 64 bit, Mate
ActionBarSherlock ver 4.2 (stable)
How I installed ABS:
Download and extract source
From sdk/tools run command:
./android update project -p path_to_ActionBarSherlock/library/
Similar command to connect android project library with my test project (there is similar option in Netbeans IDE but I get error that this is not android library project)
./android update project -l path_to_ActionBarSherlock/library/ -p path_to_my_test_project
I have tried clean and build on both projects but no results. Any idea?
Regards
The way I finally managed to add ActionBarSherlock to my android project on Netbeans was to:
Download the latest version of ActionBarSherlock and unzip it
Go to the subfolder called library and remove the pom.xml file from there (with one of the previous versions it didn't work. I had to first build it, close it and remove not only pom.xml but also some netbeans properties files)
Open that subproject (library) in the Netbeans
Now this project will no longer be seen as a maven project. Netbeans will see it as an Android project. Then I:
Clean&build it
Add it to my-project's library properties (right-click on my-project, properties, library, add, point the proper location of library project). Important here was to copy/move that library project somewhere near my-project. Otherwise it claimed that it cannot open it.
And from now on it works fine.
Key to that thinking was that Netbeans didn't want to add the provided library project cause it saw it as a Maven project. When the pom is deleted, Netbeans no longer sees it as Maven project nut as an Android project and it can without any objections add it as an Android's project library.
Probably there are better solutions, but I didn't find any and that was the only one working for me.
Hope it helps.
You can also make a new Android project, and then copy and paste the needed files in the new project.
So only copy:
libs, res, src, AndroidManifest.xml
I've update to the latest SDK(4.0.x), tools(r16) and plugin(16.0.1) for Eclipse. I notice that now nearly all my projects in Eclipse have the library mentioned in this question's title showing as a referenced library in the Libraries tab of the Java build path. This is relatively new, though I'm not sure in which upgrade of the SDK it appeared.
It's not causing any problems but I'd quite like to know what its purpose is?
Interestingly it does not appear in projects which I also build using Ant from the command line. In these projects I send the Ant built binaries to a folder outside the Eclipse workspace. These projects naturally have a build.xml, an ant.properties and a proguard.cfg in the project root. This I suspect has something to do with why the com.android... library isn't in the build path. These projects build perfectly OK when built under Eclipse.
None of my projects are library projects.
Update: If I delete it from the Java build path, it appears to have no ill effects, in so far as the app still builds (even under Eclipse) and runs OK.
If you have any "Android Libraries" set in the Android section of the project then these are for linking in those libraries (the jars that the plugin will build)