Repository for docs and issues. If you need help, please file an issue here. Public conversations are better for open source projects than private email.
Because I do not have a personal Mac, and NREL doesn't allow the installation of the Android SDK on lab machines, I'm looking to build on my person Linux machine
When running setup for iOS development on my Mac, this issue does not occur.
Linux distributions I have tested so far:
NixOS (Hardware)
Fedora 38 (Running on hardware)
Ubuntu 23 (Running in a VM via Gnome Boxes)
The correct version of openjdk, nmv, and android-studio have been installed.
Android SDK was installed per Android's instructions, not the e-mission script. To the best of my understanding, the issue doesn't involve the SDK -- but the more context, the better!
The Issue
Following our build instructions for android (link), the build process fails when running bash setup/setup_android_native.sh. When running this script, it freezes at this point:
# .... More output above
added 76 packages, removed 256 packages, changed 1 package, and audited 2435 packages in 30s
177 packages are looking for funding
run `npm fund` for details
54 vulnerabilities (2 low, 21 moderate, 17 high, 14 critical)
To address issues that do not require attention, run:
npm audit fix
To address all issues possible (including breaking changes), run:
npm audit fix --force
Some issues need review, and may require choosing
a different dependency.
Run `npm audit` for details.
hack to make the local cordova fail on error
Going into the setup scripts (link), each test of this script seems to freeze upon the execution of npx cordova prepare. Indeed, after testing, it seems that any variation of npx cordova freezes at this point in the Linux install. This appears to be unusual behavior, as this command is run in both iOS and Android setup - and the MacOS builds I have done have not had this issue. Furthermore, running any version of npx cordova on MacOS executes as expected.
Working Theories
So far, I know that:
This issue occurs on Linux Machines, but not MacOS
This is likely not an issue with the Android build specifically, as both the package install and error occur within setup_shared_native.sh
The issue appears to be with npx cordova, because:
npx cordova executes as normal on MacOS, and
Executing cordova via NPM has frozen across Linux distrobutions
Running other variations of the npx command on Linux appear to work as intended
Doing a fresh install of and execution of cordova (e.x., going to a new directory and running npm install cordova@11.1.0; npx cordova prepare on Linux runs as intended.
This seems to suggest that the error occurs somewhere within our setup process
Given the information above, all signs seem to point to an error with how we install the cordova packages: specifically, cordova@11.1.0 Running npm list | grep cordova after the freeze occurs results in the following outputs:
At a glance (and when cross referenced with the same command, run on MacOS), nothing seems missing or out of place.
Finally, I have found very little information on this issue online. Most of the threads I've found relate to either npx freezing (linklink). Multiple threads have suggested running npm cache clear --force , but this has not helped remedy the issue. This thread seems to suggest I'm not the first person to have this issue: since our NPM version is past v5, so I'm not sure how relevant this is.
Given all of the research above, and my current research in issue #1053 , my first thought was that the Linux install must be missing a linux-based dependency that cordova relies on.
I'm not entirely satisfied with this answer for a few reasons; first, it leaves me with few lines of inquiry. Second, the issue in 1053 is an issue with the browser version of the app. That is, I would be somewhat surprised if the android build of the app had dependencies that needed to match the build OS. As of writing, I'm re-reading some of our our internal docs (issues such as #958), in case I missed any past work on this issue.
All of this to say, I'll keep this thread updated as I find more information! If anyone has experience building on a non-MacOS device, feel free to throw in your two cents on this thread -- any advice is greatly appreciated!
Background
e-mission-phone
to an Android.apk
.The Issue
Following our build instructions for android (link), the build process fails when running
bash setup/setup_android_native.sh
. When running this script, it freezes at this point:Going into the setup scripts (link), each test of this script seems to freeze upon the execution of
npx cordova prepare
. Indeed, after testing, it seems that any variation ofnpx cordova
freezes at this point in the Linux install. This appears to be unusual behavior, as this command is run in both iOS and Android setup - and the MacOS builds I have done have not had this issue. Furthermore, running any version ofnpx cordova
on MacOS executes as expected.Working Theories
So far, I know that:
setup_shared_native.sh
npx cordova
, because:npx cordova
executes as normal on MacOS, andnpx
command on Linux appear to work as intendednpm install cordova@11.1.0; npx cordova prepare
on Linux runs as intended.Given the information above, all signs seem to point to an error with how we install the
cordova
packages: specifically,cordova@11.1.0
Runningnpm list | grep cordova
after the freeze occurs results in the following outputs:At a glance (and when cross referenced with the same command, run on MacOS), nothing seems missing or out of place.
Finally, I have found very little information on this issue online. Most of the threads I've found relate to either npx freezing (link link). Multiple threads have suggested running
npm cache clear --force
, but this has not helped remedy the issue. This thread seems to suggest I'm not the first person to have this issue: since our NPM version is past v5, so I'm not sure how relevant this is.Given all of the research above, and my current research in issue #1053 , my first thought was that the Linux install must be missing a linux-based dependency that
cordova
relies on.I'm not entirely satisfied with this answer for a few reasons; first, it leaves me with few lines of inquiry. Second, the issue in 1053 is an issue with the browser version of the app. That is, I would be somewhat surprised if the android build of the app had dependencies that needed to match the build OS. As of writing, I'm re-reading some of our our internal docs (issues such as #958), in case I missed any past work on this issue.
All of this to say, I'll keep this thread updated as I find more information! If anyone has experience building on a non-MacOS device, feel free to throw in your two cents on this thread -- any advice is greatly appreciated!