0

I have three Android Projects in Eclipse:

App A (hosts a Service)

App B (uses Service from A)

AIDL (definition and some custom parcelables)

APP A launches APP B. APP B uses an Service via AIDL from APP A. Works well so far. The Problem is that custom parcelable Objects are not seen in APP B. It always results in and ClassNotDef Error.

I never seen such a szenario in any Example as their always much easier than my scenario. It seems eclipse is not adding the custom Parcelable files into APP B from the AIDL Project. I do not know why, but the generated Java files contain the correct Parcelable references, but their missing in the AIDL project.jar or /bin folder.

I've read about copy the AIDL files around, but to be honest this is the least i want to do as ths violates having an good project structure.

We also use maven for the build on our CI Servers, and there the Generated Java Classes and the custom Parcelables are in my APKLIB Project as expected.

To me it looks more like an Eclipse Problem than anything else as maven compiles and runs the project as expected.

Anyone can provide me an hint to setup such a scenario that can be started from with in Eclipse ?

Kitesurfer
  • 3,438
  • 2
  • 29
  • 47

1 Answers1

0

If you want to share Parcelable types between the two apps, you will have to define them in a separate Android library project in Eclipse, and have both of your application projects depend on it.

As you probably already know, for each Parcelable com.yourpackage.YourParcelableClass, to be able to refer to the Parcelable type in AIDL you also need to put a file YourParcelableClass.aidl in the same directory as YourParcelableClass.java, with contents:

package com.yourpackage;

parcelable YourParcelableClass;
Tobias
  • 1,107
  • 7
  • 8
  • thats still not explain why the parcelable types get not seen by APP A and B. This makes no sense to me ... – Kitesurfer Apr 26 '13 at 08:33