0


We are building three iOS application, these three apps are almost the same, so we have decided to create and use a library for the core of these apps. Also we are using CocoaPods for the dependencies. Everything is working fine except for libPhoneNumber-iOS.

I added libPhoneNumber-iOS as a dependency in our project (with CocoaPods), the resources and library is built, but the problem is the plist file use by libPhoneNumber is not loaded. So each time, the dictionary is null.

I found a solution by added this plist file to the subproject and it's working. But I don't want to do that for each app. Do you know what the problem could be?

Thanks.

Maurice
  • 2,129
  • 2
  • 25
  • 33

1 Answers1

0

I don't know why (so i'll remove that plist file future) But i have some solution, see below.

[SOLUTION? 1] HI even i am facing the same issue. i tracked the work flow to NSKeyedUnarchiver unarchiveObjectWithData:fileData] and i checked the value of file fileData its nearly .4mb so the file and its contents data are definitely getting there .

Apparently NSKeyedUnarchiver unarchiveObjectWithData: has bugs.

NSKeyedUnarchiver unarchiveObjectWithFile: returns nil in init: method

by suds89 (https://github.com/suds89)

[SOLUTION? 2] I've struggled with this exact issue for a while too, and figured that unarchiving worked properly on the emulator, but not on the device.

I noticed that the byte size of the fileData differed: 180085 on device and 496050 on the emulator, so while having incomplete data the unarchiving obviously cannot work properly.

The solution is to make sure to place the NBPhoneNumberMetadata.plist not just into the Resources folder, but actually into the Supporting Files folder and then do a clean on the project, rebuild and run it. Works like a charm! :-)

by irinutze (https://github.com/irinutze)

Community
  • 1
  • 1
ishtar
  • 76
  • 1
  • 5