I did make sure that there were no R.xx classes in the service, infact I dont need any resources in the service. I did double check again and nothing was present, although an import definition to resources class was left there. I wasn't sure if it would make a difference, but I removed that definition anyway and recompiled the jar without any different result. The application loading the jar, still cannot bind to the service. The service is a very simple class that just instantiates a set of regular java classes (nothing specific to Android). I'm not even able to debug into the service, I have a break point at onStart() and onCreate() methods and it never falls there. I will continue looking. .thanks.
On Monday, February 11, 2013 12:12:17 PM UTC-8, Streets Of Boston wrote: > > Maybe this service class uses/loads other classes that fail to load. > > Strong candidates that may fail to load are R.xxxx classes and their > members: If your JAR is generatedfrom a library project and if you > distribute just the JAR file, you may not distribute any R.xxxx classes > along with it, since these are not included in the JAR generation of a > library project. > > On Monday, February 11, 2013 2:57:54 PM UTC-5, RKSHR wrote: >> >> I have an external jar file that we have been using to import into an >> application apk. Recently I added a Android service class into the jar >> file, now when I import the file into an apk, I can instantiate all classes >> except the service. I have declared the service in the applications >> manifest file (with fully qualified class path), but when I try to bind to >> the service using context.bindService(intent, connection, >> BIND_AUTO_CREATE), nothing happens. I dont get any exception, nor an error >> message, but service is not instantiated, as the return value for >> bindService is false. >> >> I examined the contents of jar file to make sure that the service class >> is actually included. I also further dedexd the application dex file and >> even there the library service class was present. Any ideas what could be >> the problem? I have read several posts on this, but still unable to figure >> out the problem. What I really want to achieve is provide a Android >> service class in a library (jar file), so application developers can simply >> bind to the service and it starts the run within the context of the >> application. I don't want the service to be remote, hence not using AIDL. >> Also the jar is built using ant build.xml, its not marked as a library >> project, but just as a regular jar file that can be imported into any >> application. The goal is to distribute the jar file without the source >> code, hence not marking it as library. >> >> RK. >> >> -- -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

