trigger.io Error reading file - trigger.io

I use the forge.file.saveURL to save a JSON object to the local file system, then I use forge.file.String to read the contents and display them on the device.
This works just fine on IOS and Android but it seem on Android after the device has closed the app or force closed it after being open for a while when I reopen the app and try and access the file I get the error message in the console
Native call file.string with task.params:
{"uri":"file:///storage/sdcard0/Android/data/com.phonegap.conbop/files/Download/594f9cdc-a791-40ef-a40b-75d16948a9ca"}
[DEBUG] Returned: {"content":{"message":"Error reading
file","type":"UNEXPECTED_FAILURE","subtype":null},"callid":"508FE1AD-EB74-4377-8FDA-AA7318457B5C","status":"error"}
I have tested the IOS and this does not seem to happen there, its almost like the file is getting corrupt or something but what is strange is a also use the file.saveURL to save images etc and those work just fine so I'm not sure why this one is having issues.

Related

Ionic 2 - Native File issue with JSON.parse on iOS

I'm having a problem when deploying my Ionic2 app on iOS real device. Testing it in web and Android real device works fine but when running my app on a iPhone I have a problem when parsing data retrieved from reading a local file (using #ionic-native/file).
After checking that the file exists, I read it like this:
this.file.readAsText(this.file.cacheDirectory + 'epg/', fileName)
.then( (data) => {
console.log('read file - then 1');
console.log(data);
this.channels = JSON.parse(data);
console.log('read file - then 2');
Debugging it in Xcode console I see this:
"read file - then 1"
"(empty string)"
"TIC Read Status [2:0x0]: 1:57" (4 times)
It never gets to the second log, but it neither has an error in the logs....
When I run it in android device, I get the first log, then all the data read from the file and then the second log and everything works fine but in iOS it stops in the 'JSON.parse' line without error but the device continue in a loading state and it never stops. Seems like there were an error but no error detected...
Any help? Thanks!!!
Check out this page: https://ionicframework.com/docs/wkwebview/#rewriting-file
You should try using normalizeURL(this.file.cacheDirectory + 'epg/')
Solved it removing the platform (ionic cordova platform rm ios) and installing it again!

How to fix "http not found in com.apple.developer.associated-domains entitlement" in iOS app?

I have created a basic iOS app in Swift that uses a WKWebView. I am using SecAddSharedWebCredential and SecRequestSharedWebCredential to save and load usernames and passwords within the users KeyChain.
When I launch the app with the simulator, everything works perfectly fine. Although, when I launch on a device, I get the error of:
http not found in com.apple.developer.associated-domains entitlement
Within the simulator and device, when displaying the credential list to a user, it comes up as (note the http):
When using my save and get functions, I make sure that I pass in my URL, so I don't think that could be the problem.
SecAddSharedWebCredential(self.URLPath, loginUsername, loginPassword)
SecRequestSharedWebCredential(self.URLPath, nil)
It looks like you have something like webcredentials:http://example.com in your entitlements. Try getting rid of the http so it's just webcredentials:example.com.

Parse.com 1.6 crash analytics upload failure

I have a problem getting the new crash reporting in Parse 1.6 to work. The symptoms are the same as parse.com 1.6 crash analytics not working , but my reputation is too low to add my information.
1) I followed the quick start and guide to set up crash reporting and upload my symbols
https://parse.com/docs/ios_guide#crashreporting/iOS
https://parse.com/apps/quickstart#analytics/crashreporting/ios/existing
2) I'm following the instructions to generate a crash report by running the app directly in the simulator (iOS 7-8) and on the device (iOS 6) without a debugger attached. On the simulator I can actually see the minidump being created in Library/Parse/PFCrashReports.
3) When launching the app again I get the message "Breakpad Uploader: unable to determine minidump file length" and the crash dump disappears from the file system. So I assume Parse uses google breakpad under the hood, and the error is created by Uploader.mm because the call to stat() fails. I tried the same call in my own code and it succeeds there.
My gut feeling is that there is either a permission problems, or some other code locks the file while the uploader tries to access it. As the parse libraries are closed source it is hard to check anything, though. It is a bit suspicious that other people don't seem to have a problem with this, which may mean some other settings or configuration problem.

Fresh SpeakHere example app has error when recording audio in Simulator/Xcode

I can't record audio using the SpeakHere example app from apple. When I run the app in Simulator from within Xcode, it starts up normally, but when I press the record button, the error "Thread 1: EXC_BREAKPOINT (code=EXC_I386_BPT, subcode=0x0)" occurs:
The log message about the missing root view controller at app startup is already there BEFORE the above error occurs and it is probably not connected to my problem.
I have downloaded the SpeakHere example project from the linked website (see top of this question), opened the fresh download in Xcode and directly started the app. I did not modify any setting and not any line of code. I've also searched on google and stackoverflow for this problem and didn't find a solution, although this problem must be very general.
I use Xcode Version 4.5.2 (4G2008a) and a MacBook Pro from late 2009 with Mac OS X 10.8.
I've also had a friend try this on his computer and he has the very same problem. He has the same OS and his XCode version is also 4.5.2.
I would now try older Xcode versions, but right now I don't like to download a few gigabytes for a trial'n'error approach on my connection.
Any help appreciated, including reports like "works for me with Xcode version ...". Thanks!
The problem occurs because in the method AQRecorder::StartRecord(CFStringRef inRecordFile), the function CFURLCreateWithString() fails and returns a pointer to nil. This is not detected and later on the code calls CFRelease() on this nil pointer, which causes the EXC_BREAKPOINT.
The purpose of the method CFURLCreateWithString() basically is to take a url string as input and return a pointer to a CFURL object as output. The problem here is that the input is not a url string. Instead, it's simply a path on the local file system without file:/ or the like as prefix. For this reason, this method fails.
The solution is to remove the not-working call to the method CFURLCreateWithString() and instead call a related method, namely CFURLCreateWithFileSystemPath(), which is prepared to take a local file system path and convert it to a CFURL:
In the method AQRecorder::StartRecord(CFStringRef inRecordFile), replace or comment out the line
url = CFURLCreateWithString(kCFAllocatorDefault, (CFStringRef)recordFile, NULL);
and insert
url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, (CFStringRef)recordFile, kCFURLPOSIXPathStyle, false);
at its place.
url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, (CFStringRef)recordFile, kCFURLPOSIXPathStyle, false);
The code above made my xcoce 4.6 compile and run in simulator, but it doesnot record my voice from my usb microphone, I test my microphone in the garash band application and sucessfully record and play my voice, and the dbmeter does not move at all, any way when I port it to the real device it work, it just can't record and play voice in my simulator.

PhoneGap + Sencha2 screen blank

I've started a project in PhoneGap which will utilise Sencha Touch 2.
I tried to change the app name from 'app', since I've heard that conflicts with PhoneGap on Android devices. I altered app.js to main.js and that worked, but then I tried changing the Ext.application.name. All I got was a white screen after the loading splash, even with the old name Sencha. Debug console shows nothing at all happening, and the document <body> was empty. This happens with both sencha-touch-all.js and sencha-touch-all-debug.js. Test device is an iPad 1G running iOS 4.3.5.
Aside: To debug this issue, I set up weinre on my Mac and added the appropriate <script> tag to index.html. After making that change, though, the app didn't even launch. It hung on the PhoneGap splash png and I got this message from gdb-remote:
error: failed to launch '<app URI>' -- failed to send the qLaunchSuccess packet
The only reference to that message besides its definition in gdb-remote source that I can find is here, and it's unrelated. I managed to get the issue to go away by restarting the iPad and removing build intermediates.
SOLVED: The issue here was a missing value in the Ext.application definition (key with no associated value), so the whole app definition probably tanked as a result of that. Hence blank screen.

Resources