Android Library Project - can't find class from library project at runtime? -


i'm trying create android library project can make lite , full version of app shared code. following directions here:

http://developer.android.com/guide/developing/projects/projects-eclipse.html http://blog.donnfelker.com/2010/08/05/howto-android-full-and-lite-versions/ 

running lite version throws classnotfoundexception @ runtime because cannot find activity class shared project. it's if project linking (properties -> java build path -> projects -> add) isn't including of .class files @ runtime.

anyone else running problem? don't want export .jar library project because other method can share activities , such ideal. manifest of "lite" project, references library project activity:

<application    android:name="com.me.test.lib.app">   <activity      android:name="com.me.test.lib.activitymain" > 

it can't find either app class or activitymain class part of library project.

thanks


the exception - path in componentinfo looks wrong, should nested that?

04-29 16:49:01.759: error/androidruntime(2349):    java.lang.runtimeexception: unable instantiate activity   componentinfo{     com.me.test.lite/com.me.test.lib.activitymain}:      java.lang.classnotfoundexception: com.me.test.lib.activitymain      in loader dalvik.system.pathclassloader[/data/app/com.me.test.lite-2.apk] 

i had problem when trying access activity in toolkit library. make sure project using library puts activities in own manifest. toolkit doesn't specify activities in manifest. sounds did part right. linking library android projects different java projects.

for library project

right click eclipse project, select properties. go android tab. check box says "is library"

for application using library

right click eclipse project, select properties. go android tab. add library project reference


Comments