Git Product home page Git Product logo

titanium-google-analytics's Introduction

Google Analytics Module

Connects to Google Analytics for app event tracking in a Titanium Appcelerator Application. The 2.x release of this module is targeted for the Google Analytics SDK for iOS v3 and Google Analytics SDK v4 for Android.

64bit Capability

Version 3.0.0 of this module depends on version 3.5.0.GA (or greater) of the titanium SDK, which provides 64bit support on the iOS platform. If you are upgrading your application to use this new version and you are experiencing build problems, try clearing out your build and Resources folders and then recompile.

Set up Google Analytics

First step: you have to create a new app property in your Google Analytics-account. Refer to this page for more information.

Google Play Services

If you find that you are experiencing errors related to Google Play Services, then you should do two things:

  1. Ensure the device you are using has Google Play installed.

  2. Ensure your local sdk has the Google Play libraries installed. It is best if the library is at least version 21.

If you have checked both and you are still experiencing errors, then you can try uninstalling your local Google Play library and re-installing it.

Usage

To access this module from JavaScript, you need to do the following:

var GA = require("analytics.google");

The GA variable is a reference to the Module object. To interact with the tracker, create a tracker instance using the getTracker method.

var tracker = GA.getTracker("UA-1234567-8");
tracker.trackEvent({
	category: "Loading",
	action: "cancelled"
});

It has been suggested to store the tracker object on Alloy.Globals for convenience. For example:

// In Alloy.js
var GA = require("analytics.google");
Alloy.Globals.tracker = GA.getTracker(Alloy.CFG.googleAnalyticsId);

// Now in any controller, you can use the API as outlined in the documentation.
Alloy.Globals.tracker.trackEvent({
  category: "Loading",
  action: "cancelled"
});

Reference

Module.trackUncaughtExceptions

Set this property on the module to true when you want to enable uncaught exception tracking (crashes). Note this will not catch crashes on the Javascript thread (i.e. the Titanium "Red Screen of Death"), but should catch the exceptions on the native threads. In Android, we must initialize a tracker prior to setting this. If more than a single Tracker is used in the app, the last one set is the one that will track the uncaught exceptions.

var GA = require("analytics.google");
var tracker = GA.getTracker("UA-XXXXXXX-X"); // Android: Must be called prior to setting trackUncaughtExceptions
GA.trackUncaughtExceptions = true;

Module.optOut

Set this property to true if you want to disable analytics across the entire app.

var GA = require("analytics.google");
GA.optOut = false;

Module.dryRun

Set this property to true if you want to enable debug mode. This will prevent sending data to Google Analytics.

var GA = require("analytics.google");
GA.dryRun = true;

Module.dispatchInterval

Data collected using the Google Analytics SDK for Android is stored locally before being dispatched on a separate thread to Google Analytics. By default, data is dispatched from the Google Analytics SDK for Android every 30 minutes. By default, data is dispatched from the Google Analytics SDK for iOS every 2 minutes. Set this property if you would like to change the interval in seconds. Note that the iOS SDK requires the value in seconds and the Android SDK requires the value in minutes at the moment.

var GA = require("analytics.google");
if(Ti.Platform.osname == 'android') {
    GA.dispatchInterval = 2; // in minutes
}
else if(Ti.Platform.name == 'iPhone OS') {
    GA.dispatchInterval = 120; // in seconds
}

Module.getTracker(id)

Retrieve an analytics tracker object. Must pass the "UA-XXXXXXX-X" id string that you get from Google Analytics.

Tracker.setUser(params)

Tracks a user sign in with an 'anonymous' identifier. You will be breaking Google's terms of service if you use any of the user's personal information (including email address).

Property Type Description Required
userId String Unique identifier Yes
category String The event category Yes
action String The event action Yes
tracker.setUser({
	userId: "123456",
	category: "UX",
	action: "User Sign In"
});

Tracker.trackEvent(params)

Tracks an event taking the following parameters:

Property Type Description Required
category String The event category Yes
action String The event action Yes
label String The event label No
value Integer The event value No
tracker.trackEvent({
	category: "category",
	action: "test",
	label: "label",
	value: 1
});

Tracker.trackSocial(params)

Tracks social interactions taking the following parameters:

Property Type Description Required
network String e.g. facebook, pinterest, twitter Yes
action String The event action Yes
target String The event target No
tracker.trackSocial({
	network: "facebook",
	action: "action",
	target: "target"
});

Tracker.trackTiming(params)

Tracks a timing taking the following parameters:

Property Type Description Required
category String The event category Yes
time Number In milliseconds Yes
name String The event name No
label String The event label No
tracker.trackTiming({
	category: "Loading",
	time: 150,
	name: "",
	label: ""
});

Tracker.trackScreen(params)

Tracks a screen change using the screen's name.

Property Type Description Required
screenName String The name of the screen you want to record Yes
tracker.trackScreen({
	screenName: "Home Screen"
});

Tracker.trackException(params)

Tracks an exception, for example a login error or network timeout.

Property Type Description Required
description String A string you wish to log to GA (up to 100 characters) No
fatal Boolean True if fatal exception, false otherwise. Default value is false. No
tracker.trackException({
	description: "Facebook login error",
	fatal: false
});

Tracker.trackTransaction(params)

Tracks an ecommerce transaction.

Property Type Description Required
transactionId String A unique identifier Yes
affiliation String A category for the transaction. e.g. StoreFront Yes
revenue Number The total revenue including tax and shipping Yes
tax Number The amount of tax in the transaction Yes
shipping Number The amount of shipping in the transaction Yes
currency String The currency code. e.g. USD, CAD, etc. No
tracker.trackTransaction({
	transactionId: "123456",
	affiliation: "Store",
	revenue: 24.99 * 0.7,
	tax: 0.6,
	shipping: 0,
	currency: "CAD"
});

Tracker.trackTransactionItem(params)

Tracks an ecommerce transaction's item.

Property Type Description Required
transactionId String A unique identifier that matches the identifier used in trackTransaction Yes
name String The name of the item Yes
sku String A reference number for the item Yes
category String A category for the item No
price Number The price of the item Yes
quantity Number The number of items purchased Yes
currency String The currency code. e.g. USD, CAD, etc. No
tracker.trackTransactionItem({
	transactionId: "123456",
	name: "My Alphabet Book",
	sku: "ABC123",
	category: "product category",
	price: 24.99,
	quantity: 1,
	currency: "CAD"
});

Custom Dimensions and Metrics

The above method parameters can be extended using customMetric and customDimention properties. For example:

tracker.trackSocial({
	network: "facebook",
	action: "action",
	target: "target",
	customDimension: {
		"1": "Ottawa",
		"2": "Toronto"
	},
	customMetric: {
		"1": 45.4,
		"2": 68.3
	}
});

As per the Google Analytics API, custom metrics and dimensions are 1-based. Each property is expected to be defined by a string representation of the numeric index with its corresponding value. Metric values are expected to be numeric and Dimension values are expected to be strings.

Google Play Services

Version 2.1.0 of the android module uses Google Play Services Version 6.1 (rev 21 - 6171000).

Contributors

License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

titanium-google-analytics's People

Contributors

arood avatar astjohn avatar christianbaer avatar gn0ver avatar matttuttle avatar metacortex avatar ndizazzo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

titanium-google-analytics's Issues

64 bit iOS

February 1st is the deadline, but this needs taking care of before then.

AnalyticsGoogleTrackerProxy Invalid type passed to function

Error on build:
Titanium SDK 5.1.2.GA
iOS simulator iPhone 4s and 5, iOS 8.3

Error log:
ERROR] : The application has crashed with an uncaught exception 'org.bancosgt.AnalyticsGoogleTrackerProxy'. [ERROR] : Reason: [ERROR] : Invalid type passed to function [ERROR] : Stack trace: [ERROR] : [ERROR] : 0 CoreFoundation 0x059ad72a __exceptionPreprocess + 154 [ERROR] : 1 libobjc.A.dylib 0x05580a97 objc_exception_throw + 44 [ERROR] : 2 BancosGT 0x00116918 TiExceptionThrowWithNameAndReason + 232 [ERROR] : 3 BancosGT 0x000e2c5f -[TiProxy throwException:subreason:location:] + 143 [ERROR] : 4 BancosGT 0x006eb926 -[AnalyticsGoogleTrackerProxy trackException:] + 816 [ERROR] : 5 libobjc.A.dylib 0x05596771 -[NSObject performSelector:withObject:] + 70 [ERROR] : 6 BancosGT 0x006ebba6 __46-[AnalyticsGoogleTrackerProxy trackException:]_block_invoke + 51 [ERROR] : 7 BancosGT 0x001176ac __TiThreadPerformOnMainThread_block_invoke + 60 [ERROR] : 8 BancosGT 0x00117b20 TiThreadProcessPendingMainThreadBlocks + 528 [ERROR] : 9 BancosGT 0x001178f9 __TiThreadPerformOnMainThread_block_invoke216 + 57 [ERROR] : 10 libdispatch.dylib 0x088e0d8a _dispatch_call_block_and_release + 15 [ERROR] : 11 libdispatch.dylib 0x088fdecf _dispatch_client_callout + 14 [ERROR] : 12 libdispatch.dylib 0x088e6ee3 _dispatch_main_queue_callback_4CF + 677 [ERROR] : 13 CoreFoundation 0x059068ee __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 14 [ERROR] : 14 CoreFoundation 0x058c45f0 __CFRunLoopRun + 2256 [ERROR] : 15 CoreFoundation 0x058c3a5b CFRunLoopRunSpecific + 443 [ERROR] : 16 CoreFoundation 0x058c388b CFRunLoopRunInMode + 123 [ERROR] : 17 GraphicsServices 0x05dd72c9 GSEventRunModal + 192 [ERROR] : 18 GraphicsServices 0x05dd7106 GSEventRun + 104 [ERROR] : 19 UIKit 0x03008106 UIApplicationMain + 1526 [ERROR] : 20 BancosGT 0x00004988 main + 408 [ERROR] : 21 libdyld.dylib 0x08923ac9 start + 1 [ERROR] : [ERROR] : 2016-02-03 16:08:51.694 BancosGT[51687:3481944] *** Terminating app due to uncaught exception 'org.bancosgt.AnalyticsGoogleTrackerProxy', reason: 'Invalid type passed to function' [ERROR] : *** First throw call stack: [ERROR] : ( [ERROR] : 0 CoreFoundation 0x059ad746 __exceptionPreprocess + 182 [ERROR] : 1 libobjc.A.dylib 0x05580a97 objc_exception_throw + 44 [ERROR] : 2 BancosGT 0x00116918 TiExceptionThrowWithNameAndReason + 232 [ERROR] : 3 BancosGT 0x000e2c5f -[TiProxy throwException:subreason:location:] + 143 [ERROR] : 4 BancosGT 0x006eb926 -[AnalyticsGoogleTrackerProxy trackException:] + 816 [ERROR] : 5 libobjc.A.dylib 0x05596771 -[NSObject performSelector:withObject:] + 70 [ERROR] : 6 BancosGT 0x006ebba6 __46-[AnalyticsGoogleTrackerProxy trackException:]_block_invoke + 51 [ERROR] : 7 BancosGT 0x001176ac __TiThreadPerformOnMainThread_block_invoke + 60 [ERROR] : 8 BancosGT 0x00117b20 TiThreadProcessPendingMainThreadBlocks + 528 [ERROR] : 9 BancosGT 0x001178f9 __TiThreadPerformOnMainThread_block_invoke216 + 57 [ERROR] : 10 libdispatch.dylib 0x088e0d8a _dispatch_call_block_and_release + 15 [ERROR] : 11 libdispatch.dylib 0x088fdecf _dispatch_client_callout + 14 [ERROR] : 12 libdispatch.dylib 0x088e6ee3 _dispatch_main_queue_callback_4CF + 677 [ERROR] : 13 CoreFoundation 0x059068ee __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 14 [ERROR] : 14 CoreFoundation 0x058c45f0 __CFRunLoopRun + 2256 [ERROR] : 15 CoreFoundation 0x058c3a5b CFRunLoopRunSpecific + 443 [ERROR] : 16 CoreFoundation 0x058c388b CFRunLoopRunInMode + 123 [ERROR] : 17 GraphicsServices 0x05dd72c9 GSEventRunModal + 192 [ERROR] : 18 GraphicsServices 0x05dd7106 GSEventRun + 104 [ERROR] : 19 UIKit 0x03008106 UIApplicationMain + 1526 [ERROR] : 20 BancosGT 0x00004988 main + 408 [ERROR] : 21 libdyld.dylib 0x08923ac9 start + 1 [ERROR] : ) [ERROR] : libc++abi.dylib: terminating with uncaught exception of type NSException

TrackScreen function doest work.

i try to work on trackScreen and trackEvent on my alloy project. So far, the trackEvent function work well and i able get the Event record in my GA report but the trackScreen did not work. I did not get any error message when i call the function in my controller and i did not get any Screen record in my GA report. Anyone having the same issue?

Do we need to install Google Configurations?

Hello,

While following the google-analytics instructions for mobile implementation there is a button to generate and download configs for both android and ios. Do we need those for this module to function as expected? If so, can you provide some direction on where I need to place these files in my Ti project?

Thanks,
Grant

64bit compatible?

Hi,
thanks for the big work you do! That module is very important for titanium development.

Does last version is 64 bit compatible?

Best regards
Lorenzo

Trackevent make crash my App on iOS 9

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)

Updating google-play-services.jar

Environment:
Mac OSX 10.10.5
Ti SDK 3.5.1.GA
Targetting Android SDK 21

Hello,
I've been using this module for a while and it works wonderfully. However a new module that I've implemented required a newer version of the Google Play Services library. Since I then had two conflicting versions, I manually copied the newer google-play-services.jar into the lib folder for analytics.google. The project compiled but during run time I get the following errors:
'''
[INFO] : dalvikvm: Could not find method com.google.android.gms.analytics.GoogleAnalytics.getInstance, referenced from method analytics.google.AnalyticsGoogleModule.
[INFO] : dalvikvm: Could not find method com.google.android.gms.analytics.GoogleAnalytics.newTracker, referenced from method analytics.google.AnalyticsGoogleModule.getTracker
[INFO] : dalvikvm: Could not find method com.google.android.gms.analytics.GoogleAnalytics.setLocalDispatchPeriod, referenced from method analytics.google.AnalyticsGoogleModule.setDispatchInterval
[INFO] : dalvikvm: Could not find method com.google.android.gms.analytics.GoogleAnalytics.setDryRun, referenced from method analytics.google.AnalyticsGoogleModule.setDryRun
[INFO] : dalvikvm: Could not find method com.google.android.gms.analytics.GoogleAnalytics.setAppOptOut, referenced from method analytics.google.AnalyticsGoogleModule.setOptOut
.
.
.
[ERROR] : TiExceptionHandler: (main) [233,549] ----- Titanium Javascript Runtime Error -----
[ERROR] : TiExceptionHandler: (main) [1,550] - In app.js:1,69
[ERROR] : TiExceptionHandler: (main) [0,550] - Message: Uncaught Error: com.google.android.gms.analytics.GoogleAnalytics
[ERROR] : TiExceptionHandler: (main) [0,550] - Source: alytics.google"),Alloy.Globals.libs.gaTracker=Alloy.Globals.libs.GA.getTracker
[ERROR] : V8Exception: Exception occurred at app.js:1: Uncaught Error: com.google.android.gms.analytics.GoogleAnalytics
'''

I should add that the version of google play services I'm using had caused me to exceed android's 65k method limit, so I did have to trim it down. I made sure to leave com.google.android.gms.analytics intact and removed the following:
drive
fitness
games
location
measurement
panorama
plus
wallet

Is there something I should've done to update this module's G-P-S library rather than just manually copy-pasting it?

Module not found problem

I'm having a problem running an app that my colleagues have running fine on their Macs and Linux machines. Every time I start in the emulator (Android SDK and Genymotion) it tells me that it cannot find the module. But the module is right there.

My colleagues have sent me working zipped versions from their PCs and it still will not compile on mine. Titanium 3.5.1GA is what I am using.

Error:

[ERROR] :  TiExceptionHandler: (main) [1722,1722] ----- Titanium Javascript Runtime Error -----
[ERROR] :  TiExceptionHandler: (main) [1,1723] - In ti:/module.js:280,9
[ERROR] :  TiExceptionHandler: (main) [1,1724] - Message: Uncaught Error: Requested module not found: analytics.google
[ERROR] :  TiExceptionHandler: (main) [0,1724] - Source:         throw new Error("Requested module not found: " + request);
[ERROR] :  V8Exception: Exception occurred at ti:/module.js:280: Uncaught Error: Requested module not found: analytics.google

Versions:

$ node -v
v0.12.4
$ java -version
java version "1.7.0_79"
OpenJDK Runtime Environment (IcedTea 2.5.5) (7u79-2.5.5-0ubuntu0.14.04.2)
OpenJDK Server VM (build 24.79-b02, mixed mode)
$ ti --version
4.0.1

$ ti sdk
Titanium Command-Line Interface, CLI version 4.0.1, Titanium SDK version 3.5.1.GA
Copyright (c) 2012-2015, Appcelerator, Inc.  All Rights Reserved.

Please report bugs to http://jira.appcelerator.org/

SDK Install Locations:
   /home/land/.titanium [default]

Installed SDKs:
   3.5.1.GA [selected]  /home/land/.titanium/mobilesdk/linux/3.5.1.GA

Here is a full stack page where I am looking for help also showing some SS.
http://stackoverflow.com/questions/30623316/titanium-missing-google-analytics-when-starting-app?noredirect=1#comment49357229_30623316

First Time Build Errors

I ran into a couple issues when trying to compile the android module source for the first time. Might be helpful to others to add them the the readme. I'm adding them here in case others are having similar trouble.

1.) You have to create your own build.properties file. There is an example file in the repo (build.properties.example), but you have to copy it to a new file named build.properties and edit it's values to point to the various titanium and android sdk's on your system. As a novice when it comes to titanium modules, this was not readily apparent to me.

2.) After setting up my build properties, the build failed with an error message that the /build/docs folder doesn't exist. I checked and sure enough it did not. So I created the folder, and ran the build again, and it all worked fine, hooray! Again I'm a module novice, so I'm not sure if just creating the docs folder was the "right" thing to do, but it worked, so I'm happy.

App using analytics.google fails to build on Android for 5.0.0.GA

Environment:

Mac OSX 10.10.5
Ti CLI 5.0.4
Ti SDK 5.0.0.GA
Targetting Android SDK 21
Android build tools 22.0.1

[ERROR] Failed to run dexer:
[ERROR]
[ERROR] Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
[ERROR]
[ERROR] UNEXPECTED TOP-LEVEL EXCEPTION:
[ERROR] java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/maps/LocationSource;
[ERROR]         at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:122)
[ERROR]         at com.android.dx.dex.file.DexFile.add(DexFile.java:161)
[ERROR]         at com.android.dx.command.dexer.Main.processClass(Main.java:732)
[ERROR]         at com.android.dx.command.dexer.Main.processFileBytes(Main.java:673)
[ERROR]         at com.android.dx.command.dexer.Main.access$300(Main.java:83)
[ERROR]         at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:602)
[ERROR]         at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
[ERROR]         at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
[ERROR]         at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
[ERROR]         at com.android.dx.command.dexer.Main.processOne(Main.java:632)
[ERROR]         at com.android.dx.command.dexer.Main.processAllFiles(Main.java:510)
[ERROR]         at com.android.dx.command.dexer.Main.runMonoDex(Main.java:280)
[ERROR]         at com.android.dx.command.dexer.Main.run(Main.java:246)
[ERROR]         at com.android.dx.command.dexer.Main.main(Main.java:215)
[ERROR]         at com.android.dx.command.Main.main(Main.java:106)
[ERROR] 1 error; aborting

Removing analytics.google module results in a successful build.

Getting this error in Android..

[ERROR] : TiApplication: (KrollRuntimeThread) [29,111] Sending event: exception on thread: KrollRuntimeThread msg:java.lang.UnsatisfiedLinkError: Couldn't load analytics.google from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.company.myapp-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.company.myapp-2, /system/lib]]]: findLibrary returned null; Titanium 3.5.0,2015/01/12 15:33,0014f83
[ERROR] : TiApplication: java.lang.UnsatisfiedLinkError: Couldn't load analytics.google from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.company.myapp-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.company.myapp-2, /system/lib]]]: findLibrary returned null
[ERROR] : TiApplication: at java.lang.Runtime.loadLibrary(Runtime.java:358)
[ERROR] : TiApplication: at java.lang.System.loadLibrary(System.java:526)
[ERROR] : TiApplication: at org.appcelerator.kroll.runtime.v8.V8Runtime.loadExternalModules(V8Runtime.java:132)
[ERROR] : TiApplication: at org.appcelerator.kroll.runtime.v8.V8Runtime.initRuntime(V8Runtime.java:99)
[ERROR] : TiApplication: at org.appcelerator.kroll.KrollRuntime.doInit(KrollRuntime.java:185)
[ERROR] : TiApplication: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:109)

Please Help...

Unable to build the Android module using Appcelerator SDK 5.2.0.GA

Hi,

I have been trying to build the module for Android using 5.2.0.GA, but everytime I am getting the error:

BUILD FAILED /Users/soumya/Library/Application Support/Titanium/mobilesdk/osx/5.2.0.GA/module/android/build.xml:348: The following error occurred while executing this line: /Users/soumya/Library/Application Support/Titanium/mobilesdk/osx/5.2.0.GA/module/android/build.xml:303: exec returned: 2

I have previously used this module for iOS and it built perfectly. Even if I change the version from 5.2.0.GA to a lower version, I still get the same error. I am using android-10e for NDK. If someone has any inputs or a working version for 5.X.X can you share the repo.

iOS uncaught exception crash on internet loss

Issues exists in 3.0.2 iOS module with Titanium 3.5.0.GA. If the internet goes down the module gives Network connection failed and makes 5 attempts to retry, after the 5th it crashes with a NSInternalInconsistencyException.

Steps to replicate, build on iOS with no internet and watch for when Analytics decides starts its call.

iOS Crashing

Hi,

I've installed this module on an app and it keeps causing it to crash unexpectedly. Titanium is not throwing up any errors unfortunately which makes debugging difficult. Has anybody any experience with this?

Installation

Hi there

How do I install this module? I've downloaded the module as a ZIP from github, installed it globally in Titanium but I can't seem to find it when I want to add it to my tiapp.xml.

Am I importing it incorrectly?

Not Working in 5.5.1 for iOS

Although it is working great in my Android apps I am having trouble getting this to work at all in iOS apps in 5.5.0 or 5.5.1. It is not showing any usage stats at all for iOS despite it being setup the same way as it was in 5.3+ and 5.4+ versions. Anyone else running into these issues?

Google Play Services jar file clash

Hi, I'm having a problem using your module. When Titanium compiles my app it says that the google-play-services.jar file clashes with the one used in ti.map module.

I've tried using the jar file you provide for ti.map and vice versa but I still can't get the app to compile.

Any ideas?
Thanks

Android zip

Apologies for opening a new thread, where can I find the android module zip file?

I've found the zip in the ios folder, installed it, but when I go to add it to my app, I'm only shown Google Analytics [ios] and not Android, do I have to install the android one separately?

android: receiver registration

I just noticed these warnings in the logcat output of my app.

W/GAv4 ( 1124): AnalyticsReceiver is not registered or is disabled. Register the receiver for reliable dispatching on non-Google Play devices. See http://goo.gl/8Rd3yj for instructions.
W/GAv4 ( 1124): CampaignTrackingReceiver is not registered, not exported or is disabled. Installation campaign tracking is not possible. See http://goo.gl/8Rd3yj for instructions.
W/GAv4 ( 1124): AnalyticsService not registered in the app manifest. Hits might not be delivered reliably. See http://goo.gl/8Rd3yj for instructions.

I can make them go away by using the guidance here: http://stackoverflow.com/questions/30154057/analyticsservice-not-registered-in-the-app-manifest-error

which suggests adding the code below to AndroidManifest.xml.

Questions:

  • do these warnings really have much impact on my app?
  • does it hurt to add the directives below to AndroidManifest.xml?
  • should the directives be added to this module's timodule.xml so they automatically are added to AndroidManifest.xml?
 <!-- Optionally, register AnalyticsReceiver and AnalyticsService to support background
      dispatching on non-Google Play devices -->
 <receiver android:name="com.google.android.gms.analytics.AnalyticsReceiver"
     android:enabled="true">
     <intent-filter>
         <action android:name="com.google.android.gms.analytics.ANALYTICS_DISPATCH" />
     </intent-filter>
 </receiver>
 <service android:name="com.google.android.gms.analytics.AnalyticsService"
     android:enabled="true"
     android:exported="false"/>

 <!-- Optionally, register CampaignTrackingReceiver and CampaignTrackingService to enable
      installation campaign reporting -->
 <receiver android:name="com.google.android.gms.analytics.CampaignTrackingReceiver"
     android:exported="true">
     <intent-filter>
         <action android:name="com.android.vending.INSTALL_REFERRER" />
     </intent-filter>
 </receiver>
 <service android:name="com.google.android.gms.analytics.CampaignTrackingService" />

Tracker.trackScreen issues

Tracker.trackScreen(params) not working for me, Ti 3.5.1.GA iOS 9. Any idea how to fix it? events are working so its not a problem fetching the tracker or something else.

Strange information from analytics

Hello,

I started using this module and 2 days later I get really strange readings from analytics. I am still developing it and haven't published this but get reading like people around the world are using my application. The other day got 33 new users. Could this be error in plugin or someone is stealing my source?

Titanium SDK 4.0.0.GA

i trying use this module in titanium sdk 4.0.0.GA, but app don't open

Error in console:

[DEBUG] :  GoogleAnalyticsModule: inside onAppCreate
[INFO] :   TiRootActivity: (main) [0,0] checkpoint, on root activity create, savedInstanceState: null
[INFO] :   TiApplication: (main) [0,0] Analytics have been disabled
[WARN] :   V8Object: (KrollRuntimeThread) [163,163] Runtime disposed, cannot set property 'userAgent'

App don't open after this error

The app crashes on android - GooglePlayServices

I am using SDK 3.4.1, the app crash when i require the module and gives this error.

Could not find method com.google.android.gms.analytics.GoogleAnalytics.getInstance, referenced from method ti.ga.TigaModule.

and before crashing it gives this error:
[ERROR] : dalvikvm: VM aborting

Here's all the log:

-- Start application log -----------------------------------------------------
[INFO] : TiApplication: (main) [0,0] checkpoint, app created.
[INFO] : TiApplication: (main) [359,359] Titanium 3.4.1 (2014/11/13 13:33 5982e8f)
[INFO] : TiApplication: (main) [600,959] Titanium Javascript runtime: v8
[INFO] : dalvikvm: Could not find method com.google.android.gms.analytics.GoogleAnalytics.getInstance, referenced from method ti.ga.TigaModule.
[WARN] : dalvikvm: VFY: unable to resolve static method 9975: Lcom/google/android/gms/analytics/GoogleAnalytics;.getInstance (Landroid/content/Context;)Lcom/google/android/gms/analytics/GoogleAnalytics;
[INFO] : dalvikvm: Could not find method com.google.android.gms.analytics.GoogleAnalytics.dispatchLocalHits, referenced from method ti.ga.TigaModule.dispatch
[WARN] : dalvikvm: VFY: unable to resolve virtual method 9973: Lcom/google/android/gms/analytics/GoogleAnalytics;.dispatchLocalHits ()V
[INFO] : dalvikvm: Could not find method com.google.android.gms.analytics.GoogleAnalytics.getAppOptOut, referenced from method ti.ga.TigaModule.getOptOut
[WARN] : dalvikvm: VFY: unable to resolve virtual method 9974: Lcom/google/android/gms/analytics/GoogleAnalytics;.getAppOptOut ()Z
[INFO] : dalvikvm: Could not find method com.google.android.gms.analytics.GoogleAnalytics.getLogger, referenced from method ti.ga.TigaModule.setDebug
[WARN] : dalvikvm: VFY: unable to resolve virtual method 9976: Lcom/google/android/gms/analytics/GoogleAnalytics;.getLogger ()Lcom/google/android/gms/analytics/Logger;
[INFO] : dalvikvm: Could not find method com.google.android.gms.analytics.GoogleAnalytics.getLogger, referenced from method ti.ga.TigaModule.setDebug
[WARN] : dalvikvm: VFY: unable to resolve virtual method 9976: Lcom/google/android/gms/analytics/GoogleAnalytics;.getLogger ()Lcom/google/android/gms/analytics/Logger;
[INFO] : dalvikvm: Could not find method com.google.android.gms.analytics.GoogleAnalytics.setLocalDispatchPeriod, referenced from method ti.ga.TigaModule.setDispatchInterval
[WARN] : dalvikvm: VFY: unable to resolve virtual method 9979: Lcom/google/android/gms/analytics/GoogleAnalytics;.setLocalDispatchPeriod (I)V
[INFO] : dalvikvm: Could not find method com.google.android.gms.analytics.GoogleAnalytics.setAppOptOut, referenced from method ti.ga.TigaModule.setOptOut
[WARN] : dalvikvm: VFY: unable to resolve virtual method 9978: Lcom/google/android/gms/analytics/GoogleAnalytics;.setAppOptOut (Z)V
[INFO] : TiRootActivity: (main) [0,0] checkpoint, on root activity create, savedInstanceState: null
[WARN] : V8Object: (KrollRuntimeThread) [59,59] Runtime disposed, cannot set property 'userAgent'
[INFO] : I/dalvikvm-heap: Grow heap (frag case) to 14.203MB for 1536016-byte allocation
[INFO] : dalvikvm: Total arena pages for JIT: 11
[INFO] : dalvikvm: Total arena pages for JIT: 12
[INFO] : dalvikvm: Total arena pages for JIT: 13
[INFO] : dalvikvm: Total arena pages for JIT: 14
[INFO] : dalvikvm: Total arena pages for JIT: 15
[INFO] : dalvikvm: Total arena pages for JIT: 16
[INFO] : dalvikvm: Total arena pages for JIT: 17
[INFO] : dalvikvm: Total arena pages for JIT: 18
[INFO] : TiRootActivity: (main) [0,0] checkpoint, on root activity resume. activity = com.gplanet.greekcampus.GreekCampusActivity@42935770
[INFO] : dalvikvm: Could not find method com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable, referenced from method ti.map.MapModule.isGooglePlayServicesAvailable
[WARN] : dalvikvm: VFY: unable to resolve static method 10009: Lcom/google/android/gms/common/GooglePlayServicesUtil;.isGooglePlayServicesAvailable (Landroid/content/Context;)I
[INFO] : syncWithServer
[WARN] : dalvikvm: Invalid indirect reference 0x429814e8 in decodeIndirectRef
[INFO] : dalvikvm: "KrollRuntimeThread" prio=5 tid=10 RUNNABLE
[INFO] : dalvikvm: | group="main" sCount=0 dsCount=0 obj=0x428ed728 self=0x58fc8730
[INFO] : dalvikvm: | sysTid=16863 nice=0 sched=0/0 cgrp=apps handle=1376234480
[INFO] : dalvikvm: | state=R schedstat=( 519811360 1452546650 3453 ) utm=41 stm=10 core=0
[INFO] : dalvikvm: at org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method)
[INFO] : dalvikvm: at org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:168)
[INFO] : dalvikvm: at org.appcelerator.kroll.KrollRuntime.handleMessage(KrollRuntime.java:299)
[INFO] : dalvikvm: at org.appcelerator.kroll.runtime.v8.V8Runtime.handleMessage(V8Runtime.java:194)
[INFO] : dalvikvm: at android.os.Handler.dispatchMessage(Handler.java:95)
[INFO] : dalvikvm: at android.os.Looper.loop(Looper.java:176)
[INFO] : dalvikvm: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112)
[INFO] : dalvikvm:
[ERROR] : dalvikvm: VM aborting
[INFO] : libc: Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1), thread 16863 (KrollRuntimeThr)

Android I can't build in 4.1.0

Hello,
I use this module in iOS and all is perfect, but, I'm linux, when I try to compile in 4.1.0.GA for android it shows this error:
[ERROR] : Failed to run dexer:
[ERROR] :
[ERROR] : UNEXPECTED TOP-LEVEL EXCEPTION:
[ERROR] : java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/maps/LocationSource;
[ERROR] : at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:122)
[ERROR] : at com.android.dx.dex.file.DexFile.add(DexFile.java:161)
[ERROR] : at com.android.dx.command.dexer.Main.processClass(Main.java:732)
[ERROR] : at com.android.dx.command.dexer.Main.processFileBytes(Main.java:673)
[ERROR] : at com.android.dx.command.dexer.Main.access$300(Main.java:83)
[ERROR] : at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:602)
[ERROR] : at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
[ERROR] : at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
[ERROR] : at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
[ERROR] : at com.android.dx.command.dexer.Main.processOne(Main.java:632)
[ERROR] : at com.android.dx.command.dexer.Main.processAllFiles(Main.java:510)
[ERROR] : at com.android.dx.command.dexer.Main.runMonoDex(Main.java:280)
[ERROR] : at com.android.dx.command.dexer.Main.run(Main.java:246)
[ERROR] : at com.android.dx.command.dexer.Main.main(Main.java:215)
[ERROR] : at com.android.dx.command.Main.main(Main.java:106)
[ERROR] : 1 error; aborting
TRACE | titanium exited with exit code 1
ERROR | Error: ti run exited with error code 1
at ChildProcess. (/home/lightdown/.appcelerator/install/4.1.2/package/node_modules/appc-cli-titanium/plugins/run.js:84:66)
at ChildProcess.emit (events.js:98:17)
at Process.ChildProcess._handle.onexit (child_process.js:820:12)
[ERROR] Application Installer abnormal process termination. Process exit value was 1

it show the error when I include the module in tiapp.xml
Anybody knows any solution?

Thanks

Dispatch when offline?

Hi, what will happen with the data when the ios-user is offline at dispatch time? Will the data be available and send the next time the user is online? Or is it lost?

Google analytics module not working on android, makes the app crash with ti 3.5.1 sdk

[ERROR] : TiApplication: (KrollRuntimeThread) [29,111] Sending event: exception on thread: KrollRuntimeThread msg:java.lang.UnsatisfiedLinkError: Couldn't load analytics.google from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.company.myapp-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.company.myapp-2, /system/lib]]]: findLibrary returned null; Titanium 3.5.0,2015/01/12 15:33,0014f83
[ERROR] : TiApplication: java.lang.UnsatisfiedLinkError: Couldn't load analytics.google from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.company.myapp-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.company.myapp-2, /system/lib]]]: findLibrary returned null
[ERROR] : TiApplication: at java.lang.Runtime.loadLibrary(Runtime.java:358)
[ERROR] : TiApplication: at java.lang.System.loadLibrary(System.java:526)
[ERROR] : TiApplication: at org.appcelerator.kroll.runtime.v8.V8Runtime.loadExternalModules(V8Runtime.java:132)
[ERROR] : TiApplication: at org.appcelerator.kroll.runtime.v8.V8Runtime.initRuntime(V8Runtime.java:99)
[ERROR] : TiApplication: at org.appcelerator.kroll.KrollRuntime.doInit(KrollRuntime.java:185)
[ERROR] : TiApplication: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:109)

Also, If you can help us with the libs folder for android module ,as it is not available in this repository.Please help asap.Thanks in advance

Change module's ID

As per #6, the module's identifier is still tied to the old module which was placed on the marketplace. We should change this module's identifier to avoid this conflict for new users.

Strange Error

Hi @somi82,

Thank you for this amazing module.
I have updated it to the newest 3.1.0 version and now my project is show this error:
Could please help me?

[ERROR] : TiExceptionHandler: (main) [465,34701] ----- Titanium Javascript Runtime Error -----
[ERROR] : TiExceptionHandler: (main) [0,34701] - In ui/common/DetailWindow.js:1,69
[ERROR] : TiExceptionHandler: (main) [0,34701] - Message: Uncaught Error: Class 'java.lang.String' does not implement interface 'java.util.Map' in call to 'int java.util.Map.size()' (declaration of 'java.lang.reflect.ArtMethod' appears in /system/framework/core-libart.jar)
[ERROR] : TiExceptionHandler: (main) [0,34701] - Source: })}))}}),s.addEventListener("focus",function(){Titanium.App.tracker.trackScree
[ERROR] : V8Exception: Exception occurred at ui/common/DetailWindow.js:1: Uncaught Error: Class 'java.lang.String' does not implement interface 'java.util.Map' in call to 'int java.util.Map.size()' (declaration of 'java.lang.reflect.ArtMethod' appears in /system/framework/core-libart.jar)

Custom dimensions

I am having trouble with specifying custom dimensions.

I do this:

Ti.App.Tracker.trackEvent({
category: "testcategory",
action: "test/trackevent",
label:"testlabel",
value: 1,
customDimension:{
1:Ti.App.getVendorId(),
2:Ti.App.idcliente
}
});
I can see "testcategory", I can see action and label - but I cannot find any custom dimensions in Google Analytics.

Am I maybe mistaken of where I search for them?

PS: I have found more information how to configure custom dimensions. Is the code above correct? Do the keys of "customDimension" array have to be integer or string? Is it necessary to have custom dimensions configured in the project before I can see any input?

trackScreen might not work anymore on iOS? Need confirmations

Looking at the Analytics for an app, I have a suspicion that tracking might no longer work on iOS.

3 days ago I upload a new version of my app, 2.38, to App Store, and so far I can't see anything from that app version in my Analytics panel. It's only showing statistics for old versions of the app.

If I start up my app, it should also show my session in the real-time overview in Analytics, but again, only old versions of the app appear here.

Is anyone else seeing the same issues with tracking?

Titanium SDK 3.5.0.GA, OS X Yosemite 10.10.2, Xcode 6.1.1 and analytics.google module 3.0.2

Error to connect to Google Play services with sdk Google Analytics 7.5.71

[ERROR] : GooglePlayServicesUtil: The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.

Same error with master build form github.

Full log for 7.5.71
[INFO] : GAv4: Google Analytics 7.5.71 is starting up. To enable debug logging on a device run:
[INFO] : GAv4: adb shell setprop log.tag.GAv4 DEBUG
[INFO] : GAv4: adb logcat -s GAv4
[WARN] : GAv4: AnalyticsReceiver is not registered or is disabled. Register the receiver for reliable dispatching on non-Google Play devices. See http://goo.g
l/8Rd3yj for instructions.
[INFO] : I/Adreno-EGL: <qeglDrvAPI_eglInitialize:379>: QUALCOMM Build: 01/14/15, ab0075f, Id3510ff6dc
[WARN] : GAv4: CampaignTrackingReceiver is not registered, not exported or is disabled. Installation campaign tracking is not possible. See http://goo.gl/8Rd3
yj for instructions.
[INFO] : OpenGLRenderer: Initialized EGL, version 1.4
[WARN] : GAv4: AnalyticsService not registered in the app manifest. Hits might not be delivered reliably. See http://goo.gl/8Rd3yj for instructions.
[INFO] : a87c8390300c98f4
[ERROR] : GooglePlayServicesUtil: The Google Play services resources were not found. Check your project configuration to ensure that the resources are included

And full log for master build
[WARN] : dalvikvm: VFY: unable to resolve static field 8529 (common_google_play_services_install_title) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 8524 (common_google_play_services_enable_title) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 8543 (common_google_play_services_update_title) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 8521 (common_android_wear_update_title) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 8540 (common_google_play_services_unsupported_title) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 8534 (common_google_play_services_network_error_title) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 8531 (common_google_play_services_invalid_account_title) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 8538 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 8528 (common_google_play_services_install_text_tablet) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 8527 (common_google_play_services_install_text_phone) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 8523 (common_google_play_services_enable_text) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 8542 (common_google_play_services_update_text) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 8520 (common_android_wear_update_text) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 8539 (common_google_play_services_unsupported_text) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 8533 (common_google_play_services_network_error_text) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 8530 (common_google_play_services_invalid_account_text) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 8526 (common_google_play_services_install_button) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 8522 (common_google_play_services_enable_button) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 8541 (common_google_play_services_update_button) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 8538 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 8535 (common_google_play_services_notification_needs_installation_title) in Lcom/google/android/gms/R$s
tring;
[WARN] : dalvikvm: VFY: unable to resolve static field 8536 (common_google_play_services_notification_needs_update_title) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 8519 (common_android_wear_notification_needs_update_text) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 8532 (common_google_play_services_needs_enabling_title) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 8539 (common_google_play_services_unsupported_text) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 8533 (common_google_play_services_network_error_text) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 8530 (common_google_play_services_invalid_account_text) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 8538 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 8525 (common_google_play_services_error_notification_requested_by_msg) in Lcom/google/android/gms/R$str
ing;
[INFO] : dalvikvm: DexOpt: unable to optimize static field ref 0x2141 at 0x35 in Lcom/google/android/gms/common/GooglePlayServicesUtil;.showErrorNotification
[INFO] : dalvikvm: DexOpt: unable to optimize static field ref 0x2140 at 0x67 in Lcom/google/android/gms/common/GooglePlayServicesUtil;.showErrorNotification
[INFO] : dalvikvm: DexOpt: unable to optimize static field ref 0x2160 at 0x69 in Lcom/google/android/gms/common/GooglePlayServicesUtil;.showErrorNotification
[INFO] : dalvikvm: DexOpt: unable to optimize static field ref 0x2159 at 0x87 in Lcom/google/android/gms/common/GooglePlayServicesUtil;.showErrorNotification
[ERROR] : GooglePlayServicesUtil: The Google Play services resources were not found. Check your project configuration to ensure that the resources are included

Android module not appearing in supported modules list

I'm trying to add the Android module to my project an encountering a strange issue. After installing both Android and iOS mobile modules into the application directory, I go to the tiapp.xml interface to add the modules to the project, but only iOS appears.

I manually edited the tiapp.xml file to add the entry <module platform="android">analytics.google</module>, and it appears beside the iOS version as a greyed out asterisk. It says that the module is not supported by Titanium SDK 3.4.0.GA.

I figured it was built using an older SDK, so I configured and rebuilt the module via ant, cleaned my project of the old module files in modules/android/analytics.google/* and re-installed it. Same issue.

Here's a couple screen shots to illustrate what's happening:

After installing both .zip packages in the project:

screen shot 2014-11-21 at 10 49 01 am

After manually adding android support:
screen shot 2014-11-21 at 10 49 26 am

screen shot 2014-11-21 at 3 15 58 pm

Running the project gives me the stack trace:

[WARN] :   W/System.err: java.lang.IncompatibleClassChangeError: interface not implemented
[WARN] :   W/System.err:    at java.util.HashMap.<init>(HashMap.java:195)
[WARN] :   W/System.err:    at org.appcelerator.kroll.KrollDict.<init>(KrollDict.java:79)
[WARN] :   W/System.err:    at analytics.google.TrackerProxy.trackScreen(TrackerProxy.java:237)
[WARN] :   W/System.err:    at org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method)
[WARN] :   W/System.err:    at org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:168)
[WARN] :   W/System.err:    at org.appcelerator.kroll.KrollRuntime.handleMessage(KrollRuntime.java:299)
[WARN] :   W/System.err:    at org.appcelerator.kroll.runtime.v8.V8Runtime.handleMessage(V8Runtime.java:194)
[WARN] :   W/System.err:    at android.os.Handler.dispatchMessage(Handler.java:98)
[WARN] :   W/System.err:    at android.os.Looper.loop(Looper.java:157)
[WARN] :   W/System.err:    at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112)
[ERROR] :  TiExceptionHandler: (main) [9803,10498] ----- Titanium Javascript Runtime Error -----
[ERROR] :  TiExceptionHandler: (main) [0,10498] - In event_hooks.js:1,69
[ERROR] :  TiExceptionHandler: (main) [0,10498] - Message: Uncaught Error: interface not implemented
[ERROR] :  TiExceptionHandler: (main) [1,10499] - Source: eceived a local notification"}];return l.openedScreen=function(e){i.trackScree
[ERROR] :  V8Exception: Exception occurred at event_hooks.js:1: Uncaught Error: interface not implemented

I have Android SDK platforms 10 through 20 installed, as well as the NDK r10 (x64). I've not had any problems with my Android environment previously. I've built several custom native modules that compile and run.

transaction and product

is possible to have something like this with your library? iwould like to do it for iOS (the example below is for Android)

    String currency = "EUR";

    // Set up the product.
    Product product = new Product()
        .setId(idCoupon)
        .setName(itemName)
        .setCategory(itemCategory)
        .setPrice(price)
        .setQuantity(1);

    // Set up the purchase action.
    ProductAction productAction;
    try {
        productAction = new ProductAction(ProductAction.ACTION_PURCHASE)
            .setTransactionId(idCoupon + "-" + new Date().getTime() + "-" + ((Customer)UserController.getCurrentUser(application)).getCodeCustomerIdentificationMst())
            .setTransactionAffiliation("Google Play")
            .setTransactionRevenue(price);

        // Create the builder, which combines the purchase with the product.
        HitBuilders.EventBuilder builder = 
            new HitBuilders.EventBuilder();
        builder.setProductAction(productAction).addProduct(product);
        builder.setCategory("transaction").setAction("purchase");

        // Create the analytics tracker.
        PasspartuApplication app = ((PasspartuApplication) application);
        Tracker ecommerceTracker = app
                .getTracker(TrackerName.ECOMMERCE_TRACKER);

        // Send the event, specifying the currency.
        ecommerceTracker.set("&cu", currency);
        ecommerceTracker.send(builder.build());
    } catch (UserNotLoggedException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

idfa class missing, won't collect idfa

New 64bit version has been reported as generating the following log statement:
idfa class missing, won't collect idfa

This warning is bad as this might prevent acceptance by apple. A possible solution is stated here

Analytics working only for first window in iOS

I have about 8 windows where i have written the below code...but this code only works when on home screen.I have been receiving this error when navigating to another screen in iOS
2015-03-16 20:10:11.214 MyApp[99143:395400] -[__NSCFString set:value:]: unrecognized selector sent to instance 0x7f8eda4553d0... If i remove this code the app works fine...

var GA = require('analytics.google');
//GA.optOut = true;
GA.debug = true;
//GA.trackUncaughtExceptions = true;var GA = require('analytics.google');

GA.trackUncaughtExceptions = true; // ios only
// if you wanted to disable analytics across the entire app, you would set optOut to true
GA.optOut = false;
// set dryRun to true if you are debugging and don't want to capture data (default is true)
GA.dryRun = false;
// Data collected using the Google Analytics SDK for Android is stored locally before being
// dispatched on a separate thread to Google Analytics.
// By default, data is dispatched from the Google Analytics SDK for Android every 30 minutes.
GA.dispatchInterval = 15; // minutes

var tracker = GA.getTracker(Alloy.CFG.trackingId);
var tracker = GA.getTracker("UA-XXXXXXXX-2");
Ti.API.info("trackerid = "+Alloy.CFG.trackingId);
tracker.trackScreen({
screenName : "ListScreen"
});

Please Help...Thanks

Android - Crash on Launch

Hello,

I'm using your 3.1.0 release, Titanium SDK. 3.5.1.GA, and Appcelerator Studio with all the latest updates. I'm getting a crash when my Android application launches. I have also imported your sample application and it crashes as well.

Here is the error message I'm receiving:

[ERROR] :  TiApplication: (KrollRuntimeThread) [16,109] Sending event: exception on thread: KrollRuntimeThread msg:java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/analytics.google.test-1/base.apk"],nativeLibraryDirectories=[/data/app/analytics.google.test-1/lib/x86, /vendor/lib, /system/lib]]] couldn't find "libanalytics.google.so"; Titanium 3.5.0,2015/01/12 15:33,0014f83
[ERROR] :  TiApplication: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/analytics.google.test-1/base.apk"],nativeLibraryDirectories=[/data/app/analytics.google.test-1/lib/x86, /vendor/lib, /system/lib]]] couldn't find "libanalytics.google.so"
[ERROR] :  TiApplication:   at java.lang.Runtime.loadLibrary(Runtime.java:366)
[ERROR] :  TiApplication:   at java.lang.System.loadLibrary(System.java:988)
[ERROR] :  TiApplication:   at org.appcelerator.kroll.runtime.v8.V8Runtime.loadExternalModules(V8Runtime.java:132)
[ERROR] :  TiApplication:   at org.appcelerator.kroll.runtime.v8.V8Runtime.initRuntime(V8Runtime.java:99)
[ERROR] :  TiApplication:   at org.appcelerator.kroll.KrollRuntime.doInit(KrollRuntime.java:185)
[ERROR] :  TiApplication:   at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:109)

The module works great on iOS, but I'm not having much luck with Android. I've tried a Samsung Note 4 Emulator, Galaxy S3 device, and RAZR HD device. I've looked through all your previous closed issues to no avail. I really appreciate any help you can provide.

Android - Module doesn't work in Ti.SDK 5.1.2.GA

Hello,

I'm trying to use this module on Android but it shows me this error:

I read that it can be caused by google-play-services.jar, but if I remove this library I can't compile the module. The version 1.0 of this module doesn't work in Android 6.0.

Can anyone help me?

Failed to run dexer:
[ERROR] :  
[ERROR] :  Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/maps/LocationSource;
[ERROR] :  Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/maps/GoogleMap$4;
[ERROR] :  Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/maps/StreetViewPanorama$OnStreetViewPanoramaChangeListener;
[ERROR] :  Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/maps/StreetViewPanoramaFragment;
[ERROR] :  Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/maps/GoogleMap$InfoWindowAdapter;
[ERROR] :  Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/maps/MapsInitializer;
[ERROR] :  Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/maps/MapFragment;
[ERROR] :  Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/maps/GoogleMap$OnMyLocationButtonClickListener;
[ERROR] :  Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/maps/UiSettings;
[ERROR] :  
[ERROR] :  UNEXPECTED TOP-LEVEL EXCEPTION:
[ERROR] :  java.lang.RuntimeException: Translation has been interrupted
[ERROR] :   at com.android.dx.command.dexer.Main.processAllFiles(Main.java:608)
[ERROR] :   at com.android.dx.command.dexer.Main.runMonoDex(Main.java:311)
[ERROR] :   at com.android.dx.command.dexer.Main.run(Main.java:277)
[ERROR] :   at com.android.dx.command.dexer.Main.main(Main.java:245)
[ERROR] :   at com.android.dx.command.Main.main(Main.java:106)
[ERROR] :  Caused by: java.lang.InterruptedException: Too many errors
[ERROR] :   at com.android.dx.command.dexer.Main.processAllFiles(Main.java:600)
[ERROR] :   ... 4 more

App crash while using google analytics

While using google analytics in Appcelerator, we tried implementing a navigation screen in Appcelerator. On clicking the next screen button more than twice for navigating between screens the app crashes.On staying on second screen for long time also crashes the app. But the crash logs are not displayed neither in google analytics nor in Appcelerator.
SDK version: 3.1.0
Titanium SDK version: 4.1.0 and above
iOS Simulator version: 9.2

Class JavaLaunchHelper Issue for Android

i build the module from the source using the titanium SDK 4.0.0.GA and when I add the module to my app , it shows me this error

[ERROR] Application Installer abnormal process termination. Process exit value was 1
[ERROR] : Failed to run dexer:
[ERROR] :
[ERROR] : objc[7020]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
[ERROR] :
[ERROR] : UNEXPECTED TOP-LEVEL EXCEPTION:
[ERROR] : java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/dynamic/LifecycleDelegate;
[ERROR] : at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:122)
[ERROR] : at com.android.dx.dex.file.DexFile.add(DexFile.java:161)
[ERROR] : at com.android.dx.command.dexer.Main.processClass(Main.java:732)
[ERROR] : at com.android.dx.command.dexer.Main.processFileBytes(Main.java:673)
[ERROR] : at com.android.dx.command.dexer.Main.access$300(Main.java:82)
[ERROR] : at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:602)
[ERROR] : at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
[ERROR] : at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
[ERROR] : at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
[ERROR] : at com.android.dx.command.dexer.Main.processOne(Main.java:632)
[ERROR] : at com.android.dx.command.dexer.Main.processAllFiles(Main.java:510)
[ERROR] : at com.android.dx.command.dexer.Main.runMonoDex(Main.java:279)
[ERROR] : at com.android.dx.command.dexer.Main.run(Main.java:245)
[ERROR] : at com.android.dx.command.dexer.Main.main(Main.java:214)
[ERROR] : at com.android.dx.command.Main.main(Main.java:106)
[ERROR] : 1 error; aborting
TRACE | titanium exited with exit code 1
ERROR | Error: ti run exited with error code 1
at ChildProcess. (/Users/touhidurrahman/.appcelerator/install/4.0.1/package/node_modules/appc-cli-titanium/plugins/run.js:84:66)
at ChildProcess.emit (events.js:98:17)
at Process.ChildProcess._handle.onexit (child_process.js:810:12)

now when i remove the module from my app for the Android , then the app is working fine and no such issue . according to my search , this issue is caused by a JAVA bug and oracle has already fixed it . but for some reason , when i add the module , it's causing this problem . i am not sure if this related to the titanium SDK 4.0.0.GA as i used this module to my other apps before without building it from the source and i did not face such problem .

working fine for the iOS so far .

Here is my current configs :
Mac OS 10.10.3
Appcelerator Studio build: 4.0.0.201505202026
Titanium SDK 4.0.0.GA
JDK 1.7.0_80
Appcelerator Command-Line Interface, version 4.0.1

Testing device :
Nexus 5 Running Android OS 6.0

Testing Emulators : (i am using genymotion for the android emulator testing)
Google Nexus 5 - 5.1.0 - API 22
Google Nexus 6 - 5.1.0 - API 22

Debugging if GA Tracker is Firing

Hi,

Is there a way to check if the trackScreen or trackEvent is firing through the command line instead of looking in Google Anayltics dashboard.

Thanks,
Victor

Dispatch Interval

According to the example in app.js

// Data collected using the Google Analytics SDK for Android is stored locally before being
// dispatched on a separate thread to Google Analytics.
// By default, data is dispatched from the Google Analytics SDK for Android every 30 minutes.
GA.dispatchInterval = 15; // minutes

Looking at the official documentation, it looks like the unit is in seconds for iOS and minutes for Android.

https://developers.google.com/analytics/devguides/collection/ios/v3/dispatch
https://developers.google.com/analytics/devguides/collection/android/v3/dispatch

I've looked into the java and obj-c code of this module. There is no conversion of the unit so I guess I have to set the dispatchInterval depending on the OS in the JS code to have it behave identical?

if(Ti.Platform.osname == 'android') {
    GA.dispatchInterval = 2; // in minutes
}
else if(Ti.Platform.name == 'iPhone OS') {
    GA.dispatchInterval = 120; // in seconds
}

Can someone confirm this?

Thanks
Danny

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.