wcchoi/libunrar-js

How to use this on android web browser??error??

Closed this issue · 7 comments

error info
Invalid asm.js: Invalid member of stdlib
no native wasm Memory in use
Assertion failed: no binaryen method succeeded.

It is impossible for me to help troubleshooting your problem with only this little information. What were you trying to do that leads to the above error messages? What is the Android version you're using? How are you using the library? Do you have any source code?

If you want to see how to use libunrar.js please read worker.js, index.html for usage example.

Also there is no WebAssembly build for this library, only the compiled asm.js code. If you want to build from scratch starting from the C/C++ source code, you have to read about Emscripten

I still don't understand how you encounter the error. If you see the error when trying to build a Cordova App , please ask in the Cordova repo/forum.

This is the first time information

Invalid asm.js: Invalid member of stdlib
libunrar.js:15 
pre-main prep time: 6 ms
libunrar.js:15 
no native wasm Memory in use
libunrar.js:15 
Assertion failed: no binaryen method succeeded.
libunrar.js:15 
Assertion failed: no binaryen method succeeded.
app.6071ea807ad5f994bdbc.js:1 Uncaught abort("Assertion failed: no binaryen method succeeded."). Build with -s ASSERTIONS=1 for more info.

What I would like to know is what commands, or what code you run that leads to the error, not just the error message itself. I have never seen similar error on my side and I don't have access to your computer or source code, so how can I know what is happening, let alone trying to help?

Did you run some commands in the command line then see the error? If so what are the commands? What are files?

Or did you see the error message in the Console when visiting a page containing the library on your Phone? If so what is the page's source code?

etc...

PLEASE provide information(steps, code, setting, environment, etc) that will make ME see the exact same error ON MY SIDE. Pasting some message YOU see without information is useless for discussion. Otherwise I think I could not provide any further help.

Also, I don't understand why WASM will come up in the error message, because the code in this repository is NOT for WASM.

If you want you can use Chinese to describe the situation.

simple.zip

This is my code, reproduce the error, how should I handle it?

The reason is that in your source code index.html you also include a file called js/opencv.js, which is also a Emscripten compiled js file and that causes collision with libunrar.js, probably due to both files trying to define the variable name called Module (my guess). If you remove the <script src="js/opencv.js" ... in index.html you will see the error goes away.

There maybe ways you could make libunrar.js and opencv.js co-exist, note I just briefly googled for that, never tried the methods myself so not sure if they will work:

Since the libunrar.js from this repo is the compiled output, you probably can't change that. If the opencv.js is built by yourself, you can try the above links to re-name the module to something else. If you don't know how to build that js file, I couldn't help.

As this issue is very specific to your own usage and not related to the problem of this library, I am closing it now.