You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2020/06/05 16:51:57 UTC

[GitHub] [cordova-plugin-file] caleb87 opened a new issue #396: Android works, but iOS 13.5.1 returns error code 1

caleb87 opened a new issue #396:
URL: https://github.com/apache/cordova-plugin-file/issues/396


   # Bug Report
   Reading a file works on Android. It fails on iOS 13.5.1 with error code 1. 
   
   The code I'm using:
   ```
   function getLocalFile(url, cb) {
   	console.log("ATTEMPTING TO LOAD: ",cordova.file.applicationDirectory + "www/"+url);
   	window.resolveLocalFileSystemURL(cordova.file.applicationDirectory + "www/"+url, function(fileEntry) {
   		console.log(fileEntry);
   		fileEntry.file(function(file) {
   			var s = "";
   			s += "<b>name:</b> " + file.name + "<br/>";
   			s += "<b>localURL:</b> " + file.localURL + "<br/>";
   			s += "<b>type:</b> " + file.type + "<br/>";
   			s += "<b>lastModifiedDate:</b> " + (new Date(file.lastModifiedDate)) + "<br/>";
   			s += "<b>size:</b> " + file.size + "<br/>";
   			console.log(s);
   			var reader = new FileReader();
   			reader.onloadend = function() {
   				var fileContents = this.result;
   				console.log("Successful file read: "+fileContents);
   				if(cb) cb(fileContents);
   			};
   			reader.readAsText(file);
   		});
   	}, function(err) {
   		console.log("File failed ", err);
   		console.dir(err);
   	});
   }
   ```
   
   Also works on Android, but fails on iOS:
   ```
   function getLocalFile(url, cb) {
   	
   	resolveLocalFileSystemURL(cordova.file.applicationDirectory, function(entry) {
   		console.log("Success! Got a app dir");
   		console.log(entry);
   		var nativeURL = entry.nativeURL;
   		console.log("NATIVE URL IS ",nativeURL);
   
   		console.log("ATTEMPTING TO LOAD: ",nativeURL + "www/"+url);
   		window.resolveLocalFileSystemURL(nativeURL + "www/"+url, function(fileEntry) {
   			console.log("FILE ENTRY INFORMATION IS: ");
   			console.log(fileEntry);
   			fileEntry.file(function(file) {
   				var s = "";
   				s += "<b>name:</b> " + file.name + "<br/>";
   				s += "<b>localURL:</b> " + file.localURL + "<br/>";
   				s += "<b>type:</b> " + file.type + "<br/>";
   				s += "<b>lastModifiedDate:</b> " + (new Date(file.lastModifiedDate)) + "<br/>";
   				s += "<b>size:</b> " + file.size + "<br/>";
   				console.log(s);
   				var reader = new FileReader();
   				reader.onloadend = function() {
   					var fileContents = this.result;
   					console.log("Successful file read: "+fileContents);
   					if(cb) cb(fileContents);
   				};
   				reader.readAsText(file);
   			});
   		}, function(err) {
   			console.log("File failed ################# ", err);
   			console.dir(err);
   		});
   		
   		
   	}, function(error) {
   		console.error("Something bad happened, and we didn't get a app dir");
   	});
   	
   	
   }
   ```
   
   ### What is expected to happen?
   Both platforms return same result.
   
   
   ### What does actually happen?
   Returns error code 1. 
   
   
   
   ### Environment, Platform, Device
   <!-- In what environment, on what platform or on which device are you experiencing the issue? -->
   Physical iPhone X, iOS 13.5.1
   
   
   
   ### Version information
   
   cordova-plugin 6.0.2
   Phonegap 9
   iOS 13.5.1
   Xcode for building
   
   
   
   
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [x] I searched for existing GitHub issues
   - [x] I updated all Cordova tooling to most recent version
   - [x] I included all the necessary information above
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-file] shengjiong removed a comment on issue #396: Android works, but iOS 13.5.1 returns error code 1

Posted by GitBox <gi...@apache.org>.
shengjiong removed a comment on issue #396:
URL: https://github.com/apache/cordova-plugin-file/issues/396#issuecomment-662811861


   hello, boy .
   I meet this bug too,
   Did you figure out this problem , my friends
   help me 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-file] JaosnHsieh commented on issue #396: Android works, but iOS 13.5.1 returns error code 1

Posted by GitBox <gi...@apache.org>.
JaosnHsieh commented on issue #396:
URL: https://github.com/apache/cordova-plugin-file/issues/396#issuecomment-1006273540


   Is this specific to iOS 13? I can write file successfully to iOS 12 by the [code here](https://github.com/apache/cordova-plugin-file/issues/392#issuecomment-1006272967)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-file] bhumboldt commented on issue #396: Android works, but iOS 13.5.1 returns error code 1

Posted by GitBox <gi...@apache.org>.
bhumboldt commented on issue #396:
URL: https://github.com/apache/cordova-plugin-file/issues/396#issuecomment-698328212


   Hey @caleb87 did you ever get this resolved? Running into the same thing on iPadOS 13.7


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-file] shengjiong commented on issue #396: Android works, but iOS 13.5.1 returns error code 1

Posted by GitBox <gi...@apache.org>.
shengjiong commented on issue #396:
URL: https://github.com/apache/cordova-plugin-file/issues/396#issuecomment-662811861


   hello, boy .
   I meet this bug too,
   Did you figure out this problem , my friends
   help me 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-file] wannadream commented on issue #396: Android works, but iOS 13.5.1 returns error code 1

Posted by GitBox <gi...@apache.org>.
wannadream commented on issue #396:
URL: https://github.com/apache/cordova-plugin-file/issues/396#issuecomment-725500663


   @caleb87  I ran into the same issue, do you have a solution?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-file] mirko77 commented on issue #396: Android works, but iOS 13.5.1 returns error code 1

Posted by GitBox <gi...@apache.org>.
mirko77 commented on issue #396:
URL: https://github.com/apache/cordova-plugin-file/issues/396#issuecomment-809246272


   same issue


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-file] caleb87 closed issue #396: Android works, but iOS 13.5.1 returns error code 1

Posted by GitBox <gi...@apache.org>.
caleb87 closed issue #396:
URL: https://github.com/apache/cordova-plugin-file/issues/396


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-file] bhumboldt commented on issue #396: Android works, but iOS 13.5.1 returns error code 1

Posted by GitBox <gi...@apache.org>.
bhumboldt commented on issue #396:
URL: https://github.com/apache/cordova-plugin-file/issues/396#issuecomment-698328212


   Hey @caleb87 did you ever get this resolved? Running into the same thing on iPadOS 13.7


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-file] shengjiong commented on issue #396: Android works, but iOS 13.5.1 returns error code 1

Posted by GitBox <gi...@apache.org>.
shengjiong commented on issue #396:
URL: https://github.com/apache/cordova-plugin-file/issues/396#issuecomment-662811938


   hello, boy .
   I meet this bug too,
   Did you figure out this problem , my friends
   help me
   @caleb87 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org