Significance of com.android.ide.eclipse.adt.LIBRARIES in build path? - android

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)

Related

Exporting an eclipse project as gradle

I have been trying to export my eclipse project as a gradle build file to use it with Android Studio but I can't seem to make it work correctly.
When I click "Finish" nothing happens. If I repeatedly click it, I can see a progress bar that shows for a millisecond and then vanishes.
My ADT is version 22.3 (which is the latest) and I have tried all of the solutions I found on google as well.
Similar questions can be found here:
Eclipse Gradle export of Android project does nothing
Cannot generate gradle.build files from Eclipse
As you can see, there is not really a solid solution for this problem, but people wrote they created it manually. I don't know how to do so though.
Is there any solution for this problem that I haven't heard of? If not, how can I create the file manually?
Apparently, the current edition of the export-to-Gradle support in Eclipse cannot handle a project that is attached to an Android library project. In that case, you would need to (temporarily) detach the Android library project, export the main project, then modify build.gradle to use the library project (manually or via Android Studio).
Generating build.gradle files FIRST FOR ALL of the projects in my dependencies ONE AFTER ANOTHER worked for me.
I generated build.gradle (with export wizrd for facebook, play and whatever other projects I imported and used in my project).
For not trivial Android project you should do it manually.
For the latest build.gradle template for classic Android project check gh.c/N/n-1/b/m/o.n.e.e.g/docs/android/build.gradle.
You can continue to develop in Eclipse with ADT and run Gradle build using Nodeclipse/Enide Gradle for Eclipse
(marketplace)
Some screenshots for Gradle for Eclipse:

Android ActionBarSherlock on NetBeans - working but editor showing errors

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

Android apk builds fine, but shows ClassDefNotFound error when running

I am using Netbeans 7.1.1 and nbandroid plugin updated to latest this morning. When I made a build, everything built fine. I installed the apk on a device that is running Android 2.3.3. I am using sdk tools r19.
I see java.lang.NoClassDefFoundError in logcat when I try to start it.
My ant build script is copying all the libs the apk depends on to its libs directory and building it. For some reason, some classes are not getting packaged into the apk.
Is it a known issue? Is there a workaround?
I see some workarounds for eclipse along the lines of creating a libs folder (instead of lib folder) under project dir. I have libs property jar.libs.dir configured to point to a folder outside of my project. This all seemed to work before, not now.
Remove the jar.libs.dir property you described.
Move your JAR files into the libs directory.
This should give you the expected results.

How to set up Android CTS in Eclipse?

How should I set up Android CTS in Eclipse?
I have tried to follow the guide at Android Open Source Project for setting up CTS development in Eclipse. However, I get build errors when trying to set it up in Eclipse Indigo with android-2.3.7_r1 on Ubuntu 10.04 x86_64.
Eclipse refuses to build the project due to missing libraries. When these libraries are removed from the build path it still won't build, due to several hundred or so missing imports (for example import android.annotation.cts.Profile;).
I had the same problem during the instantiation of AOSP in Eclipse. javalib.jar for google-common_intermediates was missing and the second javalib.jar was also missing. In this case I simply removed the second library from the build path and the first library was simply renamed to android-common_intermediates. Maybe in your case, there are also some renamings?

Eclipse can't remember included "Android Library Projects"

I have several Android Projects marked as "Library Projects". I also have several Projects which use them, obviously.
The problem is, sometimes if I restart eclipse, all those Classes used from Library Projects are marked as "Not Found" and I can't quickfix that (using imports, etc.)
The only way I can fix it is right-click the project which includes library projects, remove all library projects, apply, then add them again. That is REALLY annoying, and I'd like to fix this permanently.
The Projects are using Android Library Projects and are not Library projects themselves. Eclipse Version: 3.7.1 Build id: M20110909-1335
Try upgrading your Eclipse ADT plugin to the 15.0.1 release that shipped earlier this week. After one last fixup using the steps you outlined above, I haven't had a recurrence of this problem.

Categories

Resources