Jahrenski / test-cordova-electron

Test for a native plugin for cordova-electron
MIT License
0 stars 0 forks source link

After trying the procedure in README.md (in Linux Operating System) #1

Open Vetagiri-Hrushikesh opened 3 years ago

Vetagiri-Hrushikesh commented 3 years ago

` • electron-builder version=22.9.1 os=5.11.0-17-generic

• writing effective config file=platforms/electron/build/builder-effective-config.yaml

• installing production dependencies platform=win32 arch=x64 appDir=/home/osboxes/Desktop/Hrushikesh/Testing/test-cordova-electron/platforms/electron/www

• packaging platform=win32 arch=x64 electron=10.1.2 appOutDir=platforms/electron/build/win-unpacked

• downloading url=https://github.com/electron/electron/releases/download/v10.1.2/electron-v10.1.2-win32-x64.zip size=77 MB parts=4

• downloaded url=https://github.com/electron/electron/releases/download/v10.1.2/electron-v10.1.2-win32-x64.zip duration=2m27.119s

• downloading url=https://github.com/electron-userland/electron-builder-binaries/releases/download/winCodeSign-2.6.0/winCodeSign-2.6.0.7z size=5.6 MB parts=1

• downloaded url=https://github.com/electron-userland/electron-builder-binaries/releases/download/winCodeSign-2.6.0/winCodeSign-2.6.0.7z duration=10.58s

⨯ wine is required, please see https://electron.build/multi-platform-build#linux

• Above command failed, retrying 3 more times

⨯ wine is required, please see https://electron.build/multi-platform-build#linux

• Above command failed, retrying 2 more times

⨯ wine is required, please see https://electron.build/multi-platform-build#linux

• Above command failed, retrying 1 more times

⨯ wine is required, please see https://electron.build/multi-platform-build#linux

• Above command failed, retrying 0 more times

/home/osboxes/Desktop/Hrushikesh/Testing/test-cordova-electron/node_modules/app-builder-bin/linux/x64/app-builder exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE • electron-builder version=22.9.1 os=5.11.0-17-generic

• writing effective config file=platforms/electron/build/builder-effective-config.yaml

• installing production dependencies platform=win32 arch=x64 appDir=/home/osboxes/Desktop/Hrushikesh/Testing/test-cordova-electron/platforms/electron/www

• packaging platform=win32 arch=x64 electron=10.1.2 appOutDir=platforms/electron/build/win-unpacked

• downloading url=https://github.com/electron/electron/releases/download/v10.1.2/electron-v10.1.2-win32-x64.zip size=77 MB parts=4

• downloaded url=https://github.com/electron/electron/releases/download/v10.1.2/electron-v10.1.2-win32-x64.zip duration=2m27.119s

• downloading url=https://github.com/electron-userland/electron-builder-binaries/releases/download/winCodeSign-2.6.0/winCodeSign-2.6.0.7z size=5.6 MB parts=1

• downloaded url=https://github.com/electron-userland/electron-builder-binaries/releases/download/winCodeSign-2.6.0/winCodeSign-2.6.0.7z duration=10.58s

⨯ wine is required, please see https://electron.build/multi-platform-build#linux

• Above command failed, retrying 3 more times

⨯ wine is required, please see https://electron.build/multi-platform-build#linux

• Above command failed, retrying 2 more times

⨯ wine is required, please see https://electron.build/multi-platform-build#linux

• Above command failed, retrying 1 more times

⨯ wine is required, please see https://electron.build/multi-platform-build#linux

• Above command failed, retrying 0 more times

/home/osboxes/Desktop/Hrushikesh/Testing/test-cordova-electron/node_modules/app-builder-bin/linux/x64/app-builder exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE `

Jahrenski commented 3 years ago

Hi, seems like your device is missing the Wine component for linux. I'm not a linux user myself but here's some more documentation :

https://www.electron.build/multi-platform-build#linux

Vetagiri-Hrushikesh commented 3 years ago

Thanks for the reply. I will try this tonight, but by following this (what you have mentioned) I tried to do something similar in my custom Cordova plugin.

const {add} = global.require("./addon.node");
console.log(add(2,3);

But this time I didn't get something like mentioned above issue. But I faced by using global.require(), in case if I use only require then addon.node is not defined.

Uncaught ReferenceError: global is not defined
    at MaighaPluginProxy.js:2
    at build (cordova.js:47)
    at require (cordova.js:62)
    at localRequire (cordova.js:43)
    at Object.exports.mapModules (cordova.js:1244)
    at cordova.js:1168
    at Channel.f (cordova.js:670)
    at Channel.fire (cordova.js:823)
    at cordova.js:1160
    at onScriptLoadingComplete (cordova.js:1369)

I also tried using

global.require(./../../../../addon.node) ( because when we add the plugin to cordova project addon.node is adding at cordova-plugin-name/platforms/electron/platform_www and cordova-plugin-name/platforms/electron/www but not in test-cordova-electron/platforms/electron/platform_www/plugins/cordova-plugin-name/src/electron/ or  test-cordova-electron/platforms/electron/www/plugins/cordova-plugin-name/src/electron/ )  - (issue :  global is not defined)
global.require(./addon.node) - (issue :  global is not defined)
require(./addon.node) - (issue :  addon.node is not defined)

Can you please help me with this? Thank you