i want to develop this app (MyApp) on eclipse i want it to use one librarie of my own, which i am developing at the same time (MyLib)

i create a project MyLib, and tick it as being a library. create a class MyClass with a constructor.

Eclipse -> Window -> Preferences -> User Libraries i add MyLibA (i point out the jar file, the source attachement and the native location).

MyApp Properties -> JavaBuildPaths -> Libraries -> Add Library -> User Library -> MyLib

i start developing MyApp: MyClass mm = new MyClass(); //so far so good, Eclipse even auto-completes the code for me - meaning he knows the librarty is there.

open AVD, debug and, at runtime "Could not find class MyClass referenced from method MyApp.Main()"

what am i missing? if Eclipse incorporates the library on implementation time, why does using the class fails?

note: at a moment i was failling to install MyLib.APK, now it does not complain anymore so I asume it uploads it to the AVD.

grazie mille

有帮助吗?

解决方案

You can directly refer (MyLib) in (MyApp) by right clicking in (MyApp) project (on Package Explorer), and selecting Properties option. Then in Android tab, add (MyLib) in Library list. Note that you have to import the projects into same workspace.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top