← 输入框|github.com|刷新
Skip to content

node-java v0.12.2 fails with electron-rebuild (fatal error LNK1120) #541

Open

Description

@DManstrator

Hello.

When using version 0.12.1 , building and running the electron app works, but not with using version 0.12.2.

When I try to use the code below, it fails on 0.12.2 since electronbrowser\src\main\electron\node_modules\java\build\Release\nodejavabridge_bindings.node does not exist. However on 0.12.1 this does exist (see screenshots below). This reflects also what the logs show.

Execution:

electron-rebuild -f -w java && electron-packager . %electron_application% --overwrite --out %out% --extra-resource=%extra_resource_viewer% --extra-resource=%extra_resource_app% --icon=%electron_icon% --prune

I would be very glad to get some help on this, spend a day trying to resolve it but without any success. When you need more information, please notify me.

Versions:

Software

software version
Visual Studio Community 2019 16.11.6
Workload
Desktop development with C++
yes
Python 3.10.0

Dependencies

dependency version
node 16.5.0
electron 12.2.2
electron-packager 15.4.0
electron-rebuild 3.2.5
node-java 0.12.2

Logs / Stacktrace (partially in German)

[INFO] --- frontend-maven-plugin:1.12.0:npm (npm package electron app) @ electronbrowser ---
[INFO] Running 'npm run build-electron' in C:\Users\[...]\electronbrowser\src\main\electron
[INFO]
[INFO] > Electron-Browser@1.0.0 build-electron
[INFO] > npm run rebuild && npm run package-electron
[INFO]
[INFO]
[INFO] > Electron-Browser@1.0.0 rebuild
[INFO] > electron-rebuild -f -w java
[INFO]
[INFO] - Searching dependency tree
[INFO] Die Projekte in dieser Projektmappe werden nacheinander erstellt. Um eine parallele Erstellung zu erm?glichen, m?ssen Sie den Schalter "-m" hinzuf?gen.
[INFO]   java.cpp
[INFO] C:\Users\myUserName\.electron-gyp\12.2.2\include\node\v8.h(1650,55): warning C4996: 'v8::Module::ResolveCallback': Use ResolveModuleCallback [C:\Users\[...]\electronbrowser\src\main\electron\node_modules\java\build\nodejavabridge_bindings.vcxproj]
[INFO]   javaObject.cpp
[INFO] C:\Users\myUserName\.electron-gyp\12.2.2\include\node\v8.h(1650,55): warning C4996: 'v8::Module::ResolveCallback': Use ResolveModuleCallback [C:\Users\[...]\electronbrowser\src\main\electron\node_modules\java\build\nodejavabridge_bindings.vcxproj]
[INFO]   javaScope.cpp
[INFO]   methodCallBaton.cpp
[INFO] C:\Users\myUserName\.electron-gyp\12.2.2\include\node\v8.h(1650,55): warning C4996: 'v8::Module::ResolveCallback': Use ResolveModuleCallback [C:\Users\[...]\electronbrowser\src\main\electron\node_modules\java\build\nodejavabridge_bindings.vcxproj]
[INFO]   nodeJavaBridge.cpp
[INFO] C:\Users\myUserName\.electron-gyp\12.2.2\include\node\v8.h(1650,55): warning C4996: 'v8::Module::ResolveCallback': Use ResolveModuleCallback [C:\Users\[...]\electronbrowser\src\main\electron\node_modules\java\build\nodejavabridge_bindings.vcxproj]
[INFO]   utils.cpp
[INFO] C:\Users\myUserName\.electron-gyp\12.2.2\include\node\v8.h(1650,55): warning C4996: 'v8::Module::ResolveCallback': Use ResolveModuleCallback [C:\Users\[...]\electronbrowser\src\main\electron\node_modules\java\build\nodejavabridge_bindings.vcxproj]
[INFO]   win_delay_load_hook.cc
[INFO]      Bibliothek "C:\Users\[...]\electronbrowser\src\main\electron\node_modules\java\build\Release\nodejavabridge_bindings.lib" und Objekt "C:\Users\[...]\electronbrowser\src\main\electron\node_modules\java\build\Release\nodejavabridge_bindings.exp" werden erstellt.
[INFO] utils.obj : error LNK2001: Nicht aufgel?stes externes Symbol ""__declspec(dllimport) public: class std::shared_ptr<class v8::BackingStore> __cdecl v8::ArrayBuffer::GetBackingStore(void)" (__imp_?GetBackingStore@ArrayBuffer@v8@@QEAA?AV?$shared_ptr@VBackingStore@v8@@@std@@XZ)". [C:\Users\[...]\electronbrowser\src\main\electron\node_modules\java\build\nodejavabridge_bindings.vcxproj]
[INFO] C:\Users\[...]\electronbrowser\src\main\electron\node_modules\java\build\Release\nodejavabridge_bindings.node : fatal error LNK1120: 1 nicht aufgel?ste Externe [C:\Users\[...]\electronbrowser\src\main\electron\node_modules\java\build\nodejavabridge_bindings.vcxproj]
[INFO] C:\Users\[...]\electronbrowser\src\main\electron\node_modules\java\build\Release\nodejavabridge_bindings.node : fatal error LNK1120: 1 nicht aufgel?ste Externe [C:\Users\[...]\electronbrowser\src\main\electron\node_modules\java\build\nodejavabridge_bindings.vcxproj]Ã? Rebuild Failed
[INFO]
[INFO] An unhandled error occurred inside electron-rebuild
[INFO] node-gyp failed to rebuild 'C:\Users\[...]\electronbrowser\src\main\electron\node_modules\java'.
[INFO] For more information, rerun with the DEBUG environment variable set to "electron-rebuild".
[INFO]
[INFO] Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
[INFO]
[INFO]
[INFO]
[INFO] Error: node-gyp failed to rebuild 'C:\Users\[...]\electronbrowser\src\main\electron\node_modules\java'.
[INFO] For more information, rerun with the DEBUG environment variable set to "electron-rebuild".
[INFO]
[INFO] Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
[INFO]
[INFO]
[INFO]     at NodeGyp.rebuildModule (C:\Users\[...]\electronbrowser\src\main\electron\node_modules\electron-rebuild\lib\src\module-type\node-gyp.js:117:19)
[INFO]     at processTicksAndRejections (node:internal/process/task_queues:96:5)
[INFO]     at async ModuleRebuilder.rebuildNodeGypModule (C:\Users\[...]\electronbrowser\src\main\electron\node_modules\electron-rebuild\lib\src\module-rebuilder.js:94:9)
[INFO]     at async ModuleRebuilder.rebuild (C:\Users\[...]\electronbrowser\src\main\electron\node_modules\electron-rebuild\lib\src\module-rebuilder.js:124:14)
[INFO]     at async Rebuilder.rebuildModuleAt (C:\Users\[...]\electronbrowser\src\main\electron\node_modules\electron-rebuild\lib\src\rebuild.js:145:13)
[INFO]     at async Rebuilder.rebuild (C:\Users\[...]\electronbrowser\src\main\electron\node_modules\electron-rebuild\lib\src\rebuild.js:108:17)
[INFO]     at async C:\Users\[...]\electronbrowser\src\main\electron\node_modules\electron-rebuild\lib\src\cli.js:154:9

Folder comparison

Using 0.12.1 Using 0.12.2
image image

Edit 1

Changed setup to make it at least completely runnable on version 0.12.1. This made the issue also less confusing. By now I'm pretty sure that is a bug with node-java.

Activity

  1. DoMyBestFor commented on Dec 9, 2021

    @DoMyBestFor

    How did you solve this problem?

  2. DManstrator commented on Dec 16, 2021

    @DManstrator
    Author

    How did you solve this problem?

    I didn't find a solution for this problem as of now, I'm still hoping for an answer.

  3. jianchang69 commented on Mar 22, 2022

    @jianchang69

    0.12.1

    Hi,
    Would you please give me the node-java v0.12.1 can rebuild in Electron project or Procedure ?
    I can't success to rebuild node-java with electron...
    So many thanks...

    my email: jianchang69@gmail.com

  4. DManstrator commented on Mar 22, 2022

    @DManstrator
    Author

    @jianchang69 You should use npm to get the dependencies. Just pin the version to 0.12.1 in your package.json.

  5. jianchang69 commented on Mar 23, 2022

    @jianchang69

    thank DManstrator,
    I can rebuild v.0.12.1 and electron v.12.2.2. But hopefully still can rebuild with newest electron version ...
    The electron latest version is v.17 with can't rebuild with node-java v.0.12.1..even electron v.14 rebuild fail.

  6. DManstrator commented on Mar 23, 2022

    @DManstrator
    Author

    Yeah, that's exactly the same issue I currently face hence why I opened this issue. I still need to find a new approach to this since this library seems unmaintained. In worst case, I have to re-implement everything in a different language. But for now, it's pretty low on my ToDo list.

  7. ArbifyFun commented on Mar 24, 2022

    @ArbifyFun

    The same problem

  8. ddrigass commented on Apr 27, 2022

    @ddrigass

    The same...

  9. ddrigass commented on Apr 27, 2022

    @ddrigass

    For me solved here: lygstate/node-java #532
    Thank you!

  10. jianchang69 commented on May 10, 2022

    @jianchang69

    hi, ddrigass
    we can rebuild node-java 0.12.2 with electron v18
    thank a lot your information..
    but when java code return byte array type to javascript, it happend error...><

    I doubte here is problem:
    Nan::MaybeLocalv8::Value ab = Nan::Get(v8Buf, Nan::Newv8::String("cause").ToLocalChecked());
    Do you have any idea?
    the "cause" this word should be modified to ?

  11. youlinaa commented on Apr 19, 2023

    @youlinaa

    For me solved here: lygstate/node-java #532 Thank you!

    Thanks, it works at electron 24.1.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions