Unable to update app: Error posting to URL
While using the Eclipse IDE and the Google App Engine Plugin for Eclipse, you select Deploy to App Engine and get an error similar to:
The App Id you selected, spragucm-spragucm, does not exist. Go to http://cloud.google.com/console to view existing App Ids or create a new App Id.
Unable to update app: Error posting to URL: https://appengine.google.com/api/appversion/create?app_id=spragucm-spragucm&version=1&
404 Not Found
This application does not exist (app_id=u’spragucm-spragucm’).
Problem 1: Typo
The most obvious problem is that you may have mistyped the projectId. To solve this:
- Sign into your developers account on console.developers.google.com
- You should see the DashBoard for all projects. If not, select the dropdown at the top of the screen -> Select Manage All Projects
- Locate the Project Name -> Copy the Project Id that is to the right of the project
- Return to Eclipse -> Right-click on the project -> Google -> App Engine Settings -> Paste the Project Id from above into the Application Id field under Deployment
- Verify that the project has updated the Project Id by selecting the war folder -> WEB-INF -> Open appengine-web.xml -> locate the application block and it will have the Project Id if everything updated
Problem 2: No Project Id
- You are not using a projectId from Google App Engine
- You are not signed into your Google account in Eclipse
- You are signed in to a Google account in Eclipse but it is not the account that holds the project with the projectId that you are using
- You mistyped the projectId
Since this wasn’t the Oops! could not connect to localhost page, I deduced that another app is running on port 8888. I didn’t have any clue what it could be or how to stop it so I Googled it and here’s the resolution:
- Locate the Command Prompt shortcut on your Windows PC (default is C:\Users\YourName\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\System Tools)
- Right-Click on the shortcut -> Run As Administrator -> Select OK in the prompt
- Type netstat -> hit Enter
- You should be shown all active connection including port numbers. See if the port is being used
- If the port is being used type netstat -bano -> hit Enter
- A very detailed list of the active connections will now be shown including that applications using them.
- Note that localhost:8888 will be listed as 127.0.0.1:8888, and then find the application that is using that port.
- Now open the Task Manager (ctrl + alt + delete) -> locate the application -> select End Task
- Open a web browser -> enter http://localhost:8888 as the web address -> you should see the default Oops! could not connect to localhost page
- Try to run your local webpage server again
Note: If you prefer a GUI, which I certainly do, then download the following instead of using the Command Prompt: https://technet.microsoft.com/en-us/sysinternals/bb897437.aspx
If your WordPress blog has a lot of images then you may be running out of the free quota that WordPress gives you by default. Rather than buying a premium account for the current rate of $99 a year, just link your images to an image in a public folder on your Google Drive account. This will require a smidge of HTML coding, but very little and anybody can do it so long as you follow the steps below.
Setup a Public Folder in Your Google Drive Folder
- Locate your Google Drive folder on your computer (if you haven’t installed it then please Google it) (e.g. C:\Users\MyName\Google Drive\)
- Add a subfolder called WordPress (anything will work actually)
- Right-click on the new folder -> Google Drive -> Share -> Advanced Settings
- Under Who has access? -> Change the option to Public
- Under Access -> Can View -> Anyone (no sign-in required)
- Now place whatever images you want into this folder
- Right-click on the image -> Google Drive -> View On Web
- When the image is showing online, right-click the image-> Copy Image Location.
- This image location will be used below.
Start using the images in WordPress
- Stop using WordPress t
- Click on the HTML Tab next to the Visual Tab
- Locate the position where the image should go and past the following
<img class=” src=”image_location_from_previous_step”/>
- Publish the post.
That’s it! You now have expanded your WordPress drive size by many gigs using free space from a Google Drive account.
Basically the same as a single servlet but expanding to multiple to demystify a little bit more – make developer change a few things to highlight what each part is doing
If you were following the steps in Hello World with one servlet, then you won’t get a complaint about a server already running on the localhost. If you missed the step explaining how to stop the server then follow the instruction at (site address needed) and stop the previous app. Then try and run the app again
If you go to http://localhost:8888 and there is no webpage here are the possible problems:
- Not running the server-so start running it. Here’s how to check if it’s running
- justSomeIndexName.html isn’t added to the web.xml file under <welcome-file>
- you can see justSomeIndex.html but a servlet’s page isn’t found when clicking on the link in the main page. The problem is likely that the servlet isn’t correctly linked in web.xml or isn’t named correctly or the linke in justSomeIndexName.html isn’t the same as in web.xml
- Install the Google Product (more info)
- Register for a Google AppEngine Account(more info)
- Create a new project and copy the Project Id (e.g. mine is sturdy-mechanic-94316)
- if you can’t see it, select your project -> Overview -> Top of page should say “Project ID” ->Copy this id
- In Eclipse, right-click in Package Explorer -> New -> Web Application Project (has a blue g+ icon)
- Enter project Name: GAE-HelloWorld
- Enter package: com.spragucm.gae_helloworld
- Un-select “Use Google Web Toolkit” checkbox
- Check “Use Google App Engine”
- Under the “Identifiers for Google App Engine” section -> Select “Use Api Id” -> Paste the project id from above
- Under “Sample Code” -> Select “Generate Project Sample Code”
- Select “Finish”
To test the project locally:
- Right-click the new project inside of “Package Explorer” -> “Run as” -> select “Run Configurations”
- Scroll down to “Web Applications” -> Select “GAE-HelloWorld” -> select “Run”
- To see that it is running, open any internet browser -> enter “http://localhost:8888” as the web address ->hit enter
- Your application will be shown
To test a deployed project
- Right-click the project inside of “Package Explorer” -> “Google” -> “Deploy to App Engine”
- Project Name: GAE-HelloWorld
- Under “Select the front an backends to deploy -> Select “Frontend”
- Select “Launch app in browser after successful deploy”
- Select “Deploy”
- After everything successfully builds, you can go to http://1-dot-yourAppId.appspot.com/ (e.g. my app Id was sturdy-mechanic-94316 and the web address was http://1-dot-sturdy-mechanic-94316.appspot.com/)
- When you are done, STOP THE SERVER or else http://localhost:8888 will permanently have this app running on it. To stop the server follow the instructions at
That’s it, a hello world that’s up and running 🙂
Ok, things are at least working now, so let’s discuss what is going on…
- All of this is on the App Engine side, nothing is on Android yet
- Your project is running on App Engine. It is available to ANYBODY, on any device.
- There is absolutely no authentication (yet)
- src -> src.com.gae_helloworld -> GAE_HelloWorldServlet.java
- This is a servlet that simply creates a text page that displays hello world when GAE_HelloWorld is click on the http://1-dot-yourAppId.appspot.com
- Indicate that text will be used: resp.setContentType(“text/plain”);
- Indicate the message to be printed on the page: resp.getWriter().println(“Hello, world”);
- war -> index.html
- This is the webpage that is shown at http://1-dot-yourAppId.appspot.com
- When a user clicks the GAE_HelloWorld link in the main page they are brought to a simple page that says “Hello, world”. This is accomplished using the following line of html: GAE_HelloWorld
- war -> WEB-INF -> web.xml
- This file basically describes what servlets are used and what they map to. For example, href = “gae_helloworld” gets clicked so go to the GAE_HelloWorld servlet which is in turn has its actions outlined by the com.spragucm.gae_helloworld.GAE_HelloWorldServlet class
- Notice the is listed as index.html which simply means that index.html should be displayed as webpage when users navigate to http://1-dot-yourAppId.appspot.com/
Helpful? Then DOWNLOAD and RATE my app!
Promoting your app…
If you already have a WordPress blog and are willing to spend a few dollars, it’s super easy to promote your app through your blog. You should note that it’s against WordPress’s Terms and Conditions to advertise on a WordPress blog, but, you should be fine since you aren’t advertising…you are cross promoting your apps simply by showing your brand on pages that you provided (my personal opinion here).
I’ll explain how I did this with my app Panes (like the cross promotion there!)
- Create a Blog about your app so that you can help others understand how to code some of the stuff you coded. If it’s well done, developers will visit your blog, read your crap, steal your code, but will also be nice enough to click on your app link
- Call to action…ensure that your icon isn’t distracting and then have a call to action like “Helpful? Then download and RATE my app!
- Create a Google Site for your app
- Stick a reasonably sized image in the Google Site and reference it here
- If you want a monster size, 300px by 300px icon image straight from Google Play, then have the image link point to Google Play. If you are more reasonable then point to a smaller image on your Google Site
- The href should point to Google Play and not to the website for the app. This is because you already have the audience so don’t add a barrier between them and a download
- If you want to make this more useful, ie not have to change the href on every site every time you update the promo product, then get a GoDaddy account, register the cheapest website, and forward to the correct Url.
- NOTE: I tried the following and they worked in the WYSIWYG editor while editing the blog post but they didn’t work on the published page – no clue why
Helpful? Then DOWNLOAD and RATE my app!