Quantcast
Channel: Appcelerator Developer Center Q&A Tag Feed (android)
Viewing all articles
Browse latest Browse all 7655

Ti.Include cannot find file for Android

$
0
0

Hi,

I'm working with the latest version of studio and am having a problem with Ti.Include for my android build.

I have a file at app/assets/include/GUIFactory.js. The file is included and works as expected for IOS but I always get an error when I run on android. I have tried the following include statements without success:

Ti.include("/include/GUIFactory.js");

Ti.include("include/GUIFactory.js");

Ti.include( Titanium.Filesystem.resourcesDirectory+ "/include/GUIFactory.js");

Ti.include( Titanium.Filesystem.resourcesDirectory+ "include/GUIFactory.js");

Here's my console error:

INFO] : dalvikvm: Wrote stack traces to '/data/anr/traces.txt' [INFO] : itemclick: reports [ERROR] : TiAssetHelper: Error while reading asset "Resources/include/GUIFactory.js": [ERROR] : TiAssetHelper: java.io.FileNotFoundException: Resources/include/GUIFactory.js [ERROR] : TiAssetHelper: at android.content.res.AssetManager.openAsset(Native Method) [ERROR] : TiAssetHelper: at android.content.res.AssetManager.open(AssetManager.java:315) [ERROR] : TiAssetHelper: at android.content.res.AssetManager.open(AssetManager.java:289) [ERROR] : TiAssetHelper: at org.appcelerator.kroll.util.KrollAssetHelper.readAsset(KrollAssetHelper.java:77) [ERROR] : TiAssetHelper: at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) [ERROR] : TiAssetHelper: at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:64) [ERROR] : TiAssetHelper: at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:884) [ERROR] : TiAssetHelper: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1107) [ERROR] : TiAssetHelper: at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:327) [ERROR] : TiAssetHelper: at ti.modules.titanium.ui.widget.listview.ListViewProxy.handleMessage(ListViewProxy.java:215) [ERROR] : TiAssetHelper: at android.os.Handler.dispatchMessage(Handler.java:95) [ERROR] : TiAssetHelper: at android.os.Looper.loop(Looper.java:137) [ERROR] : TiAssetHelper: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) [ERROR] : TiExceptionHandler: (main) [5792,5792] ----- Titanium Javascript Runtime Error ----- [ERROR] : TiExceptionHandler: (main) [0,5792] - In alloy/controllers/reports.js:113,19 [ERROR] : TiExceptionHandler: (main) [1,5793] - Message: Uncaught ReferenceError: GUIFactory is not defined [ERROR] : TiExceptionHandler: (main) [0,5793] - Source: var _GF = new GUIFactory(); [ERROR] : V8Exception: Exception occurred at alloy/controllers/reports.js:113: Uncaught ReferenceError: GUIFactory is not defined

Does anyone have any ideas?

Thanks


Viewing all articles
Browse latest Browse all 7655

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>