Troubleshooting Common Issues in Oracle JET Hybrid Mobile Applications
When deploying your hybrid mobile application with Oracle JET, the most common issues can be due to run-time exceptions, mis-configuration, and networking problems.
Issue 1: Failed ojet Build
When working behind a corporate firewall, you might receive messages saying that your build failed failed after issuing a ojet build
or ojet0- serve
command.
If you’re behind a corporate firewall, verify that you’ve configured the npm proxy settings correctly.
Issue 2: Unable to Launch the Hybrid Mobile App in the Mobile OS Emulator
You can successfully build your hybrid mobile application, but find out later that you are not able to do test it in a mobile OS emulator.
For example, the console logs might show that the application hangs in a permanent “waiting” state:
Running "serve" task
Running "customServe" task
Invoking cordova serve
Static file server running on: http://localhost:8090 (CTRL + C to shut down)Invoking cordova run
Starting watch
Running "watch" task
Waiting...
This issue is common when executing the ojet serve
command before starting the emulator. Even though ojet
tries to start the emulator, some commands might not execute while the emulator is starting. To avoid this issue:
-
Always start the emulator first.
-
Don’t specify a destination parameter for the
ojet serve
command. The application will deploy to the open/default emulator. -
Once the emulator has started, execute the
ojet serve
command. -
Ensure you have executed
ojet build
before aojet serve
command.
Issue 3: Running Into a CORS Issue While Debugging
Sometimes, your application can’t connect to any mobile middleware, like Oracle Mobile Hub or perform authentication while using an emulator live debugger.
To prevent this from happening, use the ojet
--no-livereload parameter to disable the live reload feature when deploying your application:
ojet serve --platform=android --no-livereload=true
Issue 4: LiveReload Doesn’t Work on a Physical Device
Not being able to serve to a device with LiveReload enabled is a known issue.
To circumvent this problem, develop the app contents within a browser using the --browser
flag:
ojet serve android --browser
Then, use LiveReload in the emulator. Note that this process is slower on an emulator than on an actual device:
ojet serve
To test using a physical device, you will have to disable LiveReload:
ojet serve android --device --no-livereload
Note:
To see a list of all options available to theojet serve
command, enter ojet help serve
.