0

I have a few android projects that i'm trying to put together, but i'm facing some runtime exceptions that i can't understand.

The projects are built like this:


C/C++ Project ProjCore (has .c and .h files)


Android Project ProjB -> uses -> ProjCore

Notes: ProjB implements a Service and uses ProjCore through aidl generated java classes. ProjCore is inside jni folder. NDK is installed. ProjB is configured to run ndk-build automatically. ProjCore's compilation generate a libs dir with a .so file.


Android project ProjA -> uses -> ProjB

Notes: ProjA implements an Activity and uses ProjB Service class.


ProjA and ProjB(including ProjCore) build successfully, the apk are generated, but in runtime, when i run ProjA's activity i get the following error messages:

W/dalvikvm(5357): Unable to resolve superclass of Lcom/signove/health/servicetest/HealthServiceTestActivity$1; (16)

W/dalvikvm(5357): Link of class 'Lcom/signove/health/servicetest/HealthServiceTestActivity$1;' failed

E/dalvikvm(5357): Could not find class 'com.signove.health.servicetest.HealthServiceTestActivity$1', referenced from method com.signove.health.servicetest.HealthServiceTestActivity.<init>

From what I've learned, these messages are often associated with projects using external jars, and people forget to put these jars in libs folder. But the project crashing(ProjA) only has dependency with project ProjB and the dependency is configured in project properties.

I'm using: - Kubuntu 10.04 - Eclipse Indigo - Android NDK-r8 - Eclipse CDT installed

Does anyone know what the problem is?

taciosd
  • 211
  • 4
  • 14
  • 2
    The `$1` indicates that the missing class is an anonymous inner class of `HealthServiceTestActivity`, which it does seem to be able to find. Seems like it's failing to collect all the .class files. You may want to dump the contents of your APK with `dexdump` and see what classes made it in. – fadden Feb 20 '13 at 01:46
  • @fadden Good to know this...but in my case it was something different. – taciosd Feb 21 '13 at 01:40

1 Answers1

2

I just found the problem in my projects. Eclipse android plugins doesn't recognize the aidl folder as a source folder, so it doesn't generate java classes from aidl.

I have fixed this in ProjB but forgot to fix in ProjA (that also has aidl files)...

If anyone with same problem, to fix go in Project -> Properties, select "Java Build Path", go to tab "Source" and add aidl folder. In tab Order and export move "aidl" folder before "src" folder.

Hope that help others.

taciosd
  • 211
  • 4
  • 14