Titanium Android module fails with "does not have a main jar file"

237 views Asked by At

I've created my own new Android Titanium module. The module build was successful and I have the artefact in the dist directory.

I've dropped the zip file inside my project, setup tiapp.xml, cleaned the project, but when running on the device I'm getting the red screen saying

Uncaught Error: Requested module not found: com.myproject.mymodule

I even tried extracting the zip manually and not let Studio do it. I cleaned the project several times.

Why wouldn't it find my module?

EDIT

I now notice a WARN message while compiling the app:

Module com.myproject.mymodule version 1.0.0 does not have a main jar file

I'm doing an ant build from eclipse and everything seems fine. I see the jar file created and present in the module directory inside my project.

2

There are 2 answers

0
Saeed Sharman On

You can try doing packaging the module in SDK location or in the particular project and see if things work. What I have always done is packaging the module in SDK location and add it in tiapp.xml of the project I want to use the module without facing any error like this.

0
miga On

Was facing the same error right now and I had a look at the place the error messages appears. It's searching for module.manifest.name.toLowerCase() + '.jar'. So have a look at the modules/android/com.myproject.mymodule/1.0/ folder: the jar file should have the name that is inside the mainifest file (name tag)

The the warning should disappear and the module should be loaded correctly.