java.io.FileNotFoundException: /storage/emulated/0/Android/data/com.apptest.tempdirperm/cache/_tmp/GettingStartedTitanium_Linux.pdf: open failed: ENOENT (No such file or directory)

Appcelerator JIRA | Eric Cheung | 9 months ago
  1. 0

    I played around with the latest 5.2.0 SDK and Nexus 6P... for the most part everything seems to work except for one case with runtime permission. if I use Ti.Filesystem.tempDirectory as my storage and created the permission checks, this still fails on first try even if you accept the Permission. Log: {{[INFO] : Permission granted? true [ERROR] : TiFileProxy: (KrollRuntimeThread) [66154,66154] IOException encountered [ERROR] : TiFileProxy: java.io.FileNotFoundException: /storage/emulated/0/Android/data/com.apptest.tempdirperm/cache/_tmp/GettingStartedTitanium_Linux.pdf: open failed: ENOENT (No such file or directory) [ERROR] : TiFileProxy: at libcore.io.IoBridge.open(IoBridge.java:452) [ERROR] : TiFileProxy: at java.io.FileOutputStream.<init>(FileOutputStream.java:87) [ERROR] : TiFileProxy: at org.appcelerator.titanium.io.TiFile.getOutputStream(TiFile.java:273) [ERROR] : TiFileProxy: at org.appcelerator.titanium.io.TiFile.open(TiFile.java:336) [ERROR] : TiFileProxy: at org.appcelerator.titanium.io.TiFile.write(TiFile.java:382) [ERROR] : TiFileProxy: at org.appcelerator.titanium.TiFileProxy.write(TiFileProxy.java:290) [ERROR] : TiFileProxy: at org.appcelerator.kroll.runtime.v8.V8Object.nativeCallProperty(Native Method) [ERROR] : TiFileProxy: at org.appcelerator.kroll.runtime.v8.V8Object.callProperty(V8Object.java:73) [ERROR] : TiFileProxy: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1155) [ERROR] : TiFileProxy: at android.os.Handler.dispatchMessage(Handler.java:98) [ERROR] : TiFileProxy: at android.os.Looper.loop(Looper.java:148) [ERROR] : TiFileProxy: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:118) [ERROR] : TiFileProxy: Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory) [ERROR] : TiFileProxy: at libcore.io.Posix.open(Native Method) [ERROR] : TiFileProxy: at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186) [ERROR] : TiFileProxy: at libcore.io.IoBridge.open(IoBridge.java:438) [ERROR] : TiFileProxy: ... 11 more [INFO] : ALERT: (KrollRuntimeThread) [41,66195] File exist? false}} Steps to recreate: * Create new Mobile App Project and paste in code to index.js * Compile and run, make sure it is a clean install on device * Click the "Hello, World" to trigger the download and permission. * Accept the permission on popup. * Accessing the file in temporary directory fails. (alert will say file does not exist) * Close the app * Check permission in settings > app permission (storage should be enabled) * Restart the app * Click "Hello, World" again to trigger download. * Alert will now say file exists. Workaround: If I switch the Ti.Filesystem.tempDirectory to Ti.Filesystem.applicationDataDirectory, I do not run into the issue of having to restart the app to open the file. But I have to make sure those files are deleted after use. It would be best to use temporary directory so that the files are automatically removed after app is closed.

    Appcelerator JIRA | 9 months ago | Eric Cheung
    java.io.FileNotFoundException: /storage/emulated/0/Android/data/com.apptest.tempdirperm/cache/_tmp/GettingStartedTitanium_Linux.pdf: open failed: ENOENT (No such file or directory)
  2. 0

    h3. Steps to Reproduce I played around with the latest 5.2.0 SDK and Nexus 6P... for the most part everything seems to work except for one case with runtime permission. if I use Ti.Filesystem.tempDirectory as my storage and created the permission checks, this still fails on first try even if you accept the Permission. Log: [INFO] : Permission granted? true [ERROR] : TiFileProxy: (KrollRuntimeThread) [66154,66154] IOException encountered [ERROR] : TiFileProxy: java.io.FileNotFoundException: /storage/emulated/0/Android/data/com.apptest.tempdirperm/cache/_tmp/GettingStartedTitanium_Linux.pdf: open failed: ENOENT (No such file or directory) [ERROR] : TiFileProxy: at libcore.io.IoBridge.open(IoBridge.java:452) [ERROR] : TiFileProxy: at java.io.FileOutputStream.<init>(FileOutputStream.java:87) [ERROR] : TiFileProxy: at org.appcelerator.titanium.io.TiFile.getOutputStream(TiFile.java:273) [ERROR] : TiFileProxy: at org.appcelerator.titanium.io.TiFile.open(TiFile.java:336) [ERROR] : TiFileProxy: at org.appcelerator.titanium.io.TiFile.write(TiFile.java:382) [ERROR] : TiFileProxy: at org.appcelerator.titanium.TiFileProxy.write(TiFileProxy.java:290) [ERROR] : TiFileProxy: at org.appcelerator.kroll.runtime.v8.V8Object.nativeCallProperty(Native Method) [ERROR] : TiFileProxy: at org.appcelerator.kroll.runtime.v8.V8Object.callProperty(V8Object.java:73) [ERROR] : TiFileProxy: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1155) [ERROR] : TiFileProxy: at android.os.Handler.dispatchMessage(Handler.java:98) [ERROR] : TiFileProxy: at android.os.Looper.loop(Looper.java:148) [ERROR] : TiFileProxy: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:118) [ERROR] : TiFileProxy: Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory) [ERROR] : TiFileProxy: at libcore.io.Posix.open(Native Method) [ERROR] : TiFileProxy: at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186) [ERROR] : TiFileProxy: at libcore.io.IoBridge.open(IoBridge.java:438) [ERROR] : TiFileProxy: ... 11 more [INFO] : ALERT: (KrollRuntimeThread) [41,66195] File exist? false}} Steps to recreate: Create new Mobile App Project and paste in code to index.js Compile and run, make sure it is a clean install on device Click the 'Hello, World' to trigger the download and permission. Accept the permission on popup. Accessing the file in temporary directory fails. (alert will say file does not exist) Close the app Check permission in settings > app permission (storage should be enabled) Restart the app Click 'Hello, World' again to trigger download. Alert will now say file exists. Workaround: If I switch the Ti.Filesystem.tempDirectory to Ti.Filesystem.applicationDataDirectory, I do not run into the issue of having to restart the app to open the file. But I have to make sure those files are deleted after use. It would be best to use temporary directory so that the files are automatically removed after app is closed. h3. Actual Result File does not exist in tempDirectory when permission is enabled on RunTime. h3. Expected Result File should exist in tempDirectory.

    Appcelerator JIRA | 9 months ago | Eric Cheung
    java.io.FileNotFoundException: /storage/emulated/0/Android/data/com.apptest.tempdirperm/cache/_tmp/GettingStartedTitanium_Linux.pdf: open failed: ENOENT (No such file or directory)
  3. 0

    I played around with the latest 5.2.0 SDK and Nexus 6P... for the most part everything seems to work except for one case with runtime permission. if I use Ti.Filesystem.tempDirectory as my storage and created the permission checks, this still fails on first try even if you accept the Permission. Log: {{[INFO] : Permission granted? true [ERROR] : TiFileProxy: (KrollRuntimeThread) [66154,66154] IOException encountered [ERROR] : TiFileProxy: java.io.FileNotFoundException: /storage/emulated/0/Android/data/com.apptest.tempdirperm/cache/_tmp/GettingStartedTitanium_Linux.pdf: open failed: ENOENT (No such file or directory) [ERROR] : TiFileProxy: at libcore.io.IoBridge.open(IoBridge.java:452) [ERROR] : TiFileProxy: at java.io.FileOutputStream.<init>(FileOutputStream.java:87) [ERROR] : TiFileProxy: at org.appcelerator.titanium.io.TiFile.getOutputStream(TiFile.java:273) [ERROR] : TiFileProxy: at org.appcelerator.titanium.io.TiFile.open(TiFile.java:336) [ERROR] : TiFileProxy: at org.appcelerator.titanium.io.TiFile.write(TiFile.java:382) [ERROR] : TiFileProxy: at org.appcelerator.titanium.TiFileProxy.write(TiFileProxy.java:290) [ERROR] : TiFileProxy: at org.appcelerator.kroll.runtime.v8.V8Object.nativeCallProperty(Native Method) [ERROR] : TiFileProxy: at org.appcelerator.kroll.runtime.v8.V8Object.callProperty(V8Object.java:73) [ERROR] : TiFileProxy: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1155) [ERROR] : TiFileProxy: at android.os.Handler.dispatchMessage(Handler.java:98) [ERROR] : TiFileProxy: at android.os.Looper.loop(Looper.java:148) [ERROR] : TiFileProxy: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:118) [ERROR] : TiFileProxy: Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory) [ERROR] : TiFileProxy: at libcore.io.Posix.open(Native Method) [ERROR] : TiFileProxy: at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186) [ERROR] : TiFileProxy: at libcore.io.IoBridge.open(IoBridge.java:438) [ERROR] : TiFileProxy: ... 11 more [INFO] : ALERT: (KrollRuntimeThread) [41,66195] File exist? false}} Steps to recreate: * Create new Mobile App Project and paste in code to index.js * Compile and run, make sure it is a clean install on device * Click the "Hello, World" to trigger the download and permission. * Accept the permission on popup. * Accessing the file in temporary directory fails. (alert will say file does not exist) * Close the app * Check permission in settings > app permission (storage should be enabled) * Restart the app * Click "Hello, World" again to trigger download. * Alert will now say file exists. Workaround: If I switch the Ti.Filesystem.tempDirectory to Ti.Filesystem.applicationDataDirectory, I do not run into the issue of having to restart the app to open the file. But I have to make sure those files are deleted after use. It would be best to use temporary directory so that the files are automatically removed after app is closed.

    Appcelerator JIRA | 9 months ago | Eric Cheung
    java.io.FileNotFoundException: /storage/emulated/0/Android/data/com.apptest.tempdirperm/cache/_tmp/GettingStartedTitanium_Linux.pdf: open failed: ENOENT (No such file or directory)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    h3. Steps to Reproduce I played around with the latest 5.2.0 SDK and Nexus 6P... for the most part everything seems to work except for one case with runtime permission. if I use Ti.Filesystem.tempDirectory as my storage and created the permission checks, this still fails on first try even if you accept the Permission. Log: [INFO] : Permission granted? true [ERROR] : TiFileProxy: (KrollRuntimeThread) [66154,66154] IOException encountered [ERROR] : TiFileProxy: java.io.FileNotFoundException: /storage/emulated/0/Android/data/com.apptest.tempdirperm/cache/_tmp/GettingStartedTitanium_Linux.pdf: open failed: ENOENT (No such file or directory) [ERROR] : TiFileProxy: at libcore.io.IoBridge.open(IoBridge.java:452) [ERROR] : TiFileProxy: at java.io.FileOutputStream.<init>(FileOutputStream.java:87) [ERROR] : TiFileProxy: at org.appcelerator.titanium.io.TiFile.getOutputStream(TiFile.java:273) [ERROR] : TiFileProxy: at org.appcelerator.titanium.io.TiFile.open(TiFile.java:336) [ERROR] : TiFileProxy: at org.appcelerator.titanium.io.TiFile.write(TiFile.java:382) [ERROR] : TiFileProxy: at org.appcelerator.titanium.TiFileProxy.write(TiFileProxy.java:290) [ERROR] : TiFileProxy: at org.appcelerator.kroll.runtime.v8.V8Object.nativeCallProperty(Native Method) [ERROR] : TiFileProxy: at org.appcelerator.kroll.runtime.v8.V8Object.callProperty(V8Object.java:73) [ERROR] : TiFileProxy: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1155) [ERROR] : TiFileProxy: at android.os.Handler.dispatchMessage(Handler.java:98) [ERROR] : TiFileProxy: at android.os.Looper.loop(Looper.java:148) [ERROR] : TiFileProxy: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:118) [ERROR] : TiFileProxy: Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory) [ERROR] : TiFileProxy: at libcore.io.Posix.open(Native Method) [ERROR] : TiFileProxy: at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186) [ERROR] : TiFileProxy: at libcore.io.IoBridge.open(IoBridge.java:438) [ERROR] : TiFileProxy: ... 11 more [INFO] : ALERT: (KrollRuntimeThread) [41,66195] File exist? false}} Steps to recreate: Create new Mobile App Project and paste in code to index.js Compile and run, make sure it is a clean install on device Click the 'Hello, World' to trigger the download and permission. Accept the permission on popup. Accessing the file in temporary directory fails. (alert will say file does not exist) Close the app Check permission in settings > app permission (storage should be enabled) Restart the app Click 'Hello, World' again to trigger download. Alert will now say file exists. Workaround: If I switch the Ti.Filesystem.tempDirectory to Ti.Filesystem.applicationDataDirectory, I do not run into the issue of having to restart the app to open the file. But I have to make sure those files are deleted after use. It would be best to use temporary directory so that the files are automatically removed after app is closed. h3. Actual Result File does not exist in tempDirectory when permission is enabled on RunTime. h3. Expected Result File should exist in tempDirectory.

    Appcelerator JIRA | 9 months ago | Eric Cheung
    java.io.FileNotFoundException: /storage/emulated/0/Android/data/com.apptest.tempdirperm/cache/_tmp/GettingStartedTitanium_Linux.pdf: open failed: ENOENT (No such file or directory)
  6. 0

    h6.Issue Description While trying to write the attachment content in the file and the directory used is temp_directory. As per the use case we have to save the content passed from the cloud server to the file and file is opened by using the intents. This approach is working fine for the os version upto Android 5.0 (lollipop) but on the Android 6.0 (Marshmallow) it’s failing. h6.Steps to reproduce 1) Get sample attach to run on Android 5 device 2) Monitor and watch logs. App works fine 3) Get sample attach to run on Android 6 device 4) Monitor and watch logs. App won't load file as expected. h6.Stack Trace {code} -- Start application log ----------------------------------------------------- [INFO] : TiApplication: (main) [0,0] checkpoint, app created. [INFO] : TiApplication: (main) [58,58] Titanium 5.1.2 (2015/12/16 19:00 ca822b2) [INFO] : DatabaseHelper: No value in database for platform key: 'unique_machine_id' returning supplied default '' [INFO] : DatabaseHelper: No value in database for platform key: 'hardware_machine_id' returning supplied default '' [WARN] : art: Suspending all threads took: 5.501ms [INFO] : art: Background sticky concurrent mark sweep GC freed 512(22KB) AllocSpace objects, 0(0B) LOS objects, 1% free, 2MB/2MB, paused 6.183ms total 22.877ms [INFO] : TiApplication: (main) [263,321] Titanium Javascript runtime: v8 [INFO] : TiRootActivity: (main) [0,0] checkpoint, on root activity create, savedInstanceState: null [WARN] : V8Object: (KrollRuntimeThread) [249,249] Runtime disposed, cannot set property 'userAgent' [DEBUG] : APSAnalyticsModel: Creating Database appcAnalytics.db [WARN] : TiTempFileHelper: (main) [354,603] The external temp directory doesn't exist, skipping cleanup [DEBUG] : Module: Loading module: alloy -> Resources/alloy.js [DEBUG] : Module: Loading module: alloy/underscore -> Resources/alloy/underscore.js [DEBUG] : Module: Loading module: alloy/backbone -> Resources/alloy/backbone.js [DEBUG] : Module: Loading module: alloy/constants -> Resources/alloy/constants.js [DEBUG] : Module: Loading module: alloy/CFG -> Resources/alloy/CFG.js [DEBUG] : Module: Loading module: alloy/controllers/index -> Resources/alloy/controllers/index.js [DEBUG] : Module: Loading module: alloy/controllers/BaseController -> Resources/alloy/controllers/BaseController.js [INFO] : TiRootActivity: (main) [0,0] checkpoint, on root activity resume. activity = com.example.Docx_pocActivity@b56e552 [DEBUG] : OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true [DEBUG] : D/ : HostConnection::get() New Host Connection established 0xec8fdc10, tid 10299 [DEBUG] : Window: Checkpoint: postWindowCreated() [DEBUG] : libEGL: loaded /system/lib/egl/libEGL_emulation.so [DEBUG] : libEGL: loaded /system/lib/egl/libGLESv1_CM_emulation.so [DEBUG] : libEGL: loaded /system/lib/egl/libGLESv2_emulation.so [DEBUG] : D/ : HostConnection::get() New Host Connection established 0xed661cf0, tid 10318 [INFO] : OpenGLRenderer: Initialized EGL, version 1.4 [WARN] : EGL_emulation: eglSurfaceAttrib not implemented [WARN] : OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xf3d3d160, error=EGL_SUCCESS [TRACE] : updating tiapp metadata with Appcelerator Platform... [TRACE] : Uploaded tiapp metadata with Appcelerator Platform! [ERROR] : TiFileProxy: (KrollRuntimeThread) [11875,11875] IOException encountered [ERROR] : TiFileProxy: java.io.FileNotFoundException: /storage/emulated/0/Android/data/com.example/cache/_tmp/sample.doc: open failed: ENOENT (No such file or directory) [ERROR] : TiFileProxy: at libcore.io.IoBridge.open(IoBridge.java:452) [ERROR] : TiFileProxy: at java.io.FileOutputStream.<init>(FileOutputStream.java:87) [ERROR] : TiFileProxy: at org.appcelerator.titanium.io.TiFile.getOutputStream(TiFile.java:273) [ERROR] : TiFileProxy: at org.appcelerator.titanium.io.TiFile.open(TiFile.java:336) [ERROR] : TiFileProxy: at org.appcelerator.titanium.io.TiFile.write(TiFile.java:382) [ERROR] : TiFileProxy: at org.appcelerator.titanium.TiFileProxy.write(TiFileProxy.java:284) [ERROR] : TiFileProxy: at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) [ERROR] : TiFileProxy: at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62) [ERROR] : TiFileProxy: at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:908) [ERROR] : TiFileProxy: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1131) [ERROR] : TiFileProxy: at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:352) [ERROR] : TiFileProxy: at android.os.Handler.dispatchMessage(Handler.java:98) [ERROR] : TiFileProxy: at android.os.Looper.loop(Looper.java:148) [ERROR] : TiFileProxy: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) [ERROR] : TiFileProxy: Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory) [ERROR] : TiFileProxy: at libcore.io.Posix.open(Native Method) [ERROR] : TiFileProxy: at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186) [ERROR] : TiFileProxy: at libcore.io.IoBridge.open(IoBridge.java:438) [ERROR] : TiFileProxy: ... 13 more [ERROR] : Path/type is empty [INFO] : APSAnalyticsService: Analytics Service Started [INFO] : APSAnalyticsService: Stopping Analytics Service {code}

    Appcelerator JIRA | 11 months ago | Eduardo Gomez
    java.io.FileNotFoundException: /storage/emulated/0/Android/data/com.example/cache/_tmp/sample.doc: open failed: ENOENT (No such file or directory)
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. android.system.ErrnoException

    open failed: ENOENT (No such file or directory)

    at libcore.io.Posix.open()
  2. Android
    IoBridge.open
    1. libcore.io.Posix.open(Native Method)
    2. libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
    3. libcore.io.IoBridge.open(IoBridge.java:438)
    3 frames
  3. Java RT
    FileOutputStream.<init>
    1. java.io.FileOutputStream.<init>(FileOutputStream.java:87)
    1 frame
  4. org.appcelerator.titanium
    TiFileProxy.write
    1. org.appcelerator.titanium.io.TiFile.getOutputStream(TiFile.java:273)
    2. org.appcelerator.titanium.io.TiFile.open(TiFile.java:336)
    3. org.appcelerator.titanium.io.TiFile.write(TiFile.java:382)
    4. org.appcelerator.titanium.TiFileProxy.write(TiFileProxy.java:290)
    4 frames
  5. org.appcelerator.kroll
    KrollProxy.handleMessage
    1. org.appcelerator.kroll.runtime.v8.V8Object.nativeCallProperty(Native Method)
    2. org.appcelerator.kroll.runtime.v8.V8Object.callProperty(V8Object.java:73)
    3. org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1155)
    3 frames
  6. Android Platform
    Looper.loop
    1. android.os.Handler.dispatchMessage(Handler.java:98)
    2. android.os.Looper.loop(Looper.java:148)
    2 frames
  7. org.appcelerator.kroll
    KrollRuntime$KrollRuntimeThread.run
    1. org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:118)
    1 frame