Sitata / titanium-google-analytics

Google analytics for Appcelerator Titanium
MIT License
92 stars 47 forks source link

Trackevent make crash my App on iOS 9 #54

Closed univers3 closed 8 years ago

univers3 commented 8 years ago

Anyone have the same problem or have a solution for that?

The strange thing is that only when it's called in some views, not all. Trackscreen work perfectly.

This is the crash report: Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libobjc.A.dylib 0x05ccd4da objc_msgSend + 26 1 libobjc.A.dylib 0x05cd0059 -[NSObject performSelector:withObject:] + 70 2 it.biotiful.bioapp 0x00743cf4 __42-[AnalyticsGoogleTrackerProxy trackEvent:]_block_invoke + 51 (AnalyticsGoogleTrackerProxy.m:77)

soumyakantikar commented 8 years ago

Can you tell us as to when are you calling the trackEvent method? Have you tried moving the call and see if that works. Like making it the first line of code on the JS

On Sunday, February 28, 2016, univers3 notifications@github.com wrote:

Anyone have the same problem or have a solution for that?

The strange thing is that only when it's called in some views, not all. TrackEvent work perfectly.

This is the crash report: Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libobjc.A.dylib 0x05ccd4da objc_msgSend + 26 1 libobjc.A.dylib 0x05cd0059 -[NSObject performSelector:withObject:] + 70 2 it.biotiful.bioapp 0x00743cf4 __42-[AnalyticsGoogleTrackerProxy trackEvent:]_block_invoke + 51 (AnalyticsGoogleTrackerProxy.m:77)

— Reply to this email directly or view it on GitHub https://github.com/Sitata/titanium-google-analytics/issues/54.

univers3 commented 8 years ago

In my first attempts I was trying to call them in the last part of the code. Now I tried in the beginning with the same result (Crashed):

var GoogleA = require("analytics.google");
    var track = GoogleA.getTracker("UA-XXXXXXXX-X");

    track.trackEvent({
        category: "Settings",
        action: "Opened"
    });
    track.trackScreen({
        screenName: "Settings"
    });

It's a simple setting page with only 7 buttons. I tried to encapsulate the track event into a setTimeout after 1000ms. The situation get better and the crashes go to the 100% of the times to 60% circa. It's very strange

soumyakantikar commented 8 years ago

If you create a sample application with call to the module only, no other code, is it working fine after you build? What is the SDK version you are using to build the application. 5.2.0?

On Sunday, February 28, 2016, univers3 notifications@github.com wrote:

In my first attempts I was trying to call them in the last part of the code. Now I tried in the beginning with the same result (Crashed):

var GoogleA = require("analytics.google"); var track = GoogleA.getTracker("UA-XXXXXXXX-X");

track.trackEvent({
    category: "Settings",
    action: "Opened"
});
track.trackScreen({
    screenName: "Settings"
});

— Reply to this email directly or view it on GitHub https://github.com/Sitata/titanium-google-analytics/issues/54#issuecomment-189921294 .

univers3 commented 8 years ago

Yep, 5.2.0.GA

soumyakantikar commented 8 years ago

Ok. Can you check with a sample application

On Sunday, February 28, 2016, univers3 notifications@github.com wrote:

Yep, 5.2.0.GA

— Reply to this email directly or view it on GitHub https://github.com/Sitata/titanium-google-analytics/issues/54#issuecomment-189921673 .

univers3 commented 8 years ago

The sample app worked flawlessly. The problem was in my app: a double init of the module. (GetTracker function) In Android that double call will raise no errors, but in iOS will result in crashes, at least in my case.

Thank you @soumyakantikar for your support and patience.

soumyakantikar commented 8 years ago

Great news, that it is resolved. Code strong.

On Monday, February 29, 2016, univers3 notifications@github.com wrote:

The sample app worked flawlessly. The problem was in my app: a double init of the module. (GetTracker function) In Android that double call will raise no errors, but in iOS will result in crashes, at least in my case.

Thank you @soumyakantikar https://github.com/soumyakantikar for your support and patience.

— Reply to this email directly or view it on GitHub https://github.com/Sitata/titanium-google-analytics/issues/54#issuecomment-190458521 .