Hi Xavier,

A bit of followup -- I did see one more weird cases where the .class
files were not in the the bin folder, but hard to track down exactly
what was going wrong. I was working in a complex environment where I
had several applications, each depending on one or both of two Android
Library projects. Meanwhile each of the applications, and both of the
libraries, all also depended on a another project which was a non-
Android library.

In various attempts, I included the final project as either a library
or a source folder in each of the other projects. Each attempt failed
in a different way (details available, if you care, but the short
answer is that I found no sane way to create a development environment
with transitive library dependencies).

Anyway, I finally simplified things.  Now, the core stuff is included
in one of my Android Libraries and the other Android Library has no
core dependencies.  I'm playing by the standard rules now, and most of
the weirdness has gone away.


I do still have two problems, even in the very simple case of one app
depending on one Android Library.

1) With both projects open in Eclipse, sometimes I make a change to
source in the library and rebuild. The .class file gets rebuilt in the
library project's bin directory, but not in the bin directory of the
main app. This problem persists across multiple builds, and is only
fixed when I hit it with a heavy sledgehammer -- cleaning all, or
breaking and redoing the library dependency.  Once fixed, it behaves
ok, at least for many hours.

2) The key reason I've divided the project into a library and main app
is that we need to ship the library portion to 3rd-party developers.
But, it looks like there is no way to ship an Android library, except
as as source files. How can we ship an Android component to other
developers in a binary form? (Source shipments are unacceptable,
because of management security concerns).

Thanks,
David

On Jun 27, 12:59 am, deg <[email protected]> wrote:
> Will do.
>
> I did try to duplicate this on a second machine, but no luck. I think
> I've already trained myself in the "right" order of operations.
>
> I'll try to remember what I did differently the first times.
>
> David
>
> On Jun 26, 2:30 am, Xavier Ducrohet <[email protected]> wrote:
>
>
>
> > that's really strange.
>
> > If this happens again, can you check if you have the corresponding
> > .class files in the bin folder of your project?
>
> > Xav
>
> > On Fri, Jun 25, 2010 at 2:10 AM, deg <[email protected]> wrote:
> > > I mean that it did not include the library classes at all. Somehow,
> > > even though all classes were visible at compile time (so the referring
> > > classes in the main app compiled without error), the library classes
> > > were not found at runtime, nor were they present when I spelunked into
> > > the .apk file.
>
> > > This presumably caused by some form of my operator error. But, it's
> > > not clear what I did wrong nor how I fixed it. (I'm still very much an
> > > Eclipse newbie).
>
> > > (That said, thanks for the auto-refresh tip. That will eliminate some
> > > other nagging annoyances I've had).
>
> > > David
>
> > > On Jun 25, 1:06 am, Xavier Ducrohet <[email protected]> wrote:
> > >> What do you mean by "does not include the library classes"?
>
> > >> Does it not include the code at all, or does it seem to include an
> > >> older version of it?
>
> > >> If it the later, I think this may be due to how Eclipse handles the
> > >> linked folder. For eclipse, the files inside src/ in the library is a
> > >> different file from the one in the main project in the linked folder
> > >> coming from the library.
>
> > >> If you edit the one from the library, you have to refresh the main
> > >> project so that it picks it up.
>
> > >> I would change your workspace to automatically refresh, it's a lot
> > >> safer/better/easier. It's in the preferences under General >
> > >> Workspace.
>
> > >> On Thu, Jun 24, 2010 at 6:07 AM, deg <[email protected]> wrote:
> > >> > Thanks.
>
> > >> > It would be great if you could publish a roadmap of how the library
> > >> > feature will look in the future.
> > >> > For example, it would be great if library project could depend on
> > >> > another library project. (Yes, I know I can use an external jar
> > >> > instead. I'm doing that now, but the experience is not as smooth as
> > >> > I'd like).
>
> > >> > Also, per my original message, above, I sometimes see cases where
> > >> > an .apk compiles without errors but does not include the library
> > >> > classes.
>
> > >> > David
>
> > >> > On Jun 23, 8:03 pm, Xavier Ducrohet <[email protected]> wrote:
> > >> >> That's correct.
>
> > >> >> At the moment the manifest of the library is only used to compile the
> > >> >> resource of the library and figure out its package name, so it doesn't
> > >> >> need to contain permissions, activities, services, etc... used by the
> > >> >> library.
>
> > >> >> However, all projects using the library must include those in their
> > >> >> own manifest.
>
> > >> >> In the future (hopefully not too distant) we'll be able to merge the
> > >> >> content of the library manifest so that you don't have to do it
> > >> >> manually for all projects using the library.
>
> > >> >> Xav
>
> > >> >> On Wed, Jun 23, 2010 at 8:52 AM, String 
> > >> >> <[email protected]> wrote:
> > >> >> > On Jun 23, 11:06 am, deg <[email protected]> wrote:
>
> > >> >> >> Also, what are the rules for AndroidManifest elements?
> > >> >> >> - Does the main package or an Android library (or both) need to
> > >> >> >> declare a uses-permission for something that happens in library 
> > >> >> >> code?
> > >> >> >> - If a library implements a BroadcastReceiver should it be 
> > >> >> >> declared in
> > >> >> >> its manifest, or that of the application (or both)?
> > >> >> >> - etc.
>
> > >> >> > The library's manifest ONLY needs a <manifest> element with a
> > >> >> > package="com.mylibrary.packagename" attribute. This isn't in the 
> > >> >> > docs
> > >> >> > AFAIK, but was stated in a post on this group by the Android 
> > >> >> > platform
> > >> >> > dev responsible for libraries. I can attest that I've done mine this
> > >> >> > way and it works fine.
>
> > >> >> > String
>
> > >> >> > --
> > >> >> > You received this message because you are subscribed to the Google
> > >> >> > Groups "Android Developers" group.
> > >> >> > To post to this group, send email to 
> > >> >> > [email protected]
> > >> >> > To unsubscribe from this group, send email to
> > >> >> > [email protected]
> > >> >> > For more options, visit this group at
> > >> >> >http://groups.google.com/group/android-developers?hl=en
>
> > >> >> --
> > >> >> Xavier Ducrohet
> > >> >> Android SDK Tech Lead
> > >> >> Google Inc.
>
> > >> >> Please do not send me questions directly. Thanks!- Hide quoted text -
>
> > >> >> - Show quoted text -
>
> > >> > --
> > >> > You received this message because you are subscribed to the Google
> > >> > Groups "Android Developers" group.
> > >> > To post to this group, send email to 
> > >> > [email protected]
> > >> > To unsubscribe from this group, send email to
> > >> > [email protected]
> > >> > For more options, visit this group at
> > >> >http://groups.google.com/group/android-developers?hl=en
>
> > >> --
> > >> Xavier Ducrohet
> > >> Android SDK Tech Lead
> > >> Google Inc.
>
> > >> Please do not send me questions directly. Thanks!
>
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "Android Developers" group.
> > > To post to this group, send email to [email protected]
> > > To unsubscribe from this group, send email to
> > > [email protected]
> > > For more options, visit this group at
> > >http://groups.google.com/group/android-developers?hl=en
>
> > --
> > Xavier Ducrohet
> > Android SDK Tech Lead
> > Google Inc.
>
> > Please do not send me questions directly. Thanks!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to