Closed vad710 closed 10 years ago
Thank you for reporting the issue. I really appreciate you taking the time to do so, it helps us make the plugin better!
I tried running a sample app on iOS and was able to build and run without crashing. However, I was able to reproduce it if I didn't follow the iOS specific build steps you can see here. Did you add the mod_pbjproj.py and PostprocessBuildPlayer_GA.txt files to your Assets/Editor directory? These will add the linked libraries required to run the project in Xcode with the plugin.
Please try it out if you haven't already done so and let me know either way if it helps. Thanks again, your feedback is really important!
I have followed the steps carefuly - if I did not follow the steps the app would not build at all.
Some additional info - it appears like this only happens on the second "LogScreen()" call - the first "LogScreen()" is successful. I have tried both using the EventHitBuilder as well as the string parameter.
Oh - one more thing. I do not have the ".txt" extension in the "PostprocessBuildPlayer_GA" file. I will try putting the ".txt" extension and see if it works.
I have also gone through the process of adding the libraries manually in xcode and see the same behavior :(
The extension on the file did not make a difference. I confirmed that my Prefabs are setup correctly and also tested on the Android version. The Android version seems to be working correctly, so I believe it is something specific to iOS.
I also set the logging to be verbose on the Prefabs, but that did not seem to make a big difference.
Thank you for the additional information and I appreciate you taking the time to follow up. If one of your LogScreen() calls is being sent successfully then it would not be a build error so I wouldn't expect the file extension to change anything, I misunderstood and thought you were having problems building.
'setSampleFrequency' is only called during initialization, which should only occur when the first hit is sent from the app, unless you call Dispose() which will reset the tracker. If you are calling Dispose(), it should reset the tracker and the next hit will call the initialization method with the existing parameters, so I wouldn't expect an exception if it was fine the first time.
I'm trying to think of different possibilities that could cause this issue as I am not able to reproduce it in my environment. Please don't be offended if they are basic questions - just want to rule out all options to get this resolved as fast as possible for you :).
Thanks!
Hi @emmanuellemm ,
I appreciate you following up!
I will try to answer your questions below.
In addition to the GAv3 prefab on the root of the scene hierarchy, I also have an empty game object called "Analytics" which has the following simple code attached:
public class GoogleAnalytics : MonoBehaviour
{
public GoogleAnalyticsV3 GoogleAnalyticsPrefab;
public void Start()
{
this.GoogleAnalyticsPrefab.StartSession();
this.GoogleAnalyticsPrefab.LogScreen("MainMenu");
}
}
I then have the GAv3 object from the scene hierarchy linked to the public GoogleAnalyticsPrefab
object.
I have something very similar in the Second scene. The difference is that I am reusing a script that is attached to the Camera object.
public void Start ()
{
// other code removed for brevity
this.GoogleAnalyticsPrefab.LogScreen("Match");
}
and it looks like it's crashing on the LogScreen call.
Also - I am not doing anything extra with the Dispose method.
I understand that these issues are sometimes hard to reproduce. Please let me know how else I can help you reproduce this issue.
thanks again!
Really appreciate all the information, thanks for your help in getting this sorted :) Using your snippets and a multiple scene project I was able to reproduce the issue so I will investigate a fix.
I have submitted a fix, if you could please try it out when you have time that would be helpful. Please reopen the issue if it does not solve the problem for you.
Hi @emmanuellemm ,
I am happy to hear that you were able to get to the bottom of this issue. I had to work around the issue by only calling LogScreen once in the game. When I get a chance, I will test it out again and let you know.
thank you!
I am getting a crash EXC_BAD_ACCESS when running on my iOS device via xcode. It looks like it is being raised on the "setSampleFrequency" call. I have my SampleFrequency set to 100 - this crash does not appear to happen on Android.