Connection to the server was unsuccessful

We’ve had an app on the Google Play Store for a while now but recently some users are reporting that the app won’t open without an Internet connection. There is nothing in the app that requires an Internet connection so I don’t know where to track this bug down. Does not happen on iOS devices, only on the Android.

The error is they are reporting is “Connection to the server was unsuccessful file://android_asset/www/index.html”.

Any suggestions as to where I can locate this Internet request?

Thanks

EDIT:
Nearest I can tell by looking at the main html file for the app is a remote script call in the header tag to fontawesome.com:
<script src="https://use.fontawesome.com/530b34dcfd.js"></script>

I’m assuming this may be the problem but is there way to load this source file locally so it’s not written in the header tag as a remote source?

Have you tried making a test version, then connecting the Chrome Remote Debugger to see if messages are appearing in the console?

The Chrome Remote Debugger sees the HTC ONE M8 fine when the actual Chrome browser is opened on the device. But when I run the app (compiled with Phonegap Build), the debugger changes to “No browsers detected.” Have never gotten the Remote debugger working with an AppStudio app using Phonegap Build.

What I do see when running the app via AppStudio’s “Start in Desktop Browser” when clicking the Sources tab is “use.fontawesome.com” with a cloud icon.

The error only seems to be happening on Android devices with no Internet connection when launching the app.

Are you using a debug build?

If you want a Debug Build, you need to clear the key to the right of the Android icon at the bottom and change it to “No key selected”. (On the PhoneGap Build site)

Ok, I generated a Debug Build and ran the Remote Debugger. All looked fine except for the initial “Could not find cordova.js script tag. Plugin loading may fail.” message.

Next, I closed the app, turned on Airplane Mode so there is no Internet connection, then started the app again, Boom…
"Could not find cordova.js script tag. Plugin loading may fail."
Failed to load resource: net::ERR_INTERNET_DISCONNECTED use.fontawesome.com/530b34dcfd.js:1

Looks like the remote request for fontawesome is the culprit?

Agreed. Are you using Bootstrap icons in your app?

Yes, I use them for button icons. Is there a way to load this source file locally so it’s not written in the header tag as a remote source?

I’m still using AppStudio 6 but in AppStudio 7, are the open-iconic script or icons called remotely as well?

The open-iconic icons are stored locally - the library is a lot smaller than font-awesome.

Thanks. Then open-iconic is the way to go.

If I port the app to AppStudio 7, is there a way to migrate the Bootstrap 3 controls to Bootstrap 4 without replacing every identical control? The app uses several buttons, inputs, grids and columns, and Media controls.

Per your AppStudio 7 notes, I don’t want to mix the two Bootstrap versions.

That’s going to be a bit of work.

How many icons are you using?

Around 6 or 8 icons at most. Not worth the weight or connection issue with fontawesome.com so I think I’ll just use some tiny local images instead.

That’s what I was thinking too. :slight_smile:

SOLVED the fontawesome requirement.

I cleared all instances of the “Icon” property but still saw the call for "<script src="https://use.fontawesome.com/530b34dcfd.js"></script> in the head tag after launching the app. It turns out that the Bootstrap Slider control needs (or at least calls for) fontawesome. Once that control is removed, the ’use.fontawesome...' script is removed from the head tag.

Also read that using font-awesome actually adds 1.5 to 2 seconds to the load time.

Just need to find an alternative to the slider control.