Build Succeeded but once in application fails to run
Closed this issue · 5 comments
I have managed to successfully build a module from source, (had to fix a spelling error in CoreText). But Titanium keeps saying it cannot load it, even though I have included it correctly, clean the build directory etc.
Whats interesting is this line:
[DEBUG] loading: /Users/iantearle/Library/Application Support/iPhone Simulator/5.1/Applications/DB4A6ABC-F06B-4F39-BE76-064C41803ACF/Heritage.app/com.obscure.RichText.js, resource: com_obscure_RichText_js
[WARN] Exception in event callback. Couldn't find module: com.obscure.RichText
.js? there is no RichText.js?
Are you able to shed any light on the situation or provide a compiled module?
There is a pre-compiled ZIP in the downloads section of the project which you can try. I've been using this module in a project for a while; here's how I have it declared in tiapp.xml:
<module platform="iphone" version="1.0">com.obscure.RichText</module>
and here's how I use it:
var RichText = require('com.obscure.RichText');
var view = RichText.createRichTextView({ html: '<b>hello</b>, world' });
When you build and run your app, you should see log output similar to the following:
[DEBUG] Detected module for iphone: com.obscure.RichText 1.0 @ /Users/paul/Library/Application Support/Titanium/modules/iphone/com.obscure.richtext/1.0
[DEBUG] Looking for Titanium Module id: com.obscure.RichText, version: 1.0, platform: iphone
[INFO] Detected third-party module: com.obscure.richtext/1.0
[INFO] [object ComObscureRichTextModule] loaded
The lines won't all be together like that, and the location of the module might vary depending on where you have Titanium installed.
Same problem!
I've build module successfully, after install module, i see /Users/nguyenbinh/Library/Application\ Support/Titanium/modules/iphone/com.obscure.richtext/1.0 and some file, included libcom.obscure.richtext.a , but app is crashed when run var RichText = require('com.obscure.RichText'); and output Couldn't find module: com.obscure.RichText .
Please help me!
I solved by clean build!
When i set height:'auto', width:'auto' and html:'Hello world!', the default richtext view have width and height about 100px, i can't fix width and height value because html code is random length and i need to fit richtext view size with html inside.
When I need the RichText view to expand vertically, I set the top, left, and right properties and set height to Ti.UI.SIZE
. For example:
var view = RichText.createRichTextView({
top: 10,
left: 8,
right: 8,
height: Ti.UI.SIZE
});
If you're adding the RichText view to a parent view like a table view row, make sure the parent height is also set to Ti.UI.SIZE
.
Thanks for you support! I't worked!
Your prebuilt above only run on iOS 5 , any iOS 4.xx device is crashed(module crash, app is still running)! I config this module target to 4.0 and rebuild module by build.py, clean build and reinstall module + rebuild my titanium app successfully! It still crash when render this module(module loaded ok!)! Then i target to 5.11, rebuild again, clean build...module still crash!
Please help!