Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Need help building tier 2 android project

Author
Message
wargasmic
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 27th May 2013 19:20 Edited at: 27th May 2013 19:21
I'm up to building in cygwin and getting an error in the log file about missing "windows.h". Would this be due to missing something in the setup or do i need to copy the missing files over to the android template?

I copied windows.h over to the template, which worked but then received the same error for another missing header file.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 27th May 2013 20:14
Where did you get the template you are using (windows.h is NOT used in the Android projects)?

And what version of AppGameKit are you using?

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
wargasmic
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 27th May 2013 22:22 Edited at: 27th May 2013 22:23
Oops, i accidentally overwrote Core.cpp with my own.

However now I'm getting all of these errors. The project compiles fine in vs so there shouldn't be any syntax errors, but this is what i'm getting. Seems to be mostly to do with maps. Is this the problem you mentioned when you tried compiling a project using std::map?

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 27th May 2013 22:40
The version of the c++ compiler that is used by the android-ndk does NOT support maps. This is an annoyance that I encountered early on.

I have not yet found a way around this problem, except to not use std::map.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
wargasmic
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 27th May 2013 23:26
What do you suggest as an alternative?

I'm currently storing agk resources among other things as std::map<std::string, int>.

Arrays don't allow indexing with strings (unless you're using c++11, which I don't know anything about yet)
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 28th May 2013 04:41
I sort of created my own 'hash' class. It isn't as efficient as the real thing, but you hand it a string name and a value and it will return the value if you give it a valid string.

The index_hash.h file (handles both string and integer ids):


The index_hash.cpp file:


Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
wargasmic
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 28th May 2013 21:08
Thanks AncientLady, that might come in handy.

I did a bit of googleing for std::map and and came across this..

http://stackoverflow.com/questions/13856480/stdmap-linker-error-ndk-r8c-with-app-stl-gnustl-static

Apparently he got his project to compile, although I don't know how to (or even if we can) apply the workaround he uses in our projects.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 28th May 2013 21:21
It can't hurt to try adding the following to the Android.mk file (as suggested in the post):


Just make sure to adjust the paths so that they point to the correct place. And you should probably include the armeabi and x86 versions of the lines as well (to be consistent with the APP_ABI setup in the default Application.mk file).

But that fix is for the link stage, not the compile stage.

These bits in the Application.mk file might help (the APP_PLATFORM should match what you have in your project.properties file):


Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
wargasmic
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 28th May 2013 22:36
I'm going to try this now.

What does ~/. represent in the paths above?
wargasmic
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 28th May 2013 23:20
Aha, using this distribution of the NDK seems to have gotten rid of the errors with std::map.

http://www.crystax.net/android/ndk.php

Now I'm just getting these errors. Any idea why?

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 29th May 2013 00:13
Aren't those the same errors you were getting before?

The final error is pretty obvious. Somewhere you define a structure Bomb and in the same file (or ones that include it) you have the Bomb() method. I would expect that your Player class uses the Bomb structure somewhere.

As for the others, it looks like you have issues with how things are declared and how you are using them. Without looking at all the files mentioned (and I am not offering to do a full debug of your project), I can't help you.

Look closely at the error messages and the lines in the files they specify. You should be able to figure out what needs fixing.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
wargasmic
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 29th May 2013 01:08
Yeah, they're the same errors as before minus the std map stuff.

If they're programming errors, wouldn't i get the errors when compiling in vs aswell?
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 29th May 2013 03:35
Quote: "If they're programming errors, wouldn't i get the errors when compiling in vs aswell?"

Not necessarily.

Some of the issue comes down to copy constructors and such. The Android versions versus the Windows versions require/use different assumptions.

I got rid of similar issues by making sure to supply copy constructors and to use 'const' and '&' in the copy constructors for some of my classes. Even though I didn't explicitly use 'x = y' type things, I was adding class objects to std::list and std::vector things and they required copy constructors.


Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
wargasmic
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 29th May 2013 17:56
ARRRRRRRRRRRRRRRRRRRRRGH.

Ive fixed these errors but now i have undefined references everywhere. WTF
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 29th May 2013 18:00
Did you make sure to include all of your source files in the Android.mk file between Core.cpp and template.cpp?

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
wargasmic
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 29th May 2013 21:17
I did not

Seems like i have got a successful build now, but trying to run or export the project in eclipse says "your project has compilation errors, fix those first".

After building, the log file is empty. Here is the build output...



Console output in eclipse when I import the project



Is this the problem? Is it just a matter of getting the correct files via the sdk manager?

Cheers!
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 29th May 2013 21:30 Edited at: 29th May 2013 21:31
Did you use the Android SDK Manager to install Android 3.2 (that is API 13, which is what android-13 refers to)?

EDIT: Yes, to your final question. I didn't see that when I posted my first response.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
wargasmic
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 29th May 2013 21:42
It's still giving me Unable to resolve target 'android-13' even though I've installed API 13.

I've also installed updated that were asked for by Eclipse as well as manually checked for updates.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 29th May 2013 21:46
Do all the projects imported into Eclipse have the same target in the the default.properties and project.properties files?

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
wargasmic
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 29th May 2013 21:55
no, default is 9 and project is 13.

Should I set them both to 9 or both to 13?

I do want to support as many android versions as possible.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 29th May 2013 22:00
Since we have been told that 13 is the new preferred default, try changing the 9 to 13 and then rebuild and refresh and see what happens.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
wargasmic
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 29th May 2013 22:12
I checked the Application.mk file too. that was also set to 9 so changed it to 13 aswell.

STILL Unable to resolve target 'android-13'
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 29th May 2013 22:35
Did you try:
1. Exit Eclipse
2. Clean project
3. Build project
4. Restart Eclipse
5. Run project

Failing that, maybe:
1. Delete all projects in Eclipse (do NOT delete sources)
2. Exit Eclipse
3. Clean and build projects
4. Start Eclipse
5. Import Facebook
6. Import your project
7. Run project

Other than that, I don't know.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
wargasmic
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 29th May 2013 23:33
I'm done for today so ill try all those suggestions tomorrow.

Thanks for all the help AncientLady
wargasmic
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 30th May 2013 16:16
As soon as I import facebook i get the same error.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 30th May 2013 16:28
About the only thing I can suggest is to delete the facebook project from Eclipse. Then delete everything in the facebook directory and copy everything back in from your <windows>/<agk>/IDE/apps/facebook directory and re-import into Eclipse.

It's not impossible, I suppose, that something in the Eclipse build of the facebook directory got scrambled.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
wargasmic
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 30th May 2013 16:39
Oh my word.

I have noticed i must have the android sdk installed twice. I just ran the sdk manager directly from the sdk path set in eclipse and it shows as having nothing installed that I previously installed. I'm installing the files again, lets hope this fixes it
wargasmic
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 30th May 2013 16:48
That's that fixed. Now in eclipse when building the project i get this lot....

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 30th May 2013 17:12
Warnings can be ignored. I cannot tell if there are errors in that set.

But I suspect the 'cannot be resolved' lines are errors.

Did you do all the 'mycompany' edits as suggested in the 'About v10812, do you know when it will be the official version?' section in the AGK Wiki Templates page?

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 30th May 2013 18:32 Edited at: 30th May 2013 18:33
Quote: "I checked the Application.mk file too. that was also set to 9 so changed it to 13 aswell."


I don't recommend that, NDK is separate from eclipse and if you are using NDK 6b then it only goes up to android-9, others may support higher versions but I've not tested those.

The new minimum supported SDK version of Android in eclipse is API 10 and your manifest file should have the line
wargasmic
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 30th May 2013 19:15 Edited at: 30th May 2013 19:15
Getting there. 2 errors left!!



Dunno what/where the build path is and what it needs to be set to.
wargasmic
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 17th Jun 2013 03:51
I've put this off for a while as I couldn't figure it out, so still haven't managed to build my game for android. Any idea how to fix the 2 errors above?
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 17th Jun 2013 05:02
Open the properties of your project, click on 'Java Build Path', click on 'Libraries' tab, click on 'Add External JARs..', select 'android-support-v4.jar', click on 'Ok', then click on 'Ok' again, restart Eclipse.

I posted this solution to that problem last month.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
wargasmic
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 18th Jun 2013 18:53 Edited at: 18th Jun 2013 18:57
Thanks again AL but yet again this has resulted in more errors. ARRRRRGH!

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 18th Jun 2013 19:47
I cannot find the two files listed in your errors anywhere in any of my Android setups for any of the AppGameKit versions.

Are BillingService.java and ResponseHandler.java something you added or found or what?

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
wargasmic
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 18th Jun 2013 20:01
No I Didn't add them (i wouldn't even know how).

I did install everything under the extras section in the sdk manager which has stuff for billing and ads etc, but i only did this after seeing the above errors and thinking maybe i needed the billing package so i installed the extra stuff.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 18th Jun 2013 21:27
Your error message is listing specific files in your project path. Do they exist?

Assuming you updated to v10813, did you start with a clean directory or copy things over into an old one?

There are enough changes in each update that it is much better to start with a clean directory.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
wargasmic
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 19th Jun 2013 06:31 Edited at: 19th Jun 2013 06:32
Man this is getting aggravating now, I've upgraded to beta 13 and started fresh just to be greeted with 40 errors now, still containing the previous ones.



Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 19th Jun 2013 15:52
By fresh, I assume you mean a completely new <androidpath>/AGK/IDE/... set copied from a clean install of the <windowspath>/AGK/IDE/...

And, did you install v10813 in Windows in a new directory or over your previous AppGameKit install?

Did you clean and build your project before importing it into Eclipse?

Did you start with fresh Eclipse projects?

(I have to ask questions to get a feel for what is happening, if I can.)

The issue with 'Session' sort of looks like something needs to be cleaned and rebuilt. And remembering to refreshing the project in Eclipse after that.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
wargasmic
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 21st Jun 2013 17:45
1. Yes

2. Yes

3. Yes

4. Yes

I have just reverted back to windows 7 (good riddance windows 8) and I'm reinstalling everything now so will have a nice clean slate.

Will see how this goes and come back.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 21st Jun 2013 19:28
Quote: "good riddance windows 8"

I am not touching Windows 8 with a ten foot pole. Some people love it. But I haven't heard of any serious coders or developers who even like it.

Microsoft has a bad habit of making versions of Windows that don't play well with established stuff (even their own).

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
wargasmic
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 21st Jun 2013 22:37
I've had Windows 8 since launch, and tbh I regretted installing it right away but thought I'd give it a chance. It seemed to be fine for most things but for me it was the addition of Metroll and the removal of tried and tested features like, oh, i dunno....the start menu?

I ended up installing classic shell to get the start menu back, but it was kind of buggy, and Metroll still kept invading my screen randomly like it was forcing itself down my throat.

When I reverted back to Window 7 yesterday it was like a breath of fresh air and it felt like I was home

I seriously hope MS is rethinking its direction with Windows. The tiny amount of people who have upgraded from win 7 to win 8 (I think it's less than 2%) should be a clue that they did wrong.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 21st Jun 2013 23:12 Edited at: 21st Jun 2013 23:23
MS was trying to get in on the tablet explosion. But they tried to make a tablet environment than fit on a desktop. Bad idea.

Some of what MS does is great. But they do an awful lot of experimenting on us when trying new things.

If they want to be in tablets, do a table OS and leave the desktop stuff alone.

I almost laughed myself silly one day in Best Buy. They had a couple of Windows 8 tablets set up in a prominent place out front. And one of them was displaying the blue screen of death.



I have been working with Windows since the very first. And on Apple's windows before that (yup, Apple had computers with Windows-like interface before MS and both stole from an earlier interface system).

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master

Attachments

Login to view attachments
wargasmic
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 22nd Jun 2013 03:30 Edited at: 22nd Jun 2013 03:42
Yeah I totally agree. If anything they should be trying to push tablets towards desktops, not the other way round.

But you see it a lot these days in just about every product you can think of. Rather than advancing things slowly and making people get used to it, they're trying to go back a few steps to cater for the "casual user", which from a marketing perspective makes sense because it is the largest market but at the end of the day certain things shouldn't be aimed at the "casual user".

Science predicts that humans will continue to get smarter. How? When you have everything you could possibly want with such ease, how is the human race going to develop?

Edit: And when I saw BSOD on win8 for the first time, I literally cringed. Using a smiley on an error screen! ERROR

Whats next, an image of Rick Astley or the Trolololol guy (god rest his soul)?

Edit 2: I just thought of a catchphrase MS could use for win8. "It's smiley and tiley"
wargasmic
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 22nd Jun 2013 03:54 Edited at: 22nd Jun 2013 03:54
On another note which is the whole point of this topic, lol.

I managed to build my game for android. Exported an apk, installed it on my device.

But all is not good. I hear a little bit of sound, then the app seems to minimize to the home screen. I can bring up the active apps and select it again and it does the same. Tiny bit of sound from the music track then back to home screen. It always seems to be sound from the very first part of the track too.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 22nd Jun 2013 05:41
How does your app behave in Windows?

And through the Player?

You aren't, by any chance, running afoul of wrong cases between actual file names and the ones used in your code?

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
wargasmic
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 22nd Jun 2013 19:16
Quote: "How does your app behave in Windows?"


When I build and run within visual studio, everything seems fine but if I manually run the compiled exe I seem to get all kinds of problems. Program stops responding randomly. The weirdest one is after a few seconds of firing bullets, the bullets become invisible and have no velocity (the ship is still firing but I don't see the bullets, but enemies still crash into the bullets when the collide with the spot I fired at)

Quote: "And through the Player?"


I'm not sure what you mean. Tier 2 doesn't use the player..??

Quote: "You aren't, by any chance, running afoul of wrong cases between actual file names and the ones used in your code?"


Not that I can see.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 22nd Jun 2013 20:53
Quote: "I'm not sure what you mean. Tier 2 doesn't use the player..??"

Sorry, dumb question. I am just so used to asking this when someone is having difficulty with Android.

If it isn't running properly when started by the .exe built in VS, then there is something basically wrong with the project and that needs to be fixed before you try to get it working in another platform.

Not having seen any of your code, I cannot tell what the issue(s) is/are.

But, the symptoms sort of sound like you are repeatedly creating sprites and not necessarily cleaning up properly. Maybe recreating a sprite during every app::Loop() execution and overloading the system.

I just went over this thread from the top.

You cannot use std::map, period, if you want to port to Android or iOS. I did get something using std::map to compile and link with crystax, but it would not work on the actual device. I tested compiling/linking/building with the standard android ndk and with crystax on my working project. It worked fine with the standard ndk and would not run with crystax.

So, no C++11 stuff can be used until the standard ndk catches up and the AppGameKit libraries are built with it. And don't use crystax.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
wargasmic
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 22nd Jun 2013 21:53
Shame about the maps

As for sprites, I don't use any sprites at all, only objects.

My objects are only created by my mesh component class which is basically a component that can be attached to a game object, then you add objects to the component.

I'm only adding meshes/objects when a game object is created and all components are cleared when the game object is destroyed.

When the mesh component is cleared, all objects/meshes added to that component are deleted.

The bullets are created in the player update function which is nested in app loop and are destroyed when they are outside the play area which means the objects should be deleted when they are destroyed.

Is there any function to get the current object count? That could help me determine whether all the objects are being destroyed as they should be.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 22nd Jun 2013 22:02
Okay, this is a 3D project then.

I haven't started playing with the AppGameKit 3D stuff, so I don't know what kind of issues you might run into with that.

But, are you creating the bullets in the player update function every time app::Loop() is called?

If one is created every app::Loop(), and not just in response to the user doing something, then you are creating lots and lots, depending on your SyncRate setting.

What are you using to keep track of each bullet created?

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master

Login to post a reply

Server time is: 2024-11-24 16:07:52
Your offset time is: 2024-11-24 16:07:52