Not a fan of a double post, but here's a link to another thread: http://forum.ionicframework.com/t/android-filetransfer-returning-null/22528
Attempting to do an android FileTransfer, plugin is working on iOS, I can't seem to get this to go!
ADB lgocat output:
E/PluginManager(23753): Uncaught exception from plugin
E/PluginManager(23753): java.lang.IllegalStateException: Tried to perform an IO operation on the WebCore thread. Use CordovaInterface.getThreadPool() instead.
Not sure where to look next, anyone happen to be an expert? (or have any luck with the cordova-plugin-file-transfer recently?)
FileTransferError
body: null
code: null
exception: null
http_status: null
source: null
target: null
Trying a file transfer and coming back empty. Your system information:
OS: Mac OS X Yosemite
Node Version: v0.12.0
Cordova CLI: 5.0.0
Ionic CLI Version: 1.3.22
Xcode version: Xcode 6.3.1 Build version 6D1002
ios-sim version: 3.1.1
ios-deploy version: 1.4.0
Any chance someone can post what they get for:
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(FileTransfer);
}
I'm seeing something nonsensical! For reference, I'm using a standard ngCordova upload: http://ngcordova.com/docs/plugins/fileTransfer/
Running in Crosswalk, not sure that makes any difference.
I'm using latest release of cordova-plugin-file
and cordova-plugin-file-transfer
, both on iOS & Android.
After injecting $cordovaFileTransfer to my Controller or Service, I call it like that :
$cordovaFileTransfer.upload(myEndPoint,fileLocation, options).then(function(data){
$log.log("Success",data);
},function(err){
$log.warn(err);
}, function(progress) {
$log.log(progress);
});
I also use on ionic ready event as I've seen that it's better as sometimes, javascript events fired a bit before ionic components are ready.
ionic.Platform.ready(function() {
myReadyCode here
}, false);
Turns out this was that kit kat version bug that was happening for a while. i restricted my version of android to 21, and all my woes went away.
thank you @aorfever for your answer, it is exactly what i was doing, but ended up being something out side of the actual functions i was calling that was the issue!