Merott / nativescript-pdf-view

A basic PDF viewer plugin for NativeScript. Now maintained by @madmas: github.com/madmas/nativescript-pdf-view
Other
32 stars 35 forks source link

Error while loading file on iOS #12

Closed dpdragnev closed 7 years ago

dpdragnev commented 7 years ago

Hello,

I recently started experiencing an issue on iOS. I get the following error:

Error: Building UI from XML. @file:///app/modals/view-agreement.xml:15:5 > Module '/var/containers/Bundle/Application/87864679-0FF8-4744-807A-E81D102C04B4/NativeScript230.app/app/tns_modules/nativescript-pdf-view' not found for element 'nativescript-pdf-view:PDFView'. > UIScreen.mainScreen is not a function. (In 'UIScreen.mainScreen()', 'UIScreen.mainScreen' is an instance of UIScreen) -- {"stack":"init@file:///app/tns_modules/nativescript-pdf-view/src/plugin.js:48:53\nPDFView@file:///app/tns_modules/nativescript-pdf-view/src/plugin.js:12:18\ngetComponentModule@file:///app/tns_modules/ui/builder/component-builder.js:57:36\nloadCustomComponent@file:///app/tns_modules/ui/builder/builder.js:80:56\nparse@file:///app/tns_modules/ui/builder/builder.js:415:62\nparse@file:///app/tns_modules/ui/builder/builder.js:262:42\nnext@file:///app/tns_modules/ui/builder/builder.js:149:29\nparse@file:///app/tns_modules/ui/builder/builder.js:224:22\nnext@file:///app/tns_modules/ui/builder/builder.js:149:29\nfile:///app/tns_modules/ui/builder/builder.js:164:31\nfile:///app/tns_modules/xml/xml.js:148:20\nparse@file:///app/tns_modules/js-libs/easysax/easysax.js:751:34\nparse@file:///app/tns_modules/xml/xml.js:195:27\nparse@file:///app/tns_modules/ui/builder/builder.js:173:32\nparseInternal@file:///app/tns_modules/ui/builder/builder.js:48:16\nloadInternal@file:///app/tns_modules/ui/builder/builder.js:125:40\nload@file:///app/tns_modules/ui/builder/builder.js:109:39\npageFromBuilder@file:///app/tns_modules/ui/frame/frame-common.js:111:31\nresolvePageFromEntry@file:///app/tns_modules/ui/frame/frame-common.js:89:35\nshowModal@file:///app/tns_modules/ui/page/page-common.js:252:50\nshowDocuments@file:///app/components/main/main.js:167:19\nrecognize@file:///app/tns_modules/ui/gestures/gestures.js:52:26\nUIApplicationMain@[native code]\nstart@file:///app/tns_modules/application/application.js:251:30\nanonymous@file:///app/app.js:141:10\nevaluate@[native code]\nmoduleEvaluation@[native code]\n[native code]\npromiseReactionJob@[native code]"

I am using the AppBuilder with NS version 2.3.

I wonder if this is related to the changes Apple made in iOS 10? I found this issue that describes the same problem: https://github.com/telerik/nativescript-ui-samples/issues/126

Do you have a workaround for it?

Thanks.

dpdragnev commented 7 years ago

For those that are facing the same issue, I created a pull request with the fix.