phonegap / phonegap-plugin-contentsync

Download and cache remotely hosted content
Apache License 2.0
206 stars 98 forks source link

iOS 12 Crash #196

Open KannanKrishnamoorthy opened 5 years ago

KannanKrishnamoorthy commented 5 years ago

App got crashed after iOS 12 update. We got below details regarding content sync crash issue.

Issue Details : Fatal Exception: NSInvalidArgumentException -[NSURL URLByAppendingPathComponent:]: component, components, or pathExtension cannot be nil.

ContentSync.m line 442 -[ContentSync URLSession:downloadTask:didFinishDownloadingToURL:]

timkim commented 5 years ago

Hi @KannanKrishnamoorthy

I just tried this on Xcode 10.1, iOS 12.1 and it worked just fine for me.

Can you show how you called the the sync command? Ie, something like:

ContentSync.sync({ src: 'http://169.254.127.191:3000/__api__/appzip', id: 'phonegapdevapp', type: 'replace', copyCordovaAssets: true });

It is likely the src argument you are providing is wrong or malformed. In addition, you may want to actually step debug ContentSync.m line 442 to see what value is actually passed in.

KannanKrishnamoorthy commented 5 years ago

Hi @timkim,

Thank you for your response. We are not changing anything in sync command for iOS 12. Our App is support from iOS 8, same argument values are passed in all iOS versions. Our App is working fine in below iOS 12 versions but crash occurred on iOS 12 only. If src wrong or malformed means app crashed in all iOS versions right? But we have found crash in iOS 12 only.

I have seen originalURL value and sourceURL value are passed in ContentSync.m line 442 correctly.

Kindly suggest how to handle this exception. Thank you

timkim commented 5 years ago

Please provide a sample. I don't get the errors you are getting.