-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android Release Build Fails #144
Comments
Anybody know how to set NODE_DEBUG environment variable for android app so I can investigate this issue further? |
Wanted to let you know that we identified that this issue occurs only with devices running Android 5.0.x (API level 21), but not on 5.1.x (API level 22). However, we were not able to identify the root cause nor find a workaround to make it work on all devices. |
I have a device (Alcatel Pixi 3 4.5) that fails on Android 5.1 but on other devices Nexus 4 (5.1.1), Asus TF101 (4.4.4) and Vexia Zippers XL (4.2.2) work OK with the following compilation procedure: NOTE: After trying many different builds the problem focuses on some devices and V8 engine compilation with Release Builds (Android debug builds works), If I compile with SM engine everything is OK. |
OK so I think I found a fix for this issue ;-) Ths fix is in the main jxcore source, in the file /src/node.js. See my commit here: The problem was that in the release builds the function process.cwd() was returning an empty string and in the debug builds the function was returning '/system/bin/'. If process.cwd() is empty the path.resolve call does not return an absolute path for the module which means it is interpreted as a native module which results in the error occurring. I was not able to figure out why process.cwd() fails in the release builds and not in the debug builds. The above fix makes my app work fine now but there may be a better general solution. |
@blissland With your fix now works on my device with this issue. |
When building a signed release version of my app it fails when attempting to load the main file:
jxcore('app.js').loadMainFile()
The error message reported is:
No such native module /data/data/my.app.name/files/www/jxcore/app.js
The debug version of the app works fine.
I found what I believe is the same issue reported in the Thali Project:
thaliproject/Thali_CordovaPlugin#594
I am using version 0.1.1 of the plugin.
UPDATE
After more investigation here are a few more clues:
1/ The signed release app does sometimes start without errors. So maybe looking at a timing/threading issue.
2/ When the app fails the fs extension functions defined in jxcore_cordova.js (existssync, readfilesync) are not even invoked to try to read the app.js. So maybe the problem is somewhere in the main jxcore code rather than the cordova part?
3/ The message "no such native module" seems to be for core node.js modules. There seems to be no attempt made to load app.js
The text was updated successfully, but these errors were encountered: