wouterverweirder/kinect-azure

Package will not build with Electron Builder

Closed this issue · 10 comments

I have just migrated over to this package from the kinect2 package and am having trouble building the package for production. I keep getting errors that it can't find dependencies and it is looking for the package.json to help resolve it. I wasn't getting this error with the kinect2 package before and I suspect it has to do something with all of the extra needed files for the new kinect-azure package.

My dependencies are as follows:

"devDependencies": {
"@angular-devkit/build-angular": "^0.1100.5",
"@angular-devkit/core": "^11.0.5",
"@angular/cdk": "^11.0.3",
"@angular/cli": "^11.2.10",
"@angular/compiler-cli": "^11.0.5",
"@types/jasmine": "~3.6.0",
"@types/jasminewd2": "2.0.8",
"@types/mocha": "7.0.1",
"@types/node": "^15.9.0",
"chai": "4.2.0",
"codelyzer": "^6.0.0",
"conventional-changelog-cli": "^2.1.1",
"electron": "11.1.1",
"electron-builder": "^22.10.5",
"electron-reload": "^1.5.0",
"eslint": "^7.17.0",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "^6.3.2",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"mocha": "^7.2.0",
"npm-run-all": "4.1.5",
"spectron": "^11.1.0",
"ts-node": "8.6.2",
"typescript": "4.0.5"
},
"engines": {
"node": ">=10.9.0"
},
"dependencies": {
"@angular-material-extensions/password-strength": "^8.2.1",
"@angular/animations": "^11.0.5",
"@angular/common": "^11.0.5",
"@angular/compiler": "^11.0.5",
"@angular/core": "^11.0.5",
"@angular/fire": "^6.1.4",
"@angular/flex-layout": "^12.0.0-beta.34",
"@angular/forms": "^11.0.5",
"@angular/language-service": "^11.0.5",
"@angular/material": "^11.0.3",
"@angular/platform-browser": "^11.0.5",
"@angular/platform-browser-dynamic": "^11.0.5",
"@angular/router": "^11.0.5",
"@fortawesome/angular-fontawesome": "^0.8.1",
"@fortawesome/fontawesome-svg-core": "^1.2.32",
"@fortawesome/free-brands-svg-icons": "^5.15.1",
"@fortawesome/free-solid-svg-icons": "^5.15.1",
"@ngx-translate/core": "11.0.1",
"@ngx-translate/http-loader": "4.0.0",
"aws-sdk": "^2.821.0",
"chart.js": "^2.9.4",
"child_process": "^1.0.2",
"core-js": "2.6.1",
"electron-is-dev": "^2.0.0",
"electron-log": "^4.3.5",
"electron-updater": "4.3.8",
"firebase": "^8.2.1",
"font-awesome": "^4.7.0",
"kinect-azure": "^0.0.19",
"lazy-line-painter": "^1.9.6",
"ng-circle-progress": "^1.6.0",
"ng2-charts": "^2.4.2",
"ngx-auth-firebaseui": "^5.3.0",
"os": "^0.1.1",
"rxjs": "6.6.3",
"three": "^0.124.0",
"three-orbitcontrols-ts": "git+https://git@github.com/nicolaspanel/three-orbitcontrols-ts.git",
"three.meshline": "git+https://github.com/spite/THREE.MeshLine.git",
"tslint": "^6.1.3",
"universal-analytics": "^0.4.23",
"wait-on": "3.2.0",
"webdriver-manager": "12.1.0",
"zone.js": "0.10.3"
}

I am also getting lots of issues because of the use of require.js, since I am using a modern frontend framework (Angular and Webpack) to load in the camera package I am having to change the require() to window.require, which doesn't seem all that sustainable. Is there a more flexible way to load in the dependencies?

Hi Chris,

I've put together a basic demo application with electron-builder, electron-webpack and kinect-azure (with Body Tracking): https://github.com/wouterverweirder/electron-builder-kinect-azure-demo

An important addition to the package.json config, is copying the necessary DLL files for body tracking to work in the release build:

  "build": {
    "appId": "be.aboutme.kinect-azure.electron-builder-kinect-azure-demo",
    "win": {
      "extraFiles": [
        {
          "from": "C:\\Program Files\\Azure Kinect Body Tracking SDK\\tools",
          "to": "./"
        }
      ]
    }
  },

I pulled down the project, it isn't working for me, here is the error when I try and build dev

image

You'll get this error when windows can't find the necessary dll files, even when the kinectAzure.node file is there.

I have added an extra script to the package.json file of the demo project.

Get the latest version, and run

npm run copy-dlls

before launching in dev mode. I'm assuming the dll files are in the default install directory of the body tracking sdk, aka C:\Program Files\Azure Kinect Body Tracking SDK\tools

A distribution build should have worked, as the dll copying is included in the electron-builder config.

I ran it and wasn't able to get it to run, ended up having the same issue even though the dlls successfully copied over

image

image

I tried downgrading the kinect-azure package to 0.0.19 and that did seem to run, but wasn't able to build a release package. Could you instead use this repo that someone made that uses a similar setup as I do (while still having electron-webpack like your project does)?

https://sourcygen.github.io/electron-angular-quick-start/

Ok, I've just pushed some changes on how the prebuild binaries of this module are handled. Try using version 0.2.2 of this library? If not, could you post the full log of what happens when you npm install this module?

One quick fix... the xcopy command wasn't working for me, I looked into it and fixed it... here is the corrected command so that others wont have the same issue I did with that part. I am currently working on the rest, I will update you when I have tried upgrading.

"xcopy "C:\Program Files\Azure Kinect Body Tracking SDK\tools" "." /H /C /Y"

I still can't get it to build with the new format. below is the yarn install

image

next is the copy-dlls

image

and the rest of the yarn dev

image

which then builds and gives me this...

image

Do you think it might have anything to do with this part of the error message? I have never seen that before....

image

I am assuming the kinectAzure.node file is on your system? Could you open that file with dependency walker (https://www.dependencywalker.com) and check what dll files it is reporting missing?