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?
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.