0

Failed to add pass: 'file:///Users/Faisal.Dilawar/Downloads/idcard.pkpass' Error Domain=PKPassKitErrorDomain Code=1 "Failed to read data" UserInfo={NSLocalizedDescription=Failed to read data, NSUnderlyingError=0x6000039b5110 {Error Domain=NSCocoaErrorDomain Code=260 "The file “pass.json” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/Users/Faisal.Dilawar/Library/Developer/CoreSimulator/Devices/1837CC0E-FB3D-4D8F-91BC-3898BF39F029/data/Containers/Data/Application/614DC1F4-86BE-4598-A47F-A6463B8979B8/Library/Caches/com.apple.Passbook/com.apple.Passbook/1282B9B6-2EFD-41DD-BC6A-7BC3FD724402.pkpass/pass.json, NSUnderlyingError=0x6000039b51d0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}}}.

This error is coming while dropping the .pkpass file on simulator. @passkit

1 Answers1

0

The error is pretty self explanatory, your .pkpass file probably lacks the pass.json file. To check if it has one go to https://pkpassvalidator.azurewebsites.net/ and upload your .pkpass file. Or you can rename te .pkpass file to .zip and unzip it. Check if it actually contains a pass.json and if not, you are not generating your .pkpass correctly. If you want information on what went wrong during the file generation you need to provide some more information on how you have generated it.

  • I have checked on this link. Everything is correct. When i converted .pkpass file into zip it was showing pass.json as well here i am attaching the manifest.json and pass.json I have generated it using jpasskit library provided on git – Priyanshi Tiwari Dec 07 '18 at 13:33
  • { "formatVersion": 1, "serialNumber": "00001233", "passTypeIdentifier": "*******", "description": "Mibenefits ID Card", "teamIdentifier": "*******", "organizationName": "*******", "logoText": "MyPass", "foregroundColor": "rgb(255,255,255)", "storeCard": { "primaryFields": [ { "key": "balance", "label": "balance", "value": "20.0", "currencyCode": "EUR" } ] }, "sharingProhibited": false } – Priyanshi Tiwari Dec 07 '18 at 13:36
  • { "pass.json": "d46234c52b46a28b23207736ba991162018524cf", "icon.png": "f8a2bb1b52c426275312c98c626d5be92758170e", "logo@2x.png": "b98b0504f4f067de4f7a6c1e95df8a78024dc3bb", ".DS_Store": "a46dc67a056a29bb71843be5fdaadd8380fd2c98", "icon@2x.png": "4204eafa4ac2df2339cf3308a2b0ecd228732589", "logo.png": "0a790897e6b8040fe73baa99053b706939f65d07" } maifestFile – Priyanshi Tiwari Dec 07 '18 at 13:45