My PhoneGap app won't compile correctly

My app won’t compile correctly (.Myhelloworld-debug.apk) despite every
trial and modifications I have done. Here is the link to the app:
http://mrnk.hostoi.com/ and here it is on web:
http://mrnk.hostoi.com/www , please I will like to know what I can do to
arrange this app and get going.

Welcome to the forums. I hope we can help you.

My car won’t start this morning. Here is a photograph of the car. Please help me get it to run again.
THAT is akin to your request here. “won’t compile” is very, very vague. If you can provide some of the output (error messages) someone here may be able to help you.
If you read the compiler output it also provides very good clues as to where in the code to look for problems. In many cases it is simply a syntax error (you have an extra character the compiler did not expect or omitted a semicolon where it DID expect one).

Please be a bit more specific and there are many here who would be happy to help you.

2 Likes

Perhaps if you also explain what your app is supposed to do. The web version certainly does something…

Exactly, it is a simple hello world with a button that when clicked, an alert simply says welcome to PGB hello world. The compiled output comes in the format .xyz-debug.apk which does not run on my phone. I provided the link to the zipped folder and the working web view so that someone could point to me the problem. The scripts are so basic so as to permit easy debugging. Still waiting, thanks for the comments so far

@ParkinT, I am new to phonegap build, reason why I provided the links. I am sorry, really do not know how I could be more specific. The output file appears in the format .xyz-debug.apk and all I know is it does not work

To be clear.

You have been successful following all of the steps one to four.
The default Hello PhoneGap application works.

You are now having problems with step five.

Which did you use?

http://docs.phonegap.com/getting-started/5-going-further/

Step 5: Going Further

Build, Package and Distribute for Production

This getting started workflow is meant for beginning mobile application development with PhoneGap in the quickest and simplest manner. At some point you will want to move out of the sandbox environment and into a more advanced environment suitable for building, packaging and distributing your mobile application.

There are two choices available for building and packaging your applications:

  1. Build and package locally using the PhoneGap CLI
  2. Use PhoneGap Build cloud service for simplifying the build and app packaging process
1 Like

@Mittineague, I had that output file from the phonegap cloud build service.

Hmm. For near $10 a month their support forum was no help?

I was just thinking.

Maybe you are using the Free plan?

If so, note that you can not “upload plugins”

My guess is the builder considers stats.hosting24.com/count.php to be a plugin and fails without letting you know the reason.

Try it without that and see how it goes.

I only hosted on that link for people to try it out and even download it, the app is offline (all the libraries are downloaded and run from the directories) and it was submitted as a zip on PGB.
I have included the JSON and .apk debug scripts on the web page http://mrnk.hostoi.com/ for better understanding, I really hope it’s not going to compromise any security issues.

Hmmmm.

BUILD SUCCESSFUL
Total time: 10 seconds
Built the following apk(s):
/project/bin/.Myhelloworld-debug.apk

What am I not seeing? Seems if it didn’t compile correctly it wouldn’t give a Successful

2 Likes

I really don’t get it to. The app does not run on my mobile. I just included the .apk file too on http://mrnk.hostoi.com/ .
Thanks

Well, there is a difference between “not compiling” and “not doing what I want it to”

The first suggests something that was required was done incorrectly.
The second that options were not done correctly.

Don’t feel bad, it isn’t entirely your fault. It is very common that tutorials fail to adequately explain things.

As long as you have tried and gotten the default “Hello PhoneGap” application to work, you have made it past the first hurdle. You have your set-up installed and configured correctly.

Of course the next logical step is to try putting together your own app, using the default as a guide, but changing a few things.

This is where tutorials can be less helpful. Because of all the possible things others might want to do, it is impossible for a tutorial to cover all of the “MUST be done”, “CAN be done” and “MUST NOT be done” combinations.

Learning these comes from trying things out and seeing what others have done by reading their code and support forum posts etc.

What you have tried is still very simple, so I can understand your frustration about it not working. eg. your HTML

<!DOCTYPE html>
<html>
	<head>
		<meta charset='utf-8'/>
		<title>PGB hello world</title>
		<link src='assets/css/bootstrap.min.css' rel='stylesheet' />
	<head>
<body>
	
	<button id='button' class='btn btn-primary'>
		<h1>Hello world!</h1>
	</button>
	<script src='assets/js/jquery.min.js'></script>
	<script src='assets/js/index.js'></script>
</body>
</html>

and your Javascript

var app = {

    clicked: function(){
		 $('#button').on('click', function(){
			alert("You are welcome to PGB hello world!");
		 });
	},

    initialize: function() {
        $('document').ready(this.clicked());
    }

};

app.initialize();

If you go to http://docs.phonegap.com/tutorials/develop/hello-world-explained/

Hello World Explained

Now that we’ve installed the tools necessary to create and preview the default PhoneGap application, it’s worth stopping to take a moment to look through the default application and point out some important details.

The key word here is “important”. Though maybe not, it suggests that those things are MUSTS.

It looks like your files have none of those.

@Mittineague, Sorry for the runaround, I really did not mean it. Thanks so much for going through all the files, I really do appreciate the efforts, like truely. I just went through the meta tags and did include them in the head section of index.html, and included the reference for the cordova. js file, but until then the .Myhelloworld-debug.apk is still compiled.

1 Like

Would you mind rewording the above sentence?.. maybe in step-by-step chronological order?.
“I just went through … and did include … and included … but until thenis still compiled” does not compute.

Confused

1 Like

@ronpat, Sorry for any ambiguity. I just modified the index.html page and ran the zipped folder through PGB and I have ended up with the same .Myhelloworld-debug.apk which is not okay.
No modifications were done with the other files, here is the index.html file:

<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'/>
<meta name="format-detection" content="telephone=no" />
<meta name="msapplication-tap-highlight" content="no" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<title>PGB hello world</title>
<link src='assets/css/bootstrap.min.css' rel='stylesheet' />
<head>
<body>
    
<button id='button' class='btn btn-primary'>    
<h1>Hello world!</h1>
</button>
<script type="text/javascript" src="cordova.js"></script>    
<script src='assets/js/jquery.min.js'></script>
<script src='assets/js/index.js'></script>
</body>
</html>

Try:
<link http=‘assets/css/bootstrap.min.css’ rel=‘stylesheet’ />

I think the link format is:

<link rel="stylesheet" type="text/css" href="assets/css/bootstrap.min.css">

type=“text/css” may not be needed… not sure. It’s a carryover from HTML 4, Not sure if it is necessary in HTML5.

1 Like

It doesn’t seem to be.

Thanks for the comments, but sorry, the web app still does not work