cordova-android-chromeview icon indicating copy to clipboard operation
cordova-android-chromeview copied to clipboard

application crash on FileTransfer.download

Open albi90 opened this issue 11 years ago • 5 comments

Hi @thedracle

Im trying to use FileTransfer.download to retrieve a file from a url and to store it locally this works perfectly in cordova phonegap but when i try to do the same thing in the chromeview my application thinks for a abit (like its downloading) and then crashes with no errors passed to the console, i dont think its finishing the download as i have a console.log call in the callback once completed and this is not showing in the console.

Any ideas?

Thanks albi90

albi90 avatar Sep 01 '13 07:09 albi90

below is the log

09-01 21:05:32.709: I/dalvikvm(1052): threadid=3: reacting to signal 3 09-01 21:05:33.139: E/dalvikvm(1052): Unable to open stack trace file '/data/anr/traces.txt': Permission denied 09-01 21:05:33.192: I/dalvikvm(1052): threadid=3: reacting to signal 3 09-01 21:05:33.309: I/dalvikvm(1052): Wrote stack traces to '/data/anr/traces.txt' 09-01 21:05:33.649: I/dalvikvm(1052): threadid=3: reacting to signal 3 09-01 21:05:33.789: I/dalvikvm(1052): Wrote stack traces to '/data/anr/traces.txt' 09-01 21:05:34.099: I/dalvikvm(1052): Could not find method android.widget.FrameLayout.performAccessibilityAction, referenced from method us.costan.chrome.ChromeView.performAccessibilityAction 09-01 21:05:34.099: W/dalvikvm(1052): VFY: unable to resolve virtual method 1015: Landroid/widget/FrameLayout;.performAccessibilityAction (ILandroid/os/Bundle;)Z 09-01 21:05:34.111: D/dalvikvm(1052): VFY: replacing opcode 0x6f at 0x0013 09-01 21:05:34.180: I/dalvikvm(1052): threadid=3: reacting to signal 3 09-01 21:05:34.269: I/dalvikvm(1052): Wrote stack traces to '/data/anr/traces.txt' 09-01 21:05:34.349: I/LibraryLoader(1052): loading: webviewchromium 09-01 21:05:34.349: D/dalvikvm(1052): Trying to load lib /data/data/org.apache.cordova.example/lib/libwebviewchromium.so 0x41026d08 09-01 21:05:34.671: I/dalvikvm(1052): threadid=3: reacting to signal 3 09-01 21:05:34.749: I/dalvikvm(1052): Wrote stack traces to '/data/anr/traces.txt' 09-01 21:05:34.839: D/dalvikvm(1052): Added shared lib /data/data/org.apache.cordova.example/lib/libwebviewchromium.so 0x41026d08 09-01 21:05:34.909: I/LibraryLoader(1052): loaded: webviewchromium 09-01 21:05:34.969: I/chromium(1052): [INFO:library_loader_hooks.cc(72)] Chromium logging enabled: level = 0, default verbosity = 0 09-01 21:05:35.199: I/dalvikvm(1052): threadid=3: reacting to signal 3 09-01 21:05:35.279: I/dalvikvm(1052): Wrote stack traces to '/data/anr/traces.txt' 09-01 21:05:35.319: I/BrowserProcessMain(1052): Initializing chromium process, renderers=0 09-01 21:05:35.669: I/dalvikvm(1052): threadid=3: reacting to signal 3 09-01 21:05:35.830: I/dalvikvm(1052): Could not find method android.text.TextUtils.getLayoutDirectionFromLocale, referenced from method org.chromium.ui.LocalizationUtils.isSystemLayoutDirectionRtl 09-01 21:05:35.830: W/dalvikvm(1052): VFY: unable to resolve static method 645: Landroid/text/TextUtils;.getLayoutDirectionFromLocale (Ljava/util/Locale;)I 09-01 21:05:35.830: D/dalvikvm(1052): VFY: replacing opcode 0x71 at 0x000c 09-01 21:05:35.869: I/dalvikvm(1052): Wrote stack traces to '/data/anr/traces.txt' 09-01 21:05:36.079: I/dalvikvm(1052): Could not find method android.media.AudioManager.getProperty, referenced from method org.chromium.media.AudioManagerAndroid.getAudioLowLatencyOutputFrameSize 09-01 21:05:36.079: W/dalvikvm(1052): VFY: unable to resolve virtual method 382: Landroid/media/AudioManager;.getProperty (Ljava/lang/String;)Ljava/lang/String; 09-01 21:05:36.091: D/dalvikvm(1052): VFY: replacing opcode 0x6e at 0x0004 09-01 21:05:36.119: I/dalvikvm(1052): Could not find method android.media.AudioManager.getProperty, referenced from method org.chromium.media.AudioManagerAndroid.getNativeOutputSampleRate 09-01 21:05:36.119: W/dalvikvm(1052): VFY: unable to resolve virtual method 382: Landroid/media/AudioManager;.getProperty (Ljava/lang/String;)Ljava/lang/String; 09-01 21:05:36.119: D/dalvikvm(1052): VFY: replacing opcode 0x6e at 0x000d 09-01 21:05:36.219: I/dalvikvm(1052): threadid=3: reacting to signal 3 09-01 21:05:36.379: I/dalvikvm(1052): Wrote stack traces to '/data/anr/traces.txt' 09-01 21:05:36.529: W/chromium(1052): [WARNING:resource_bundle.cc(251)] locale_file_path.empty() 09-01 21:05:36.619: W/chromium(1052): [WARNING:proxy_service.cc(888)] PAC support disabled because there is no system implementation 09-01 21:05:36.750: I/dalvikvm(1052): threadid=3: reacting to signal 3 09-01 21:05:36.872: I/dalvikvm(1052): Wrote stack traces to '/data/anr/traces.txt' 09-01 21:05:37.190: I/dalvikvm(1052): threadid=3: reacting to signal 3 09-01 21:05:37.709: I/dalvikvm(1052): Wrote stack traces to '/data/anr/traces.txt' 09-01 21:05:37.792: I/dalvikvm(1052): threadid=3: reacting to signal 3 09-01 21:05:37.949: I/dalvikvm(1052): Wrote stack traces to '/data/anr/traces.txt' 09-01 21:05:37.959: D/dalvikvm(1052): GC_CONCURRENT freed 368K, 8% free 6554K/7047K, paused 27ms+55ms 09-01 21:05:38.289: D/libEGL(1052): loaded /system/lib/egl/libGLES_android.so 09-01 21:05:38.319: I/dalvikvm(1052): threadid=3: reacting to signal 3 09-01 21:05:38.409: D/libEGL(1052): loaded /system/lib/egl/libEGL_emulation.so 09-01 21:05:38.443: D/(1052): HostConnection::get() New Host Connection established 0x1aa0a8, tid 1052 09-01 21:05:38.499: D/libEGL(1052): loaded /system/lib/egl/libGLESv1_CM_emulation.so 09-01 21:05:38.549: D/libEGL(1052): loaded /system/lib/egl/libGLESv2_emulation.so 09-01 21:05:38.580: I/dalvikvm(1052): Wrote stack traces to '/data/anr/traces.txt' 09-01 21:05:38.749: I/dalvikvm(1052): threadid=3: reacting to signal 3 09-01 21:05:38.949: I/dalvikvm(1052): Wrote stack traces to '/data/anr/traces.txt' 09-01 21:05:39.209: I/CordovaLog(1052): Changing log level to DEBUG(3) 09-01 21:05:39.239: D/CordovaActivity(1052): CordovaActivity.onCreate() 09-01 21:05:39.301: I/dalvikvm(1052): threadid=3: reacting to signal 3 09-01 21:05:39.449: I/dalvikvm(1052): Wrote stack traces to '/data/anr/traces.txt' 09-01 21:05:39.559: I/dalvikvm(1052): Could not find method android.webkit.WebView$FindListener.onFindResultReceived, referenced from method us.costan.chrome.impl.ChromeAwContentsClientProxy.onFindResultReceived 09-01 21:05:39.569: W/dalvikvm(1052): VFY: unable to resolve interface method 934: Landroid/webkit/WebView$FindListener;.onFindResultReceived (IIZ)V 09-01 21:05:39.569: D/dalvikvm(1052): VFY: replacing opcode 0x72 at 0x0006 09-01 21:05:39.729: I/dalvikvm(1052): threadid=3: reacting to signal 3 09-01 21:05:39.739: I/dalvikvm(1052): Could not find method android.view.ViewGroup.postInvalidateOnAnimation, referenced from method org.chromium.android_webview.AwContents.postInvalidateOnAnimation 09-01 21:05:39.739: W/dalvikvm(1052): VFY: unable to resolve virtual method 838: Landroid/view/ViewGroup;.postInvalidateOnAnimation ()V 09-01 21:05:39.749: D/dalvikvm(1052): VFY: replacing opcode 0x6e at 0x0006 09-01 21:05:39.919: I/dalvikvm(1052): Wrote stack traces to '/data/anr/traces.txt' 09-01 21:05:40.079: E/chromium(1052): [ERROR:aw_browser_context.cc(204)] Not implemented reached in virtual quota::SpecialStoragePolicy* android_webview::AwBrowserContext::GetSpecialStoragePolicy() 09-01 21:05:40.079: E/chromium(1052): [ERROR:aw_browser_context.cc(204)] Not implemented reached in virtual quota::SpecialStoragePolicy* android_webview::AwBrowserContext::GetSpecialStoragePolicy() 09-01 21:05:40.120: E/chromium(1052): [ERROR:aw_browser_context.cc(204)] Not implemented reached in virtual quota::SpecialStoragePolicy* android_webview::AwBrowserContext::GetSpecialStoragePolicy() 09-01 21:05:40.200: E/chromium(1052): [ERROR:aw_browser_context.cc(204)] Not implemented reached in virtual quota::SpecialStoragePolicy* android_webview::AwBrowserContext::GetSpecialStoragePolicy() 09-01 21:05:40.210: E/chromium(1052): [ERROR:aw_browser_context.cc(204)] Not implemented reached in virtual quota::SpecialStoragePolicy* android_webview::AwBrowserContext::GetSpecialStoragePolicy() 09-01 21:05:40.260: E/chromium(1052): [ERROR:aw_browser_context.cc(204)] Not implemented reached in virtual quota::SpecialStoragePolicy* android_webview::AwBrowserContext::GetSpecialStoragePolicy() 09-01 21:05:40.350: I/dalvikvm(1052): threadid=3: reacting to signal 3 09-01 21:05:40.489: I/dalvikvm(1052): Wrote stack traces to '/data/anr/traces.txt' 09-01 21:05:40.649: W/org.chromium.content.browser.ContentViewCore(1052): Setting contentDescription to 'Web View' as no value was specified. 09-01 21:05:40.749: I/dalvikvm(1052): threadid=3: reacting to signal 3 09-01 21:05:40.839: I/dalvikvm(1052): Wrote stack traces to '/data/anr/traces.txt' 09-01 21:05:40.959: D/CordovaWebView(1052): CordovaWebView is running on device made by: unknown 09-01 21:05:41.080: D/dalvikvm(1052): GREF has increased to 201 09-01 21:05:41.119: D/JsMessageQueue(1052): Set native->JS mode to 2 09-01 21:05:41.139: D/CordovaActivity(1052): CordovaActivity.init() 09-01 21:05:41.239: D/CordovaWebView(1052): >>> loadUrl(file:///android_asset/www/index.html) 09-01 21:05:41.239: D/PluginManager(1052): init() 09-01 21:05:41.260: I/dalvikvm(1052): threadid=3: reacting to signal 3 09-01 21:05:41.429: I/dalvikvm(1052): Wrote stack traces to '/data/anr/traces.txt' 09-01 21:05:41.549: D/CordovaWebView(1052): >>> loadUrlNow() 09-01 21:05:41.650: W/chromium(1052): [WARNING:surface_texture_bridge.cc(38)] Running on unsupported device: rendering may not work 09-01 21:05:41.809: I/dalvikvm(1052): threadid=3: reacting to signal 3 09-01 21:05:42.120: I/dalvikvm(1052): Wrote stack traces to '/data/anr/traces.txt' 09-01 21:05:42.299: I/dalvikvm(1052): threadid=3: reacting to signal 3 09-01 21:05:42.579: I/dalvikvm(1052): Wrote stack traces to '/data/anr/traces.txt' 09-01 21:05:42.629: D/InputEventConsistencyVerifier(1052): TouchEvent: Source was not SOURCE_CLASS_POINTER. 09-01 21:05:42.629: D/InputEventConsistencyVerifier(1052): in android.view.ScaleGestureDetector@4103c4e0 09-01 21:05:42.629: D/InputEventConsistencyVerifier(1052): 0: sent at 3132203000000, MotionEvent { action=ACTION_CANCEL, id[0]=0, x[0]=0.0, y[0]=0.0, toolType[0]=TOOL_TYPE_UNKNOWN, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=3132203, downTime=3132203, deviceId=0, source=0x0 } 09-01 21:05:42.659: D/Config(1052): Unlimited access to network resources 09-01 21:05:42.659: I/CordovaLog(1052): Found start page location: index.html 09-01 21:05:42.709: I/CordovaLog(1052): Changing log level to DEBUG(3) 09-01 21:05:42.739: D/CordovaActivity(1052): Resuming the App 09-01 21:05:42.752: D/CordovaActivity(1052): CB-3064: The errorUrl is null 09-01 21:05:42.939: W/ChildProcessLauncher(1052): Tried to bind a non-existent connection to pid: 1052 09-01 21:05:42.979: D/SoftKeyboardDetect(1052): Ignore this event 09-01 21:05:43.219: W/EGL_emulation(1052): eglSurfaceAttrib not implemented 09-01 21:05:43.270: D/OpenGLRenderer(1052): Enabling debug mode 0 09-01 21:05:43.429: D/SoftKeyboardDetect(1052): Ignore this event 09-01 21:05:44.489: I/chromium(1052): [INFO:SkUtilsArm.cpp(177)] Device supports ARM NEON instructions! 09-01 21:05:44.960: D/InputEventConsistencyVerifier(1052): TouchEvent: Source was not SOURCE_CLASS_POINTER. 09-01 21:05:44.960: D/InputEventConsistencyVerifier(1052): in android.view.ScaleGestureDetector@4103c4e0 09-01 21:05:44.960: D/InputEventConsistencyVerifier(1052): 0: sent at 3134541000000, MotionEvent { action=ACTION_CANCEL, id[0]=0, x[0]=0.0, y[0]=0.0, toolType[0]=TOOL_TYPE_UNKNOWN, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=3134541, downTime=3134541, deviceId=0, source=0x0 } 09-01 21:05:44.960: D/InputEventConsistencyVerifier(1052): -- recent events -- 09-01 21:05:44.960: D/InputEventConsistencyVerifier(1052): 1: sent at 3132203000000, MotionEvent { action=ACTION_CANCEL, id[0]=0, x[0]=0.0, y[0]=0.0, toolType[0]=TOOL_TYPE_UNKNOWN, buttonState=0, metaState=0, flags=0x80000000, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=3132203, downTime=3132203, deviceId=0, source=0x0 } 09-01 21:05:45.079: D/CordovaActivity(1052): onMessage(onPageStarted,file:///android_asset/www/index.html) 09-01 21:05:53.799: E/AndroidProtocolHandler(1052): Unable to open asset URL: file:///android_asset/www/cordova_plugins.json 09-01 21:05:54.761: E/AndroidProtocolHandler(1052): Unable to open asset URL: file:///android_asset/www/cordova_plugins.js 09-01 21:05:54.899: D/Cordova(1052): onPageFinished(file:///android_asset/www/index.html) 09-01 21:05:54.899: D/CordovaActivity(1052): onMessage(onPageFinished,file:///android_asset/www/index.html) 09-01 21:05:56.629: D/PluginManager(1052): running exec normally 09-01 21:05:56.871: D/PluginManager(1052): running exec normally 09-01 21:05:56.930: D/CordovaNetworkManager(1052): Connection Type: 3g 09-01 21:05:56.959: D/CordovaActivity(1052): onMessage(networkconnection,3g) 09-01 21:05:56.979: D/CordovaActivity(1052): onMessage(spinner,stop) 09-01 21:05:57.089: D/CordovaNetworkManager(1052): Connection Type: 3g 09-01 21:05:57.359: D/dalvikvm(1052): GC_FOR_ALLOC freed 162K, 6% free 6677K/7047K, paused 195ms 09-01 21:05:57.450: I/dalvikvm-heap(1052): Grow heap (frag case) to 7.963MB for 1443856-byte allocation 09-01 21:05:57.719: D/dalvikvm(1052): GC_CONCURRENT freed 5K, 6% free 8082K/8519K, paused 13ms+13ms 09-01 21:05:57.719: D/PluginManager(1052): running exec normally 09-01 21:05:57.859: W/AwContents(1052): nativeOnDraw failed; clearing to background color. 09-01 21:05:57.904: D/CordovaActivity(1052): onMessage(spinner,stop) 09-01 21:06:36.949: D/CordovaLog(1052): file:///android_asset/www/index.html: Line 17 : starting download 09-01 21:06:36.949: I/chromium(1052): [INFO:CONSOLE(17)] "starting download", source: file:///android_asset/www/index.html (17) 09-01 21:06:37.039: D/PluginManager(1052): running exec normally 09-01 21:06:37.092: D/FileTransfer(1052): download http://squareboxdesign.net/screen/files/7a4e45d4a8d5d5e49fcccf0eece4f48d.jpg to file:///data/data/org.apache.cordova.example/7a4e45d4a8d5d5e49fcccf0eece4f48d.jpg 09-01 21:06:37.309: W/dalvikvm(1052): JNI WARNING: JNI method called with exception pending 09-01 21:06:37.309: W/dalvikvm(1052): in Landroid/webkit/CookieManager;.nativeGetCookie:(Ljava/lang/String;Z)Ljava/lang/String; (GetStringUTFChars) 09-01 21:06:37.309: W/dalvikvm(1052): Pending exception is: 09-01 21:06:37.342: I/dalvikvm(1052): java.lang.IllegalStateException: Call CookieSyncManager::createInstance() or create a webview before using this class 09-01 21:06:37.342: I/dalvikvm(1052): at android.webkit.JniUtil.checkInitialized(JniUtil.java:45) 09-01 21:06:37.342: I/dalvikvm(1052): at android.webkit.JniUtil.getDatabaseDirectory(JniUtil.java:66) 09-01 21:06:37.363: I/dalvikvm(1052): at android.webkit.CookieManager.nativeGetCookie(Native Method) 09-01 21:06:37.363: I/dalvikvm(1052): at android.webkit.CookieManager.getCookie(CookieManager.java:496) 09-01 21:06:37.400: I/dalvikvm(1052): at android.webkit.CookieManager.getCookie(CookieManager.java:460) 09-01 21:06:37.400: I/dalvikvm(1052): at org.apache.cordova.FileTransfer$4.run(FileTransfer.java:746) 09-01 21:06:37.400: I/dalvikvm(1052): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076) 09-01 21:06:37.400: I/dalvikvm(1052): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569) 09-01 21:06:37.400: I/dalvikvm(1052): at java.lang.Thread.run(Thread.java:856) 09-01 21:06:37.400: I/dalvikvm(1052): "pool-1-thread-1" prio=5 tid=15 NATIVE 09-01 21:06:37.400: I/dalvikvm(1052): | group="main" sCount=0 dsCount=0 obj=0x41049128 self=0x2ea588 09-01 21:06:37.400: I/dalvikvm(1052): | sysTid=1090 nice=0 sched=0/0 cgrp=default handle=3569160 09-01 21:06:37.400: I/dalvikvm(1052): | schedstat=( 41983119 203923793 18 ) utm=4 stm=0 core=0 09-01 21:06:37.400: I/dalvikvm(1052): at android.webkit.CookieManager.nativeGetCookie(Native Method) 09-01 21:06:37.400: I/dalvikvm(1052): at android.webkit.CookieManager.getCookie(CookieManager.java:496) 09-01 21:06:37.400: I/dalvikvm(1052): at android.webkit.CookieManager.getCookie(CookieManager.java:460) 09-01 21:06:37.400: I/dalvikvm(1052): at org.apache.cordova.FileTransfer$4.run(FileTransfer.java:746) 09-01 21:06:37.400: I/dalvikvm(1052): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076) 09-01 21:06:37.400: I/dalvikvm(1052): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569) 09-01 21:06:37.400: I/dalvikvm(1052): at java.lang.Thread.run(Thread.java:856) 09-01 21:06:37.400: E/dalvikvm(1052): VM aborting 09-01 21:06:37.439: A/libc(1052): Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1)

albi90 avatar Sep 01 '13 11:09 albi90

i have solved the crash, we are trying to use the wrong cookie manager just add import us.costan.chrome.ChromeCookieManager; and change all instances of CookieManager to ChromeCookieManager, im still having an issue with the filetransfer not calling my callback functions, any ideas?

Thanks

albi90 avatar Sep 02 '13 09:09 albi90

Can you make a pull request with the above changes?

serviewcare avatar Sep 04 '13 16:09 serviewcare

done!

albi90 avatar Sep 05 '13 08:09 albi90

@serviewcare im still having issues with the oncomplete callback not firing i can see cordova adding the call back to the stack and the file completes but my JS callback never fires

albi90 avatar Sep 05 '13 23:09 albi90