GoogleDataTransport][I-GDTCOR001006] problem? - ios

II had been working on my project like normal when all of a sudden I got this error:
> 2020-05-20 01:42:40.798198-0400 [10404:4763011] [GoogleDataTransport][I-GDTCOR001006] There was an error reading extension bytes from disk: Error Domain=NSCocoaErrorDomain Code=260 "The file “event-16738913419221216480” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/var/mobile/Containers/Data/Application/B3D1204C-A52F-496C-89D8-388D4A75C102/Library/Caches/google-sdks-events/event-16738913419221216480, NSUnderlyingError=0x2838cdbf0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
The error occures in the file seen bellow.
The specific line error is:
> Thread 1: EXC_BAD_ACCESS (code=2, address=0x16bcfffb0)
For the second line here:
NSString *pathString = [self
decodePath:[NSString stringWithFormat:#"/%#", originalPathString]]; //this line
FPath *path = [[FPath alloc] initWith:pathString];
FRepoInfo *repoInfo = [[FRepoInfo alloc] initWithHost:host
isSecure:secure
withNamespace:namespace];
FFLog(#"I-RDB095002", #"---> Parsed (%#) to: (%#,%#); ns=(%#); path=(%#)",
url, [repoInfo description], [repoInfo connectionURL],
repoInfo.namespace, [path description]);
FParsedUrl *parsedUrl = [[FParsedUrl alloc] init];
parsedUrl.repoInfo = repoInfo;
parsedUrl.path = path;
return parsedUrl;
I tried removing my pods and re-installing them. This did not change anything.
I have also tried restarting my computer.
How can I solve this problem?
Update:
After further testing, I found that the error occurs in various files within the firebaseDatabase folder, I also was able to isolate it to one query to the database found in multiple files. However under files after un-commenting it, it began working as before again. Given the number of queries however I still have the issue.
Also have an issue active on giithub: https://github.com/firebase/firebase-ios-sdk/issues/5661.

Run pod update
This issue was fixed a few weeks ago. See https://github.com/firebase/firebase-ios-sdk/issues/5421

Related

iOS - Can't Read File Located In Documents Directory

I am trying to read a file in which I successfully downloaded and saved in the Documents directory. However, when I try to read it, if fails.
Here is the error:
2016-03-28 21:00:26.585 App[569:4103] Path is /var/mobile/Applications/3AFA2430-C0DC-44CD-95F8-A89D82B2C348/Documents/combo.bin
2016-03-28 21:00:26.603 App[569:4103] Error in reading Error Domain=NSCocoaErrorDomain Code=257 "The operation couldn’t be completed. (Cocoa error 257.)" UserInfo=0x17df29d0 {NSFilePath=/var/mobile/Applications/3AFA2430-C0DC-44CD-95F8-A89D82B2C348/Documents/combo.bin, NSUnderlyingError=0x17df90b0 "The operation couldn’t be completed. Permission denied"}
Here is my code:
NSError *error;
NSData *firmwareContentData = [NSData dataWithContentsOfFile:FIRMWARE_LOCAL_PATH options:NSDataReadingMappedIfSafe error:&error];
NSLog(#"Path is %#", FIRMWARE_LOCAL_PATH);
if(error)
{
NSLog(#"Error in reading %#", error);
return;
}
local path is
#define FIRMWARE_LOCAL_PATH [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingPathComponent:#"combo.bin"]
I tried using NSTemporaryDirectory(), using NSFileManager to get the contents of the file, but none of them works. Any idea why? Thanks in advance!
You have a permissions error. You don't have the right permissions to open the file. Wherever you got it from, you're locked out. You might try to download it in the simulator, and check it through Apple's file system to see what permissions it actually downloaded with. The path is:
~/Library/Developer/CoreSimulator/Devices//data/Containers/Data/Application//Documents.
Replace the two big random strings with the directories that show a mod date of today, or NSLog the real path from your iOS app.

Error Domain=NSCocoaErrorDomain Code=256 "The file “...” couldn’t be opened."

When I open a URL (like this http://webserver/index.php/feeds/1.2/3.4/5/1000/) in my app via Xcode I get a nil JSON string returned. It doesn't even seem to be talking to the server.
The exact same URL works when I paste it into a browser.
Reading up on similar problems, I tried restarting my Mac and iPhone but I get the same problem.
e.g. looking at the error object I see:
Error Domain=NSCocoaErrorDomain Code=256 "The file “1000” couldn’t be opened." UserInfo={NSURL=http://webserver/index.php/feeds/1.2/3.4/5/1000/}
The webserver does not show any entries in the logs (it does if I paste the URL in the browser) when I'm running the app and go past that line of code.
==== UPDATE
I'm assuming it's something to do with this NSURLSession/NSURLConnection HTTP load failed on iOS 9
However, after adding the webservice domain to the plist (under NSExceptionDomains) I get a crash in CJSONDserializer in this method:
- (id)deserializeAsDictionary:(NSData *)inData error:(NSError **)outError;
{
if (inData == NULL || [inData length] == 0)
as follows:
Thread 4: EXC_BAD_ACCESS (code=1,address=0x10)
and, after updating TouchJSON, I now have a crash here:
if (theData.length >= 4)
==== UPDATE 2
Interestingly, if I click the QuickLook icon in Xcode whilst on the breakpoint, it loads up the content just fine. And I can see a request at the server.
Any suggestions?

How can I use OpenEars in a tweak?

I'm trying to include OpenEars in a theos project I'm making, a tweak for jailbroken iDevices, as I need speech recognition for my tweak. I was able to link the OpenEars framework by putting it in the same folder as my private frameworks, and I'm currently trying to get the tutorial code to work. Here's my current code:
#import <OpenEars/LanguageModelGenerator.h>
#import <OpenEars/PocketsphinxController.h>
#import <OpenEars/AcousticModel.h>
%hook SBLockScreenView
-(void)setCustomSlideToUnlockText:(id)arg1 {
LanguageModelGenerator *lmGenerator = [[LanguageModelGenerator alloc] init];
NSArray *words = [NSArray arrayWithObjects:#"WORD", #"STATEMENT", #"OTHER WORD", #"A PHRASE", nil];
NSString *name = #"NameIWantForMyLanguageModelFiles";
NSError *err = [lmGenerator generateLanguageModelFromArray:words withFilesNamed:name forAcousticModelAtPath:[AcousticModel pathToModel:#"AcousticModelEnglish"]];
//NSError* err = [lmGenerator generateLanguageModelFromArray:words withFilesNamed:name forAcousticModelAtPath:imagePath];
//NSError* err = [[NSError alloc] init];
NSDictionary *languageGeneratorResults = nil;
NSString *lmPath = nil;
NSString *dicPath = nil;
if([err code] == noErr) {
languageGeneratorResults = [err userInfo];
lmPath = [languageGeneratorResults objectForKey:#"LMPath"];
dicPath = [languageGeneratorResults objectForKey:#"DictionaryPath"];
}
else {
NSLog(#"Error: %#",[err localizedDescription]);
}
%orig;
}
%end
This compiles fine, but when it runs, I get these error messages and my device crashes: "While trying to reference the requested acoustic model bundle which is expected to be at the path (null), no bundle was found. This means that when the listening loop begins, it will crash due to the missing required resources. The problem finding the acoustic model bundle could be because the name of the bundle was not given to this method in a way it can use; for instance, if you are trying to use the English acoustic model and you have added that bundle to your app project, you would invoke this method by passing [AcousticModel pathToAcousticModel:#"AcousticModelEnglish"] (or [AcousticModel pathToAcousticModel:#"AcousticModelSpanish"] for the Spanish bundle), without appending ".bundle" to the end, and making sure that the bundle name is spelled exactly as it appears in the actual bundle name (the bundle can be seen in this distribution's folder "Framework".
If this doesn't fix the problem, it is very likely to be due to the fact that the acoustic model bundle wasn't imported successfully into the root level of your app project and its mainBundle. This usually happens either because the acoustic model bundle was never dragged into your app project when the "Framework" folder was originally supposed to be dragged in, or because it was dragged in but instead of using the setting "Create groups for any added folders" in Xcode's "Add Files" dialog, the option "Create folder references for any added folders" was unintentionally chosen. To fix this, just remove the acoustic model bundle or the "Framework" folder from your app and add it again to your app project with the correct setting of "Create groups for any added folders" in Xcode's "Add Files" dialog."
I also get these messages in my syslog:
May 27 00:54:49 Phillips-iPhone SpringBoard[17785] <Warning>: acousticModelPath is (null)
May 27 00:54:49 Phillips-iPhone SpringBoard[17785] <Warning>: Error: the default phonetic dictionary (null)/LanguageModelGeneratorLookupList.text can't be found in the app bundle but the app is attempting to access it, most likely there will be a crash now.
May 27 00:54:49 Phillips-iPhone SpringBoard[17785] <Warning>: Error while trying to load the pronunciation dictionary: Error Domain=NSCocoaErrorDomain Code=260 "The operation couldn’t be completed. (Cocoa error 260.)" UserInfo=0x1883cbb0 {NSFilePath=(null)/LanguageModelGeneratorLookupList.text, NSUnderlyingError=0x1883cb40 "The operation couldn’t be completed. No such file or directory"}
May 27 00:54:49 Phillips-iPhone SpringBoard[17785] <Error>: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid domain=nil in -[NSError initWithDomain:code:userInfo:]'
Any help in getting this working is greatly appreciated. Thanks!
I recently made an OpenEars based iOS tweak and I went through the same problem. Because your tweak is not a normal app, the location that pathToAcousticModel gives will not be correct. The easiest solution is to place the acoustic model bundle in a known location and hard code it.
For example, if you are using theos you can place AcousticModelEnglish.bundle in the folder "layout/Library/OpenEars/". Then replace
[AcousticModel pathToAcousticModel:#"AcousticModelEnglish"]
with
#"/Library/OpenEars/AcousticModelEnglish.bundle"
The easiest solution that I found was dragging the "Framework" folder from the OpenEars library that contains the bundle files to the "Frameworks" folder inside the Xcode project. After dragging, mark the option "copy items if needed".
It sounds strange in the first look but this solution works and you won't change the code.
You will get a file structure like that:
You can also remove the oldest references of these libraries under the "Framework" folder to keep your project clean.
Cheers,
David

Getting Error Domain=NSCocoaErrorDomain Code=261 with simple case

I have the following bit of code. path is a bundle path to a file in my bundle.
_dictionary = [[NSMutableDictionary alloc] initWithContentsOfFile:path];
NSError *error;
NSString *string = [[NSString alloc] initWithContentsOfFile:path encoding:NSUTF8StringEncoding error:&error];
What I don't understand is the _dictionary variable looks fine. It was able to get the contents and convert it to a dictionary. However, the simple case of converting the file to a string is giving me an error:
$2 = 0x12eb3d50 Error Domain=NSCocoaErrorDomain Code=261 "The operation couldn’t be completed. (Cocoa error 261.)" UserInfo=0x12eb3550 {NSFilePath=/Users/ben/Library/Application Support/iPhone Simulator/6.1/Applications/82CBC7A6-2C4C-4330-9B29-7940C961B5B7/FMA.app/Licenses.plist, NSStringEncoding=4}
How can I read the PLIST file as a simple XML string? I've checked the encoding and the file is UTF-8 encoded (as is also indicated by the XML content headers). If I change the encoding to something else, I don't get an error, but the string is garbled! Any ideas?
If Xcode is copying the plist file into your app bundle then you should ensure it is copied as an XML file and not as binary (which seems to be the default setting now).
In Xcode, go to your project, select the target, go to build settings, search for 'property', change the drop-down setting for 'Property List Output Encoding' to XML.

Xcode Unit Test and Writing Data to Disk

I am trying to write logic test to debug a a method that saves image data to disk. I use the following lines to write image data to the documents directory:
docspath = [[NSString alloc] initWithString:[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, TRUE) objectAtIndex:0]];
fullpath = [[NSString alloc] initWithFormat:#"%#/%#", docspath, _name];
BOOL written = [fileData writeToFile:fullpath options:NSDataWritingAtomic error:&dataerror];
Except, the data is not written and the error description returns no such file or directory. I am running this code under a test target in the iOS 5.1 simulator. Do I need to create intermediate directories to get to the documents directory, or is there another issue with writing to disk under a test target?
The error returned:
2012-06-29 16:13:31.819 otest[4597:7b03] /Users/myaccount/xcode_projects/myproject/myproject/myfolder/MMFileManager.m - 285: Error Domain=NSCocoaErrorDomain Code=4 "The operation couldn’t be completed. (Cocoa error 4.)" UserInfo=0x1e1e3a0 {NSUserStringVariant=Folder, NSFilePath=/Users/myaccount/Library/Application Support/iPhone Simulator/5.1/Documents/mmLogo.png, NSUnderlyingError=0x1e1b430 "The operation couldn’t be completed. No such file or directory"}
Unit test is not in your app, therefore, you can't access Documents directory in the unit test.
refer to NSHomeDirectory in iPhone unit test

Resources