GameAnalytics iOS Extension

gameanalytics

  • *
  • Posts: 7
Hello everyone!

We are working on bringing a GameAnalytics (https://gameanalytics.com/) engine extension to Stencyl. We have followed the guides on how to include third party iOS frameworks yet when running the game with the extension integrated we see the following error:

Code: [Select]
2018-05-01 13:42:36,997 INFO  [Thread-13] stencyl.sw.util.StreamGobbler: [haxelib] Undefined symbols for architecture armv7:
2018-05-01 13:42:36,998 INFO  [Thread-13] stencyl.sw.util.StreamGobbler: [haxelib]   "_GameAnalytics_register_prims", referenced from:
2018-05-01 13:42:36,998 INFO  [Thread-13] stencyl.sw.util.StreamGobbler: [haxelib]       _main in Main.o
2018-05-01 13:42:36,998 INFO  [Thread-13] stencyl.sw.util.StreamGobbler: [haxelib]   "_gameanalytics_register_prims", referenced from:
2018-05-01 13:42:36,998 INFO  [Thread-13] stencyl.sw.util.StreamGobbler: [haxelib]       _main in Main.o
2018-05-01 13:42:36,998 INFO  [Thread-13] stencyl.sw.util.StreamGobbler: [haxelib] ld: symbol(s) not found for architecture armv7
2018-05-01 13:42:36,999 INFO  [Thread-13] stencyl.sw.util.StreamGobbler: [haxelib] clang: error: linker command failed with exit code 1 (use -v to see invocation)
2018-05-01 13:42:37,015 INFO  [Thread-13] stencyl.sw.util.StreamGobbler: [haxelib] ** BUILD FAILED **
...

It seems that the same behaviour has been reported by an other user attempting to create an extension for Vungle but unfortunately, no pointers are actually given on how to solve the issue. Read more about his post here: http://community.stencyl.com/index.php?topic=40222.15

This is how our include.nmml file looks like at this stage:
Code: [Select]
<?xml version="1.0" encoding="utf-8"?>
<project>
<section if="ios">
<ndll name="GameAnalytics"/>
<dependency path="frameworks/GameAnalytics.framework"/>
            <dependency name="AdSupport.framework"/>
<dependency name="SystemConfiguration.framework"/>
<dependency name="z"/>
            <dependency name="sqlite3"/>
</section>

<classpath name="" />
<ndll name="gameanalytics" if="ios" />
<java path="project/android" />
</project>

What are we doing wrong?  :)

mdotedot

  • Posts: 1654
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

gameanalytics

  • *
  • Posts: 7
Thanks for the reply!

It is imperative to use our native libraries (on iOS, Android and so on) in order to make sure that any changes we add to our SDKs can be easily deployed to all the game engines supported. The hx-game-analytics seems to be an extension written from scratch and there's not much we can use from it.

designpeg

  • *
  • Posts: 731
This would be great. I'd definitely use this plugin.

mdotedot

  • Posts: 1654
Changed a whole bunch of things.

Mainly due to this post:
"
jgranick commented on Jun 20, 2013
Ah, got it.

The iOS project template expects the NDLL name, plus "_register_prims"

Then that means <ndll name="TestExtension" /> will expect "TestExtension_register_prims" in the binary.
We can either change the extension template to use the extension name (without lowercase) for register prims, or
perhaps we should default the output file name to lowercase? That way, it will be "testextension.iphoneos.a" and should work properly.
"

Since the error indicates that it searching for both the uppercase and lowercase register_prims.

Also the name of the extension can conflict with the ndll so I changed that as well.

Maybe the most important thing was that the namespace didn't had a main in the ExternalInterface.cpp

Once that was done the otool could find the _gamea_register_prims in the archive:
* otool -tvf libgamea.iphoneos.a | grep prims
_gamea_register_prims

So if you could use test that ExternalInterface thing first.
Code: [Select]

void initGA(value gameKey, value secretKey)
{
        initializeWithGameKey(val_string(gameKey), val_string(secretKey));
}
DEFINE_PRIM(initGA, 2);


// gamea is the namespace I've used
extern "C" void gamea_main()
{
}
DEFINE_ENTRY_POINT(gamea_main);

extern "C" int gamea_register_prims()
{
    return 0;
}



If that fails you can have my version and inspect the extension for all the differences ....
There was a space in the Resources directory which I made a symbolic link for among other crazy stuff that was changed like namespaces,
functionnames and mixing stuff from previous extensions by m.e. so it is truely a mess now.

I've got it to run to my iPhone 5s running ios 10.3


Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.