0

I'm using phonegap to build an enyo app. My program works completely fine in chrome and it also works in the ripple emulator service for blackberry. My problem is, when I use the .ipk build for webOS and the .apk build for android, I get the same error:

Not allowed to load local resource: file:///usr/palm/enyo.js
Uncaught ReferenceError: enyo is not defined, package.js:1
Uncaught ReferenceError: enyo is not defined, tests/package.js:1
Uncaught ReferenceError: enyo is not defined, index.html:10

This leads me to think that it must be a problem in my index file, which is:

<!DOCTYPE html>
<html>
<head>
    <title>Enyo Bootplate App</title>
    <link rel="shortcut icon" href="assets/favicon.ico">
    <!-- -->
    <meta http-equiv="Content-Type" content="text/html; charset=utf8">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <!-- look this up for blackberry ad error -->
    <!-- css -->
    <link href="build/enyo.css" rel="stylesheet">
    <link href="build/app.css" rel="stylesheet">
    <!-- js -->
    <script src="enyo/enyo.js"></script>
    <script src="phonegap.js"></script>
    <script src="source/mobile.js" type="text/javascript" ></script>
    <script type="text/javascript" src="http://www.blackberry.com/app_includes/asdk/adBanner.js"></script>
    <script src="source/gameBanks.js" type="text/javascript"></script>
    <script src='https://cdn.firebase.com/v0/firebase-auth-client.js' type='text/javascript'></script>
    <script src="https://static.firebase.com/v0/firebase.js" ></script>
    <script src="build/enyo.js" ></script>
    <script src="build/app.js" onerror="alert('No application build found, redirecting to debug.html.'), location='debug.html';"></script> 
</head>
<body class="enyo-unselectable">
    <script>
        new App().write();
    </script>
</body>
 </html>

The weird thing is that index.html:10 is a comment (the css comment) so I have no idea how an error could possibly be there. Anyone have any idea why I would be getting this error? Or perhaps what "file:///usr/palm/enyo.js" is? That's not a file in my package.

Also, after messing around with it a bit, adding lines at the top of index.html doesn't change where the error is (index.html:10) so is it possible that the error is referring to some other form of index.html? I went through my commits at github and at no point in time was there anything other than comments at line index.html:10.

Update: When using any other service to package the apps such as palm-run, it updates my code properly. My builds downloaded off of phonegap are not working properly. Is there any reason why phonegap's build specifically would cause this problem?

Jaghancement
  • 151
  • 1
  • 5
  • 15

2 Answers2

1

Finally solved this problem, phonegap was somehow finding the wrong index.html files. When I downloaded the enyo bootplate, there were some index.html's deep within the api and tools folders. After I removed those, it worked properly.

Jaghancement
  • 151
  • 1
  • 5
  • 15
0

Strange...not sure what is causing that, but I do see you are trying to load enyo.js twice. I doubt that that is the issue, but it is something you want to clear up.

If you start with the base bootplate project with no changes, does it work to package an ipk/apk?

Webby Vanderhack
  • 889
  • 7
  • 13
  • Ah thanks, I did that trying to fix the problem and forgot to remove it. Anyways, I tried using just the bootplate project and while it did a little better than my app (the icon actually loaded in the emulator), I ran into another error: "Not allowed to load local resource: `file:///media/cryptofs/apps/usr/palm/applications/enyo/source/package.js"` – Jaghancement Jan 25 '13 at 16:40
  • Stranger still...so that path that's failing tells me it's looking in the wrong place for your dirs starting at enyo. There should be an app.id-looking directory there somewhere, like `file:///media/cryptofs/apps/usr/palm/applications/com.sugardave.myapp/enyo/source/package.js` It's possible palm-package is not doing its job correctly? Did you include an appconfig.json file to build the right app ID and such? – Webby Vanderhack Jan 25 '13 at 19:18
  • Yes, I did include an appconfig.json. I also have a config.xml and an androidmanifest.xml though, would having all of those together possible screw it up? I'll check. Either way, it also might be worth noting that I'm using the phonegap build service to build the app. So I'm building and downloading it from there, then just installing the .ipk/.apk files. I tried using palm-run and it gave me the same errors though. – Jaghancement Jan 25 '13 at 23:43
  • Actually, after trying again, palm-run actually doesn't give that same error, it gives a different one and it seems to make it further along than just using the phonegap build service. So maybe the problem is with phonegap? I don't know – Jaghancement Jan 26 '13 at 07:08