I have a drupalgap app running on google chrome with ripple but I can't get an app running on my device using adobe's phone gap build site.

I keep getting a theme not found error.

I've checked all the usual suspects, settings,js, config.html.

Any help would be appreciated

CommentFileSizeAuthor
#6 Screen Shot 2014-04-01 at 8.08.14 AM.png354.53 KBexecutrex

Comments

executrex’s picture

Project: Drupal core » DrupalGap
Version: 7.26 » 7.x-1.5
Component: other » Ripple Emulator in Chrome
tyler.frankenstein’s picture

Version: 7.x-1.5 » 7.x-1.x-dev
Status: Active » Needs work
Related issues: +#2176475: drupalgap_theme_load - Failed to load theme! The theme's JS file does not exist

Thanks for reporting this. This error has been elusive, and tough to find a resolution for it. Maybe PhoneGap Build is the common place this is happening for people.

I haven't yet tried PhoneGap build so I'm not sure.

Check out the related issue attached to this issue for other info.

I have always just used Eclipse (or a terminal window) for Android compilation, and xCode (or a terminal window) for iOS compilation. I would recommend trying those approaches to compile your app(s). There is documentation at http://www.drupalgap.org/install

If anyone has successfully used PhoneGap build, please report your experience here.

executrex’s picture

I read the related issue before, but couldn't see anything really relevant to this as I'm just using the plain vanilla drupalgap system. It's the easystreet3 theme that it can't find.

I actually encountered the same problem with an IOS platform build from the latest version of cordova and Xcode on my mac, after following all the instructions to the best of my ability. I couldn't get the android platform build to work, so then I tried chrome, and voila - Hello world in the simulator

There's a pretty good video tutorial here about phone gap build as well as straightforward instructions on the site.

According to the instructions, all you have to do is add a config.xml file with some info about the project and include (or replace the cordova js) command in index.html with their phonegap

BTW you can sign up for a free one month phone gap build account.

Thanks for you input.

executrex’s picture

A possible clue:

i get this message from adobe on my phone gap build account when I upload my app folder

"This app isn't using the latest version of PhoneGap. We recommend upgrading to 3.3.0",

When I built my platform for iOS on my mac and couldn't get it working it was also the latest version of phone gap

So is it possible that perhaps it has something to do with the versions of phone gap?

tyler.frankenstein’s picture

PhoneGap 3.4.0 has been out for a while, so I don't think it would have anything to do with that. I'm not sure why Build would report 3.3.0.

I'll check out PhoneGap Build sometime, but unlikely soon.

Please post the exact error message you see.

In the mean time, I'd recommend looking out this line:

https://github.com/signalpoint/DrupalGap/blob/7.x-1.x-alpha/src/drupalga...

And the subsequent function call to drupalgap_file_exists():

https://github.com/signalpoint/DrupalGap/blob/7.x-1.x-alpha/src/drupalga...

Maybe there is something about that function's implementation that PGB doesn't like.

Be sure to set Drupal.settings.debug to true in settings.js and make sure console.log() is enabled wherever you are compling your app.

executrex’s picture

StatusFileSize
new354.53 KB

I just tried it again on an iOS build on my mac and got the same message "drupalgap-load-theme - no theme specified in settings.js"

I took a screen shot of the index.html and error message (file attached)

tyler.frankenstein’s picture

Stop by #drupal-drupalgap on IRC for further support.

executrex’s picture

I got it working on my tablet with the following process.

I suspected my config.xml file, so after looking around, downloaded a config.xml generator from here .

I copied that config.xml file into my app

Then I added the required phonegap.js command to my index.html, uploaded it to phone gap build, scanned the barcode to download the app, clicked on the downloaded file, and waited. First I got the white screen, but after a delay, something else started working and my app appeared.

The index.html file looked like this:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <meta name="format-detection" content="telephone=no" />
        <!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
        <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=medium-dpi" />
        <title>DrupalGap</title>
        <link rel="stylesheet" href="jquery.mobile-1.4.0.min.css" />
         <script src="phonegap.js"></script>
        <script src="jquery-1.9.1.min.js"></script>
        <script src="jquery.mobile-1.4.0.min.js"></script>
        <script type="text/javascript" charset="utf-8" src="jdrupal-7.x-1.0-rc2.min.js"></script>
        <script type="text/javascript" charset="utf-8" src="bin/drupalgap.js"></script>
        <script type="text/javascript" charset="utf-8" src="app/settings.js"></script>
    </head>
    <body>
        <script type="text/javascript">
          drupalgap_onload();
        </script>
    </body>
</html>
tyler.frankenstein’s picture

Status: Needs work » Closed (works as designed)

Thanks. That brings up an important point, that everyone should make sure they have a config.xml file for their App if things are acting strange.

Also, it appears you had to use phonegap.js instead of cordova.js in your index.html file, something for everyone to watch out for.

anybody’s picture

For general information: I have the same problem using phonegap build and Phonegap version 3.5.0.
IMPORTANT: The problem exists in the real app for me, generated in phonegap build. NOT in ripple!
The strange thing is that Android works absolutely fine. The problem only happens on Windows Phone.

Error message: "drupalgap_theme_load - Failed to load theme! The theme's JS file does not exist: app/themes/mytheme/mytheme.js"

tyler.frankenstein’s picture

@Anybody, I haven't ever tried compiling on a Windows phone, so I'm not sure what is going on. I would guess that the file system path for Windows is a bit different, so it isn't able to find the theme file(s) properly.

tyler.frankenstein’s picture

@Anybody, check out this related issue: https://github.com/signalpoint/DrupalGap/issues/291

debain’s picture

Here is my experience:
First i installed cordova, phonegap, crosswalk and drupalgap on my linux machine. Compiling apk's for android was no problem.
Now the next step for me is to create the ios an windows version. As i have no mac-computer, i uploaded the code to phonegap build service (cloud, 50MB free) - no luck - build was finished but drupalgap hangs on the splash screen/logo (android version).
(For information: to get rid of the error message shown in #4 you have to go to settings and set the correct version (hard to find: in the app setting scroll down and set "Configuration"). Or you have to create a correct config.xml as written in #8.)

I took a windows 7 laptop and installed the desktop developer app (http://app.phonegap.com/). It does work as expected but drupalgap does not run on first load. As soon as i change something in a file (Desktop App does automatic refresh) drupalgap does show!
I think there is the same problem when uploading it to phonegap.
Every othere app i tried is working. Only drupalgap does hang on the "splash" (drupalgap logo) on first/initial load.

A mac-computer is no alternative as long as i don't know what exactly the problem is with drupalgap (or phonegap - i don't know).

I tried so much - settimeout, other load order, changed lot of code - no luck.
If somebody has an idea i could help testing. (For me it looks like it is not a big issue - but maybe i am wrong)

anybody’s picture

@debain: I think the problem might be within the path... do you get the same path error "drupalgap_theme_load - Failed to load theme! The theme's JS file does not exist: app/themes/mytheme/mytheme.js" as described by me in #10?

Can you try to find out hat the application tries to load so if there is perhaps simply a wrong path provided?

tyler.frankenstein’s picture

@debain, also confirm the cordova.js file is being included in your index.html file. Without it, the app will typically hang on the splash screen.

anybody’s picture

@tyler.frankenstein: For my case I can confirm that. Below you can find my index.html file, if you see any mistakes. As said above it works well for Android.

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <meta name="format-detection" content="telephone=no" />
    <!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
    <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=medium-dpi" />
    <title>Example App</title>
    <link rel="stylesheet" href="app/themes/mh/mh.css" />
    <link rel="stylesheet" href="app/themes/mh/jquery.mobile.icons.min.css" />
    <link rel="stylesheet" href="jquery.mobile.structure-1.4.2.min.css" />
    <!--<link rel="stylesheet" href="jquery.mobile-1.4.2.min.css" />-->
    <script type="text/javascript">
      $(document).bind("mobileinit", function() {
        $.support.cors = true;
        $.mobile.allowCrossDomainPages = true;
      });
    </script>
    <script src="jquery-1.9.1.min.js"></script>
    <script src="jquery.mobile-1.4.2.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="jdrupal-7.x-1.0.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="bin/drupalgap.js"></script>
    <script type="text/javascript" charset="utf-8" src="app/settings.js"></script>

    <script type="text/javascript" charset="utf-8" src="app/modules/custom/mh_haendler/libs/photoswipe/lib/klass.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="app/modules/custom/mh_haendler/libs/photoswipe/lib/hammer.js"></script>
    <script type="text/javascript" charset="utf-8" src="app/modules/custom/mh_haendler/libs/photoswipe/lib/jquery.hammer.js"></script>
    <script type="text/javascript" charset="utf-8" src="app/modules/custom/mh_haendler/libs/photoswipe/lib/jquery.specialevent.hammer.js"></script>
    <script type="text/javascript" charset="utf-8" src="app/modules/custom/mh_haendler/libs/photoswipe/lib/jquery.transit.js"></script>
    <script type="text/javascript" charset="utf-8" src="app/modules/custom/mh_haendler/libs/photoswipe/code.photoswipe-3.0.5.js"></script>

    <link rel="stylesheet" href="drupalgap.css" />
    <link rel="stylesheet" href="app/modules/custom/mh_haendler/libs/photoswipe/photoswipe.css" />
  </head>
  <body>
    <script type="text/javascript" src="cordova.js"></script>
    <script type="text/javascript">
      drupalgap_onload();
    </script>
  </body>
</html>
tyler.frankenstein’s picture

@Anybody, interesting. Thanks for sharing. So it appears the Windows app struggles to dynamically load file(s), so they all must be included via the index.html file. Very good to know.

debain’s picture

Thanks for the fast reply!
@Anybody: no, i don't get this message (on android phone) and I have only an android phone to test (didn't test it on win-phone/ios). I cannot debug that. How have you done that? inside a browser(console)? I defenitly have to find a method to debug.

@tyler: i tried both - with an without phonegap.js/cordova.js.
See here http://docs.build.phonegap.com/en_US/introduction_getting_started.md.html
Once you've included the necessary assets, remove the phonegap.js (cordova.js) as Build will automatically inject it during compile time.

For the Desktop App it is correct: drupalgap only works when i insert the cordova.js. (But not on first load - as soon as i change something in a file it reloads and displays drupalgap start-page)

debain’s picture

@Anybody: If you hava a working example zip file i can upload to phonegap cloud - please share.

To reproduce what i have done.
- Installed Desktop App on windows
- Create a new project
- Overwrite files with drupalgap
- Setting the settings.site_path and settings.mode
- include cordova.js in the index.html

Am I missing something?

tyler.frankenstein’s picture

Status: Closed (works as designed) » Postponed (maintainer needs more info)

You'll need to install many PhoneGap/Cordova plugins if you haven't already. See here: http://drupalgap.org/node/193 - please confirm.

debain’s picture

Yes i have done. (http://tylerfrankenstein.com/code/build-mobile-app-geo-locate-content-dr...) . If you say it should work i belive you. I will do that again.
Again, on my linux box i had no problems - final apk runs without problems. Only uploading it to phonegap-cloud (and the Desktop App) does not work. (Title of this issue!)
I have to make more tests. Will report back the results as soon as i can.

debain’s picture

Ah, i see no plugins when uploading it to phonegap adobe. i will check config.xml.
Thanks!

debain’s picture

Hey! It is working! Thank you all!
Here is the problem:

PhoneGap Build's only requirement for your application structure is that the config.xml and index.html is in the top level of your application. Other than that
you can structure your application as dictated by your workflows.

So i had to copy the config.xml file to the www directory!

EDIT: It should look like this:
Only local images are allowed.

tyler.frankenstein’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)