java.io.FileNotFoundException: Resources/ui/win1.js

Appcelerator JIRA | Shawn Lipscomb | 4 years ago
  1. 0

    h4.Problem When a window is created with the *url* property, that url used to be (2.1.2 and earlier) treated as relative to the Resources directory. Now (2.2.0.v20120904164912) it is treated as relative to the directory of the calling js file. If the calling js file is in a subdirectory, an error (java.io.FileNotFoundException) is generated. This is going to break a lot of existing code. Works in 2.1.2 Broken in 2.2.0.v20120904164912 h4.Testcase Note in this example that the "loader.js" file is in a "ui" subdirectory. {panel:title=app.js} {code} Ti.UI.setBackgroundColor('#000'); Ti.include('ui/loader.js'); {code} {panel} {panel:title=ui/loader.js} {code} var win1=Ti.UI.createWindow({ title:'Window 1', backgroundColor:'#fff', url:'win1.js' }); win1.open(); {code} {panel} {panel:title=win1.js} {code} var winOne = Ti.UI.currentWindow; var label1 = Ti.UI.createLabel({ color:'#999', text:'I am Window 1', font:{fontSize:20,fontFamily:'Helvetica Neue'}, textAlign:'center', width:'auto' }); winOne.add(label1); {code} {panel} h4.Error log ... [ERROR][TiAssetHelper( 345)] Error while reading asset "Resources/ui/win1.js": [ERROR][TiAssetHelper( 345)] java.io.FileNotFoundException: Resources/ui/win1.js [ERROR][TiAssetHelper( 345)] at android.content.res.AssetManager.openAsset(Native Method) [ERROR][TiAssetHelper( 345)] at android.content.res.AssetManager.open(AssetManager.java:313) [ERROR][TiAssetHelper( 345)] at android.content.res.AssetManager.open(AssetManager.java:287) [ERROR][TiAssetHelper( 345)] at org.appcelerator.kroll.util.KrollAssetHelper.readAsset(KrollAssetHelper.java:77) [ERROR][TiAssetHelper( 345)] at org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method) [ERROR][TiAssetHelper( 345)] at org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:140) [ERROR][TiAssetHelper( 345)] at org.appcelerator.kroll.KrollRuntime.handleMessage(KrollRuntime.java:284) [ERROR][TiAssetHelper( 345)] at org.appcelerator.kroll.runtime.v8.V8Runtime.handleMessage(V8Runtime.java:166) [ERROR][TiAssetHelper( 345)] at android.os.Handler.dispatchMessage(Handler.java:95) [ERROR][TiAssetHelper( 345)] at android.os.Looper.loop(Looper.java:123) [ERROR][TiAssetHelper( 345)] at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:108) {panel}

    Appcelerator JIRA | 4 years ago | Shawn Lipscomb
    java.io.FileNotFoundException: Resources/ui/win1.js
  2. 0

    h4.Problem When a window is created with the *url* property, that url used to be (2.1.2 and earlier) treated as relative to the Resources directory. Now (2.2.0.v20120904164912) it is treated as relative to the directory of the calling js file. If the calling js file is in a subdirectory, an error (java.io.FileNotFoundException) is generated. This is going to break a lot of existing code. Works in 2.1.2 Broken in 2.2.0.v20120904164912 h4.Testcase Note in this example that the "loader.js" file is in a "ui" subdirectory. {panel:title=app.js} {code} Ti.UI.setBackgroundColor('#000'); Ti.include('ui/loader.js'); {code} {panel} {panel:title=ui/loader.js} {code} var win1=Ti.UI.createWindow({ title:'Window 1', backgroundColor:'#fff', url:'win1.js' }); win1.open(); {code} {panel} {panel:title=win1.js} {code} var winOne = Ti.UI.currentWindow; var label1 = Ti.UI.createLabel({ color:'#999', text:'I am Window 1', font:{fontSize:20,fontFamily:'Helvetica Neue'}, textAlign:'center', width:'auto' }); winOne.add(label1); {code} {panel} h4.Error log ... [ERROR][TiAssetHelper( 345)] Error while reading asset "Resources/ui/win1.js": [ERROR][TiAssetHelper( 345)] java.io.FileNotFoundException: Resources/ui/win1.js [ERROR][TiAssetHelper( 345)] at android.content.res.AssetManager.openAsset(Native Method) [ERROR][TiAssetHelper( 345)] at android.content.res.AssetManager.open(AssetManager.java:313) [ERROR][TiAssetHelper( 345)] at android.content.res.AssetManager.open(AssetManager.java:287) [ERROR][TiAssetHelper( 345)] at org.appcelerator.kroll.util.KrollAssetHelper.readAsset(KrollAssetHelper.java:77) [ERROR][TiAssetHelper( 345)] at org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method) [ERROR][TiAssetHelper( 345)] at org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:140) [ERROR][TiAssetHelper( 345)] at org.appcelerator.kroll.KrollRuntime.handleMessage(KrollRuntime.java:284) [ERROR][TiAssetHelper( 345)] at org.appcelerator.kroll.runtime.v8.V8Runtime.handleMessage(V8Runtime.java:166) [ERROR][TiAssetHelper( 345)] at android.os.Handler.dispatchMessage(Handler.java:95) [ERROR][TiAssetHelper( 345)] at android.os.Looper.loop(Looper.java:123) [ERROR][TiAssetHelper( 345)] at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:108) {panel}

    Appcelerator JIRA | 4 years ago | Shawn Lipscomb
    java.io.FileNotFoundException: Resources/ui/win1.js
  3. 0

    [Android] Service not working

    GitHub | 2 years ago | rotorgames
    java.io.FileNotFoundException: appdata-private://FindMe/services/boot.js
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    h2.Problem When a window with a url property is created from within a CommonJS unit, where the CommonJS unit resides in a subdirectory, includes that are within the window's unit (specified in the url property) used to be (2.1.4 and earlier) treated as relative to the Resources directory. Now (3.0.2.GA) it is treated as relative to the directory of the CommonJS file. If the CommonJS file is in a subdirectory, an error (APP PROXY: ti.modules.titanium.app.AppModule) is generated. This breaks a lot of existing code. Note that in the error message, the "ui" subdirectory is doubled: Error while reading asset "Resources/ui/ui/MyInclude.js" Works in 2.1.4.GA Broken in 3.0.2.GA h2.Testcase Note in this example that the "MakeWin.js" and "MyInclude.js" files are in a "ui" subdirectory. {panel:title=app.js} {code} Ti.UI.setBackgroundColor('#000'); require('ui/MakeWin'); {code} {panel} {panel:title=ui/MakeWin.js} {code} var win1=Ti.UI.createWindow({ title:'Window 1', backgroundColor:'#fff', url:'win1.js' }); win1.open(); {code} {panel} {panel:title=win1.js} {code} Ti.include('ui/MyInclude.js'); var winOne = Ti.UI.currentWindow; var label1 = Ti.UI.createLabel({ color:'#999', text:'I am Window '+MyValue, font:{fontSize:20,fontFamily:'Helvetica Neue'}, textAlign:'center', width:'auto' }); winOne.add(label1); {code} {panel} {panel:title=ui/MyInclude.js} {code} var MyValue=5; {code} {panel} h2.Error Log: [ERROR][TiApplication( 386)] (KrollRuntimeThread) [1417,1417] APP PROXY: ti.modules.titanium.app.AppModule@43e51900 [ERROR][TiAssetHelper( 386)] Error while reading asset "Resources/ui/ui/MyInclude.js": [ERROR][TiAssetHelper( 386)] java.io.FileNotFoundException: Resources/ui/ui/MyInclude.js [ERROR][TiAssetHelper( 386)] at android.content.res.AssetManager.openAsset(Native Method) [ERROR][TiAssetHelper( 386)] at android.content.res.AssetManager.open(AssetManager.java:313) [ERROR][TiAssetHelper( 386)] at android.content.res.AssetManager.open(AssetManager.java:287) [ERROR][TiAssetHelper( 386)] at org.appcelerator.kroll.util.KrollAssetHelper.readAsset(KrollAssetHelper.java:77) [ERROR][TiAssetHelper( 386)] at org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method) [ERROR][TiAssetHelper( 386)] at org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:140) [ERROR][TiAssetHelper( 386)] at org.appcelerator.kroll.KrollRuntime.handleMessage(KrollRuntime.java:289) [ERROR][TiAssetHelper( 386)] at org.appcelerator.kroll.runtime.v8.V8Runtime.handleMessage(V8Runtime.java:166) [ERROR][TiAssetHelper( 386)] at android.os.Handler.dispatchMessage(Handler.java:95) [ERROR][TiAssetHelper( 386)] at android.os.Looper.loop(Looper.java:123) [ERROR][TiAssetHelper( 386)] at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112)

    Appcelerator JIRA | 4 years ago | Shawn Lipscomb
    java.io.FileNotFoundException: Resources/ui/ui/MyInclude.js
  6. 0

    Running an app compiled with mobile sdk 4.0.0.beta2 throw an alert showing a security violation because the device is rooted and then close. It also log a misleading error on the console: {code} [ERROR] : TiAssetHelper: Error while reading asset "Resources/app.js": [ERROR] : TiAssetHelper: java.io.FileNotFoundException: Resources/app.js [ERROR] : TiAssetHelper: at android.content.res.AssetManager.openAsset(Native Method) [ERROR] : TiAssetHelper: at android.content.res.AssetManager.open(AssetManager.java:313) [ERROR] : TiAssetHelper: at android.content.res.AssetManager.open(AssetManager.java:287) [ERROR] : TiAssetHelper: at org.appcelerator.kroll.util.KrollAssetHelper.readAsset(KrollAssetHelper.java:62) [ERROR] : TiAssetHelper: at org.appcelerator.titanium.TiLaunchActivity.loadActivityScript(TiLaunchActivity.java:103) [ERROR] : TiAssetHelper: at org.appcelerator.titanium.TiLaunchActivity.windowCreated(TiLaunchActivity.java:151) [ERROR] : TiAssetHelper: at org.appcelerator.titanium.TiRootActivity.windowCreated(TiRootActivity.java:107) [ERROR] : TiAssetHelper: at org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:543) [ERROR] : TiAssetHelper: at org.appcelerator.titanium.TiLaunchActivity.onCreate(TiLaunchActivity.java:144) [ERROR] : TiAssetHelper: at org.appcelerator.titanium.TiRootActivity.onCreate(TiRootActivity.java:96) [ERROR] : TiAssetHelper: at android.app.Activity.performCreate(Activity.java:5933) [ERROR] : TiAssetHelper: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105) [ERROR] : TiAssetHelper: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251) [ERROR] : TiAssetHelper: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360) [ERROR] : TiAssetHelper: at android.app.ActivityThread.access$800(ActivityThread.java:144) [ERROR] : TiAssetHelper: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278) [ERROR] : TiAssetHelper: at android.os.Handler.dispatchMessage(Handler.java:102) [ERROR] : TiAssetHelper: at android.os.Looper.loop(Looper.java:135) [ERROR] : TiAssetHelper: at android.app.ActivityThread.main(ActivityThread.java:5221) [ERROR] : TiAssetHelper: at java.lang.reflect.Method.invoke(Native Method) [ERROR] : TiAssetHelper: at java.lang.reflect.Method.invoke(Method.java:372) [ERROR] : TiAssetHelper: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899) [ERROR] : TiAssetHelper: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694) [ERROR] : TiAssetHelper: Error while reading asset "Resources/app.js": [ERROR] : TiAssetHelper: java.io.FileNotFoundException: Resources/app.js [ERROR] : TiAssetHelper: at android.content.res.AssetManager.openAsset(Native Method) [ERROR] : TiAssetHelper: at android.content.res.AssetManager.open(AssetManager.java:313) [ERROR] : TiAssetHelper: at android.content.res.AssetManager.open(AssetManager.java:287) [ERROR] : TiAssetHelper: at org.appcelerator.kroll.util.KrollAssetHelper.readAsset(KrollAssetHelper.java:62) [ERROR] : TiAssetHelper: at org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method) [ERROR] : TiAssetHelper: at org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:177) [ERROR] : TiAssetHelper: at org.appcelerator.kroll.KrollRuntime.handleMessage(KrollRuntime.java:299) [ERROR] : TiAssetHelper: at org.appcelerator.kroll.runtime.v8.V8Runtime.handleMessage(V8Runtime.java:203) [ERROR] : TiAssetHelper: at android.os.Handler.dispatchMessage(Handler.java:98) [ERROR] : TiAssetHelper: at android.os.Looper.loop(Looper.java:135) [ERROR] : TiAssetHelper: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) {code} This issue is happening on a rooted nexus 4 and on a non-rooted nexus 7(2012) (that was previously rooted before last os update). The android version is 5.0.1 and 5.0.2

    Appcelerator JIRA | 2 years ago | Giulio De Giorgio
    java.io.FileNotFoundException: Resources/app.js

  1. malhobayyeb 1 times, last 2 weeks ago
  2. Alexandru Popa 6 times, last 2 weeks ago
  3. Aria Pahlavan 1310 times, last 1 week ago
  4. bluebunnty 59 times, last 1 week ago
  5. iridic 3 times, last 1 month ago
31 more registered users
1 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.io.FileNotFoundException

    Resources/ui/win1.js

    at android.content.res.AssetManager.openAsset()
  2. Android Platform
    AssetManager.open
    1. android.content.res.AssetManager.openAsset(Native Method)[TiAssetHelper( 345)]
    2. android.content.res.AssetManager.open(AssetManager.java:313)[TiAssetHelper( 345)]
    3. android.content.res.AssetManager.open(AssetManager.java:287)[TiAssetHelper( 345)]
    3 frames
  3. org.appcelerator.kroll
    V8Runtime.handleMessage
    1. org.appcelerator.kroll.util.KrollAssetHelper.readAsset(KrollAssetHelper.java:77)[TiAssetHelper( 345)]
    2. org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method)[TiAssetHelper( 345)]
    3. org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:140)[TiAssetHelper( 345)]
    4. org.appcelerator.kroll.KrollRuntime.handleMessage(KrollRuntime.java:284)[TiAssetHelper( 345)]
    5. org.appcelerator.kroll.runtime.v8.V8Runtime.handleMessage(V8Runtime.java:166)[TiAssetHelper( 345)]
    5 frames
  4. Android Platform
    Looper.loop
    1. android.os.Handler.dispatchMessage(Handler.java:95)[TiAssetHelper( 345)]
    2. android.os.Looper.loop(Looper.java:123)[TiAssetHelper( 345)]
    2 frames
  5. org.appcelerator.kroll
    KrollRuntime$KrollRuntimeThread.run
    1. org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:108)
    1 frame