nstudio / nstudio/nativescript-plugins
[camera-plus] Uncaught Could not create UIImage
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 55
- Forks
- 42
- Avg merge
- 49m
- Merged PRs (30d)
- 1
Description
When cloning this repo, building, and then installing the built nativescript-camera-plus plugin, i find that my app crashes when it navigates to the page where i am using the plugin.
I am using Nativescript (NS7)+ Vue and get the following error:
CONSOLE LOG: NativeScript-CameraPlus --- [CameraPlus createNativeView]
CONSOLE LOG: NativeScript-CameraPlus --- [video enabled:, false]
CONSOLE LOG: NativeScript-CameraPlus --- [default camera:, rear]
CONSOLE LOG: NativeScript-CameraPlus --- [MySwifty viewdidload]
CONSOLE LOG: NativeScript-CameraPlus --- [doubleTapCameraSwitch:, true]
CONSOLE LOG: NativeScript-CameraPlus --- [this.cameraDelegate:, <SwiftyDelegate: 0x600003cc0640>]
CONSOLE LOG: NativeScript-CameraPlus --- [view:, <UIView: 0x7fecb240cb70; frame = (0 0; 834 1194); autoresize = W+H; layer = <CALayer: 0x600003f88a20>>]
CONSOLE LOG: NativeScript-CameraPlus --- [initNativeView.]
CONSOLE LOG: NativeScript-CameraPlus --- [MySwifty viewWillAppear]
***** Fatal JavaScript exception - application has been terminated. *****
NativeScript encountered a fatal error: Uncaught Could not create UIImage!
at
logError(file: node_modules/nativescript-vue/dist/index.js:1899:4)
at globalHandleError(file: node_modules/nativescript-vue/dist/index.js:1888:2)
at handleError(file: node_modules/nativescript-vue/dist/index.js:1848:4)
at invokeWithErrorHandling(file: node_modules/nativescript-vue/dist/index.js:1871:4)
at invoker(file: node_modules/nativescript-vue/dist/index.js:2527:13)
at _handleEvent(file: app/packages/core/data/observable/index.ts:279:10)
at notify(file: app/packages/core/data/observable/index.ts:258:14)
at _emit(file: app/packages/core/data/observable/index.ts:307:8)
at onLoaded(file: app/packages/core/ui/core/view-base/index.ts:406:7)
at onLoaded(file: app/packages/nativescript-camera-plus/index.ios.ts:794:8)
at (file: app/packages/core/ui/core/view-base/index.ts:498:67)
at callFunctionWithSuper(file: app/packages/core/ui/core/view-base/index.ts:491:2)
at callLoaded(file: app/packages/core/ui/core/view-base/index.ts:498:7)
at loadView(file: app/packages/core/ui/core/view-base/index.ts:676:8)
at (file: app/packages/core/ui/core/view-base/index.ts:401:8)
at eachChildView(file: app/packages/core/ui/layouts/layout-base-common.ts:125:18)
at eachChild(file: app/packages/core/ui/core/view/view-common.ts:867:7)
at onLoaded(file: app/packages/core/ui/core/view-base/index.ts:400:7)
at (file: app/packages/core/ui/core/view-base/index.ts:498:67)
at callFunctionWithSuper(file: app/packages/core/ui/core/view-base/index.ts:491:2)
at callLoade<…>
I have tried the suggestion in #12 to comment out this._swifty.previewLayer.frame = CGRectMake(frame.origin.x, frame.origin.y, size.width, size.height); and this._swifty.previewLayer.setNeedsLayout(); lines, but that does not seem to change anything.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the crash by building and installing the plugin, then navigating to the page that uses the camera. Start at app/packages/nativescript-camera-plus/index.ios.ts around the onLoaded call at line 794, and compare the preview-layer lines mentioned in #12. Done means the page loads without the “Could not create UIImage” exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, typescript
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100