0

My app runs completely fine in the browser but when I run it on my device, I get this error:

 0     758771   log      deviceready has not fired after 5 seconds.
 1     758797   log      Channel not fired: onDOMContentLoaded
 2     758932   error    Uncaught TypeError: Cannot read property '6' of undefined, http://(ip address)/build/js/Reflect.js, Line: 894

Here's the code in Reflect.js, but this is something provided by Ionic's packaging, I can't change the code so I don't know how to fix this.

function CreateUUID() {
    var data = GenRandomBytes(UUID_SIZE);
    // mark as random - RFC 4122 ยง 4.4
    data[6] = data[6] & 0x4f | 0x40;
    data[8] = data[8] & 0xbf | 0x80;
    var result = "";
    for (var offset = 0; offset < UUID_SIZE; ++offset) {
        var byte = data[offset];
        if (offset === 4 || offset === 6 || offset === 8)
            result += "-";
            if (byte < 16)
                result += "0";
            result += byte.toString(16).toLowerCase();
        }
    return result;
}

It seems GenRandomBytes() is returning null here. Can someone help please?

Danny Buonocore
  • 3,731
  • 3
  • 24
  • 46
adambargh
  • 119
  • 1
  • 5
  • 11
  • Have you looked at the Javascript console with remote debugging either on [Chrome](https://developers.google.com/web/tools/chrome-devtools/debug/remote-debugging/remote-debugging?hl=en) for Android or Safari for [iOS](https://blog.idrsolutions.com/2015/02/remote-debugging-ios-safari-on-os-x-windows-and-linux/)? โ€“ Lightbeard Aug 22 '16 at 20:39
  • @Lightbeard I tried the chrome//:inspect and the device is showing up but I can't interact with it. There's usually an "inspect" button under the device name at the chrome://inspect link. But not in my case, is there something I'm doing wrong there also? Sorry I'm new to Ionic and Android โ€“ adambargh Aug 23 '16 at 00:11

1 Answers1

0

It is sometimes the case that errors like that in Android Studio's logcat can be ignored. I have a feeling you will find the real problem if you can see it from Chrome's web tools.

Debugging Android from Chrome can be kind of finicky, take a look at: Chrome's remote debugging (USB debugging) not working for Samsung Galaxy S3 running android 4.3

Specifically:

I was developing for android using Android Studio. So I had almost everything installed but Chrome didn't show me the list of devices. The solution was to find adb.exe which was already on my PC, and to run adb.exe devices. That did the trick for me. โ€“ Saeed Neamati

Once you have your app inspected and viewable in web tools, I recommend pressing Ctrl+R to refresh and view any Javascript/HTML/CSS errors captured during page load.

Community
  • 1
  • 1
Lightbeard
  • 4,011
  • 10
  • 49
  • 59