Has anyone been able to get Flurry working in Unity?
Its simple enough in a standalone project but i keep getting EXC_BAD_INSTRUCTION or SIGSEGV errors when initialising:
[FlurryAPI startSession:@“KEYCODE”];
Their docs say call this in applicationDidFinishLaunching( … ) but that causing EXC_BAD_INSTRUCTION, i tried calling in Unity’s overwrite of this method too, similiar crash.
I tried writing a C++ script and calling after my game has initialised but this generates a nice seg fault.
Anyone have any ideas? I’ve emailed their tech support but it seems to be very slow.
Ive got a problem with Flurry too. After importing it in XCode, I am getting EXC_BAD_ACCESS Errors as long as I keep the check-box on the right of the *.a-File enabled (I cant remember the exact file name and I dont have access to the project right now, sorry). When I disable this check-box everything compiles again. It also doesnt matter if I import the header or call any methods. Just importing the lib to the project causes the error.
I cant find out how to get the line of code thats causing the error. I played around with the NSZombie-Settings and the debugger, but I cant locate any kind of stack trace in the gdb-console…
After looking into it the problem im having with the flurry plugin seems to be only on one project, installed it onto another project and it worked first time no hassle. so must be something other than the plugin that is triggered when having the plugin installed. atleast that project isnt as important as the other
I’ve just come across this thread. Did anyone figure out the Flurry crash as I have the same problem.
Basically the game runs fine but when I try to integrate Flurry in Xcode (not using the Prime 31 plug-in), the game crashed. Changing the build settings to include the Armv7 architecture libraries fixes it, but this adds 10MB+ to the project :s
I’ve got it running fine a previous project just using Armv6.
Could it be a library that I’m missing? Any help is super super super appreciated.
Hey Nikkicny.
No, I’ve not had any luck with this either :s Im having the same issue as you.
The only way I found to resolve the it is to turn on the ‘armv7 + armv6’ option in build settings but it makes the .app file huge.
I tried it with a Pro trial version (using only armv6) and it works if you use the stripping option and remove the byte code. Unfortunately I only have basic version for iOS.
Sorry I can’t help here, please let me know if you come across a solution.
Make a C# file called AppControllerBinding.cs in the plugins folder in Unity and add the code as followed:
using UnityEngine;
using System.Collections;
using System.Runtime.InteropServices;
// All Objective-C exposed methods should be bound here
public class AppControllerBinding
{
[DllImport("__Internal")]
private static extern void _Flurry_trackEvent(string eventName);
public static void Flurry_trackEvent(string eventNameIN)
{
// Call plugin only when running on real device
if( Application.platform == RuntimePlatform.IPhonePlayer ) _Flurry_trackEvent(eventNameIN);
}
}
Add the Flurry_trackEvent() function to the bottom on the AppController.mm file inside Xcode as follows (after the @end statement):
extern "C"
{
void _Flurry_trackEvent(const char* eventName)
{
NSString* s = [NSString stringWithUTF8String: eventName];
[FlurryAPI logEvent:s];
printf_console("_Flurry_trackEvent() called in Appcontroller.mm in Xcode.\n");
}
}
When you want to use the TrackEvent function inside Unity just make a call like this:
For Prime31 flurry plugin, You need to make sure your complier LLVM GCC 4, the reason why your old project might have problem is that the default compiler is not set to LLVM, all new xcode 4.0 default compiler are set to LLVM GCC 4, therefore when you created the new project, you didn’t have to change the compiler.