cancel
Showing results for 
Search instead for 
Did you mean: 

Application Error: The connection to server was unsuccessful file:///android_asset/www/index.html

former_member618906
Discoverer
0 Kudos

My application is an offline application built using SMP Kapsel plugin and runs on Cordova. App is available for android and iOS platforms. App works fine on iOS. All the sapui5 libraries are hosted locally.

Issue is happening only with new installations. People who already have the app installed see no issues using the app. We havent released any new version since December last year.

The strangest part is that this problem suddenly happened to all my android users since past 2 weeks for no reason at all. The same build that has been working for weeks suddenly got this error on every android device who reinstalled the app.

1. Launching the app on android gives an error even before the splash screen appears. "An error occurred in sap.ui.core.js (at Line # 174). Uncaught Error: failed to load 'sap/f/library-preload.js' from ./resources/sap/f/library-preload.js: 0 - NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'file:///android_asset/www/resources/sap/f/library-preload.js'.) "

2. If you wait on this error screen for like 10-15 secs another error pops-up “Application Error: The connection to server was unsuccessful file:///android_asset/www/index.html”. See logs below.

3. We dont understand why is the app trying to fetch sap/f/library-preload.js. We are not at all using the sap/f/ components in our application. If all our libraries are hosted locally then why there is a warning for Synchronous XMLHttpRequest ![1](https://user-images.githubusercontent.com/36221744/61040744-d144c600-a3ee-11e9-9781-a97504178a95.png) in the console. See logs attached below.

4. Chrome 73 has introduced some stricter CORS/CORB policy. Could this be affecting us ? What is the solution to handle this error ? [Chrome 73] https://medium.com/aviabird/handling-cross-origin-fetches-in-chrome-extensions-for-chrome-73-98a0940... https://www.chromium.org/Home/chromium-security/extension-content-script-fetches

5. I uninstalled the updates to Chrome on my android device and my app started working fine. We tested this behaviour on 3 devices - Samsung, POCO F1, Nokia on chrome version 68 & 71. Both worked fine. But when I update to latest version 75 of Chrome, application doesnt load.

6. Details:

SAPUI5 version:
SAPUI5 version: 1.44.11
Chrome version : 75
Device : Android 8+
Cordova: 8+

Attachment:
1.png
2.png
sqlerror1.jpg
sqlerror2.jpg
sqlerror3.jpg
sqlerror4.jpg
device-logs.txt

Accepted Solutions (0)

Answers (1)

Answers (1)

sainithesh21
Active Participant
0 Kudos

Hi Aarti,

I have came across this error couple of times during Offline App development.

For The connection to server was unsuccessful file:///android_asset/www/index.html

Make sure you connected to strong network when you launch the app.

Reference Link : https://stackoverflow.com/questions/12319809/application-error-the-connection-to-the-server-was-unsu...

If you are loading the UI5 lib from local make you have all libraries in the resource folder. Try once loading using CDN.

Check once whether you defined sap.f in the any of the views and controllers or component.